summaryrefslogtreecommitdiff
path: root/source4/cluster/ctdb
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2007-09-08 13:27:14 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 15:05:41 -0500
commitdccf3f99e45137b6cd18c1de1c79808ad67130d1 (patch)
tree7c0f8e64f4ded3701818b8968171597eccd62267 /source4/cluster/ctdb
parentffeee68e4b72dd94fee57366bd8d38b8c284c3d4 (diff)
downloadsamba-dccf3f99e45137b6cd18c1de1c79808ad67130d1.tar.gz
samba-dccf3f99e45137b6cd18c1de1c79808ad67130d1.tar.bz2
samba-dccf3f99e45137b6cd18c1de1c79808ad67130d1.zip
r25027: Fix more warnings.
(This used to be commit 5085c53fcfade614e83d21fc2c1a5bc43bb2a729)
Diffstat (limited to 'source4/cluster/ctdb')
-rw-r--r--source4/cluster/ctdb/client/ctdb_client.c25
-rw-r--r--source4/cluster/ctdb/common/ctdb_io.c6
-rw-r--r--source4/cluster/ctdb/common/ctdb_ltdb.c4
3 files changed, 18 insertions, 17 deletions
diff --git a/source4/cluster/ctdb/client/ctdb_client.c b/source4/cluster/ctdb/client/ctdb_client.c
index 626ecf01c7..7525b296d6 100644
--- a/source4/cluster/ctdb/client/ctdb_client.c
+++ b/source4/cluster/ctdb/client/ctdb_client.c
@@ -79,7 +79,7 @@ int ctdb_call_local(struct ctdb_db_context *ctdb_db, struct ctdb_call *call,
c->key = call->key;
c->call_data = &call->call_data;
- c->record_data.dptr = talloc_memdup(c, data->dptr, data->dsize);
+ c->record_data.dptr = (unsigned char *)talloc_memdup(c, data->dptr, data->dsize);
c->record_data.dsize = data->dsize;
CTDB_NO_MEMORY(ctdb, c->record_data.dptr);
c->new_data = NULL;
@@ -311,9 +311,10 @@ int ctdb_call_recv(struct ctdb_client_call_state *state, struct ctdb_call *call)
}
if (state->call.reply_data.dsize) {
- call->reply_data.dptr = talloc_memdup(state->ctdb_db,
- state->call.reply_data.dptr,
- state->call.reply_data.dsize);
+ call->reply_data.dptr = (unsigned char *)talloc_memdup(
+ state->ctdb_db,
+ state->call.reply_data.dptr,
+ state->call.reply_data.dsize);
call->reply_data.dsize = state->call.reply_data.dsize;
} else {
call->reply_data.dptr = NULL;
@@ -484,7 +485,7 @@ int ctdb_set_message_handler(struct ctdb_context *ctdb, uint64_t srvid,
/*
tell the daemon we no longer want a srvid
*/
-int ctdb_remove_message_handler(struct ctdb_context *ctdb, uint64_t srvid, void *private_data)
+static int ctdb_remove_message_handler(struct ctdb_context *ctdb, uint64_t srvid, void *private_data)
{
int res;
int32_t status;
@@ -580,7 +581,7 @@ struct ctdb_record_handle *ctdb_fetch_lock(struct ctdb_db_context *ctdb_db, TALL
h->ctdb_db = ctdb_db;
h->key = key;
- h->key.dptr = talloc_memdup(h, key.dptr, key.dsize);
+ h->key.dptr = (unsigned char *)talloc_memdup(h, key.dptr, key.dsize);
if (h->key.dptr == NULL) {
talloc_free(h);
return NULL;
@@ -812,7 +813,7 @@ int ctdb_control(struct ctdb_context *ctdb, uint32_t destnode, uint64_t srvid,
if (outdata) {
*outdata = state->outdata;
- outdata->dptr = talloc_memdup(mem_ctx, outdata->dptr, outdata->dsize);
+ outdata->dptr = (unsigned char *)talloc_memdup(mem_ctx, outdata->dptr, outdata->dsize);
}
*status = state->status;
@@ -1156,10 +1157,10 @@ int ctdb_ctrl_pulldb(struct ctdb_context *ctdb, uint32_t destnode, uint32_t dbid
rec = (struct ctdb_rec_data *)&reply->data[0];
for (i=0;i<reply->count;i++) {
- keys->keys[i].dptr = talloc_memdup(mem_ctx, &rec->data[0], rec->keylen);
+ keys->keys[i].dptr = (unsigned char *)talloc_memdup(mem_ctx, &rec->data[0], rec->keylen);
keys->keys[i].dsize = rec->keylen;
- keys->data[i].dptr = talloc_memdup(mem_ctx, &rec->data[keys->keys[i].dsize], rec->datalen);
+ keys->data[i].dptr = (unsigned char *)talloc_memdup(mem_ctx, &rec->data[keys->keys[i].dsize], rec->datalen);
keys->data[i].dsize = rec->datalen;
if (keys->data[i].dsize < sizeof(struct ctdb_ltdb_header)) {
@@ -1333,7 +1334,7 @@ int ctdb_ctrl_createdb(struct ctdb_context *ctdb, struct timeval timeout, uint32
int32_t res;
TDB_DATA data;
- data.dptr = discard_const(name);
+ data.dptr = (unsigned char *)discard_const(name);
data.dsize = strlen(name)+1;
ret = ctdb_control(ctdb, destnode, 0,
@@ -1468,7 +1469,7 @@ struct ctdb_db_context *ctdb_attach(struct ctdb_context *ctdb, const char *name)
ctdb_db->db_name = talloc_strdup(ctdb_db, name);
CTDB_NO_MEMORY_NULL(ctdb, ctdb_db->db_name);
- data.dptr = discard_const(name);
+ data.dptr = (unsigned char *)discard_const(name);
data.dsize = strlen(name)+1;
/* tell ctdb daemon to attach */
@@ -1929,7 +1930,7 @@ int ctdb_ctrl_get_tunable(struct ctdb_context *ctdb,
int ret;
data.dsize = offsetof(struct ctdb_control_get_tunable, name) + strlen(name) + 1;
- data.dptr = talloc_size(ctdb, data.dsize);
+ data.dptr = (unsigned char *)talloc_size(ctdb, data.dsize);
CTDB_NO_MEMORY(ctdb, data.dptr);
t = (struct ctdb_control_get_tunable *)data.dptr;
diff --git a/source4/cluster/ctdb/common/ctdb_io.c b/source4/cluster/ctdb/common/ctdb_io.c
index 5c418e4956..ca9c635878 100644
--- a/source4/cluster/ctdb/common/ctdb_io.c
+++ b/source4/cluster/ctdb/common/ctdb_io.c
@@ -115,7 +115,7 @@ static void queue_io_read(struct ctdb_queue *queue)
DEBUG(0,("Invalid packet of length 0\n"));
goto failed;
}
- d2 = talloc_memdup(queue, data, len);
+ d2 = (uint8_t *)talloc_memdup(queue, data, len);
if (d2 == NULL) {
DEBUG(0,("read error memdup failed for %u\n", len));
/* sigh */
@@ -132,7 +132,7 @@ static void queue_io_read(struct ctdb_queue *queue)
queue->partial.data = data;
queue->partial.length = nread;
} else {
- queue->partial.data = talloc_memdup(queue, data, nread);
+ queue->partial.data = (uint8_t *)talloc_memdup(queue, data, nread);
if (queue->partial.data == NULL) {
DEBUG(0,("read error memdup partial failed for %u\n",
(unsigned)nread));
@@ -266,7 +266,7 @@ int ctdb_queue_send(struct ctdb_queue *queue, uint8_t *data, uint32_t length)
pkt = talloc(queue, struct ctdb_queue_pkt);
CTDB_NO_MEMORY(queue->ctdb, pkt);
- pkt->data = talloc_memdup(pkt, data, length2);
+ pkt->data = (uint8_t *)talloc_memdup(pkt, data, length2);
CTDB_NO_MEMORY(queue->ctdb, pkt->data);
pkt->length = length2;
diff --git a/source4/cluster/ctdb/common/ctdb_ltdb.c b/source4/cluster/ctdb/common/ctdb_ltdb.c
index 7db1523ca1..8d8b4fd24a 100644
--- a/source4/cluster/ctdb/common/ctdb_ltdb.c
+++ b/source4/cluster/ctdb/common/ctdb_ltdb.c
@@ -106,7 +106,7 @@ int ctdb_ltdb_fetch(struct ctdb_db_context *ctdb_db,
if (data) {
data->dsize = rec.dsize - sizeof(struct ctdb_ltdb_header);
- data->dptr = talloc_memdup(mem_ctx,
+ data->dptr = (unsigned char *)talloc_memdup(mem_ctx,
sizeof(struct ctdb_ltdb_header)+rec.dptr,
data->dsize);
}
@@ -144,7 +144,7 @@ int ctdb_ltdb_store(struct ctdb_db_context *ctdb_db, TDB_DATA key,
}
rec.dsize = sizeof(*header) + data.dsize;
- rec.dptr = talloc_size(ctdb, rec.dsize);
+ rec.dptr = (unsigned char *)talloc_size(ctdb, rec.dsize);
CTDB_NO_MEMORY(ctdb, rec.dptr);
memcpy(rec.dptr, header, sizeof(*header));