summaryrefslogtreecommitdiff
path: root/source3/locking
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2007-03-29 09:35:51 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:19:00 -0500
commitbc2b6436d0f5f3e9ffdfaeb7f1b32996a83d5478 (patch)
tree45124e070043ee0fd3774d74b4cfdcf1c8919c27 /source3/locking
parentb9461058d59f8e4f4b69c31592bd12a179b2d8ac (diff)
downloadsamba-bc2b6436d0f5f3e9ffdfaeb7f1b32996a83d5478.tar.gz
samba-bc2b6436d0f5f3e9ffdfaeb7f1b32996a83d5478.tar.bz2
samba-bc2b6436d0f5f3e9ffdfaeb7f1b32996a83d5478.zip
r22009: change TDB_DATA from char * to unsigned char *
and fix all compiler warnings in the users metze (This used to be commit 3a28443079c141a6ce8182c65b56ca210e34f37f)
Diffstat (limited to 'source3/locking')
-rw-r--r--source3/locking/brlock.c8
-rw-r--r--source3/locking/locking.c20
-rw-r--r--source3/locking/posix.c8
3 files changed, 18 insertions, 18 deletions
diff --git a/source3/locking/brlock.c b/source3/locking/brlock.c
index 76a4039d82..899e211ffc 100644
--- a/source3/locking/brlock.c
+++ b/source3/locking/brlock.c
@@ -1453,7 +1453,7 @@ static int traverse_fn(TDB_CONTEXT *ttdb, TDB_DATA kbuf, TDB_DATA dbuf, void *st
}
if (orig_num_locks != num_locks) {
- dbuf.dptr = (char *)locks;
+ dbuf.dptr = (uint8 *)locks;
dbuf.dsize = num_locks * sizeof(*locks);
if (dbuf.dsize) {
@@ -1499,7 +1499,7 @@ static int byte_range_lock_destructor(struct byte_range_lock *br_lck)
{
TDB_DATA key;
- key.dptr = (char *)&br_lck->key;
+ key.dptr = (uint8 *)&br_lck->key;
key.dsize = sizeof(struct lock_key);
if (br_lck->read_only) {
@@ -1517,7 +1517,7 @@ static int byte_range_lock_destructor(struct byte_range_lock *br_lck)
}
} else {
TDB_DATA data;
- data.dptr = (char *)br_lck->lock_data;
+ data.dptr = (uint8 *)br_lck->lock_data;
data.dsize = br_lck->num_locks * sizeof(struct lock_struct);
if (tdb_store(tdb, key, data, TDB_REPLACE) == -1) {
@@ -1558,7 +1558,7 @@ static struct byte_range_lock *brl_get_locks_internal(TALLOC_CTX *mem_ctx,
br_lck->key.device = fsp->dev;
br_lck->key.inode = fsp->inode;
- key.dptr = (char *)&br_lck->key;
+ key.dptr = (uint8 *)&br_lck->key;
key.dsize = sizeof(struct lock_key);
if (!fsp->lockdb_clean) {
diff --git a/source3/locking/locking.c b/source3/locking/locking.c
index 37e6dbc4e5..dc1d607155 100644
--- a/source3/locking/locking.c
+++ b/source3/locking/locking.c
@@ -433,7 +433,7 @@ static TDB_DATA locking_key(SMB_DEV_T dev, SMB_INO_T inode)
memset(&key, '\0', sizeof(key));
key.dev = dev;
key.ino = inode;
- kbuf.dptr = (char *)&key;
+ kbuf.dptr = (uint8 *)&key;
kbuf.dsize = sizeof(key);
return kbuf;
}
@@ -532,7 +532,7 @@ static BOOL parse_share_modes(TDB_DATA dbuf, struct share_mode_lock *lck)
/* Get any delete token. */
if (data->u.s.delete_token_size) {
- char *p = dbuf.dptr + sizeof(*data) +
+ uint8 *p = dbuf.dptr + sizeof(*data) +
(lck->num_share_modes *
sizeof(struct share_mode_entry));
@@ -578,7 +578,7 @@ static BOOL parse_share_modes(TDB_DATA dbuf, struct share_mode_lock *lck)
}
/* Save off the associated service path and filename. */
- lck->servicepath = talloc_strdup(lck, dbuf.dptr + sizeof(*data) +
+ lck->servicepath = talloc_strdup(lck, (const char *)dbuf.dptr + sizeof(*data) +
(lck->num_share_modes *
sizeof(struct share_mode_entry)) +
data->u.s.delete_token_size );
@@ -586,7 +586,7 @@ static BOOL parse_share_modes(TDB_DATA dbuf, struct share_mode_lock *lck)
smb_panic("talloc_strdup failed\n");
}
- lck->filename = talloc_strdup(lck, dbuf.dptr + sizeof(*data) +
+ lck->filename = talloc_strdup(lck, (const char *)dbuf.dptr + sizeof(*data) +
(lck->num_share_modes *
sizeof(struct share_mode_entry)) +
data->u.s.delete_token_size +
@@ -646,7 +646,7 @@ static TDB_DATA unparse_share_modes(struct share_mode_lock *lck)
delete_token_size +
sp_len + 1 +
strlen(lck->filename) + 1;
- result.dptr = TALLOC_ARRAY(lck, char, result.dsize);
+ result.dptr = TALLOC_ARRAY(lck, uint8, result.dsize);
if (result.dptr == NULL) {
smb_panic("talloc failed\n");
@@ -668,7 +668,7 @@ static TDB_DATA unparse_share_modes(struct share_mode_lock *lck)
/* Store any delete on close token. */
if (lck->delete_token) {
- char *p = result.dptr + offset;
+ uint8 *p = result.dptr + offset;
memcpy(p, &lck->delete_token->uid, sizeof(uid_t));
p += sizeof(uid_t);
@@ -683,10 +683,10 @@ static TDB_DATA unparse_share_modes(struct share_mode_lock *lck)
offset = p - result.dptr;
}
- safe_strcpy(result.dptr + offset, lck->servicepath,
+ safe_strcpy((char *)result.dptr + offset, lck->servicepath,
result.dsize - offset - 1);
offset += sp_len + 1;
- safe_strcpy(result.dptr + offset, lck->filename,
+ safe_strcpy((char *)result.dptr + offset, lck->filename,
result.dsize - offset - 1);
if (DEBUGLEVEL >= 10) {
@@ -1318,10 +1318,10 @@ static int traverse_fn(TDB_CONTEXT *the_tdb, TDB_DATA kbuf, TDB_DATA dbuf,
data = (struct locking_data *)dbuf.dptr;
shares = (struct share_mode_entry *)(dbuf.dptr + sizeof(*data));
- sharepath = dbuf.dptr + sizeof(*data) +
+ sharepath = (const char *)dbuf.dptr + sizeof(*data) +
data->u.s.num_share_mode_entries*sizeof(*shares) +
data->u.s.delete_token_size;
- fname = dbuf.dptr + sizeof(*data) +
+ fname = (const char *)dbuf.dptr + sizeof(*data) +
data->u.s.num_share_mode_entries*sizeof(*shares) +
data->u.s.delete_token_size +
strlen(sharepath) + 1;
diff --git a/source3/locking/posix.c b/source3/locking/posix.c
index 62804eb8e3..8bb7f605e3 100644
--- a/source3/locking/posix.c
+++ b/source3/locking/posix.c
@@ -340,7 +340,7 @@ static TDB_DATA fd_array_key(SMB_DEV_T dev, SMB_INO_T inode)
memset(&key, '\0', sizeof(key));
key.device = dev;
key.inode = inode;
- kbuf.dptr = (char *)&key;
+ kbuf.dptr = (uint8 *)&key;
kbuf.dsize = sizeof(key);
return kbuf;
}
@@ -358,7 +358,7 @@ static TDB_DATA locking_ref_count_key(SMB_DEV_T dev, SMB_INO_T inode)
key.device = dev;
key.inode = inode;
key.r = 'r';
- kbuf.dptr = (char *)&key;
+ kbuf.dptr = (uint8 *)&key;
kbuf.dsize = sizeof(key);
return kbuf;
}
@@ -442,7 +442,7 @@ static void increment_windows_lock_ref_count(files_struct *fsp)
dbuf = tdb_fetch(posix_pending_close_tdb, kbuf);
if (dbuf.dptr == NULL) {
- dbuf.dptr = (char *)SMB_MALLOC_P(int);
+ dbuf.dptr = (uint8 *)SMB_MALLOC_P(int);
if (!dbuf.dptr) {
smb_panic("increment_windows_lock_ref_count: malloc fail.\n");
}
@@ -573,7 +573,7 @@ static void add_fd_to_close_entry(files_struct *fsp)
dbuf = tdb_fetch(posix_pending_close_tdb, kbuf);
- dbuf.dptr = (char *)SMB_REALLOC(dbuf.dptr, dbuf.dsize + sizeof(int));
+ dbuf.dptr = (uint8 *)SMB_REALLOC(dbuf.dptr, dbuf.dsize + sizeof(int));
if (!dbuf.dptr) {
smb_panic("add_fd_to_close_entry: Realloc fail !\n");
}