From ee228e870dbcc31fa1db848836467216339dea51 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sat, 28 Apr 2007 11:35:49 +0200 Subject: [PATCH] fixed some warnings (This used to be ctdb commit b5434a40cf2db008eb1e681fcd2ceeff331324fa) --- ctdb/common/ctdb_client.c | 4 ++-- ctdb/common/ctdb_daemon.c | 5 +++-- ctdb/tcp/tcp_io.c | 6 +++--- ctdb/tests/ctdb_messaging.c | 3 ++- 4 files changed, 10 insertions(+), 8 deletions(-) diff --git a/ctdb/common/ctdb_client.c b/ctdb/common/ctdb_client.c index 529420d158d..f3f3adb9bb5 100644 --- a/ctdb/common/ctdb_client.c +++ b/ctdb/common/ctdb_client.c @@ -119,8 +119,8 @@ static void ctdb_client_read_cb(uint8_t *data, size_t cnt, void *args) goto done; } if (cnt != hdr->length) { - ctdb_set_error(ctdb, "Bad header length %d expected %d in client\n", - hdr->length, cnt); + ctdb_set_error(ctdb, "Bad header length %u expected %u in client\n", + (unsigned)hdr->length, (unsigned)cnt); goto done; } diff --git a/ctdb/common/ctdb_daemon.c b/ctdb/common/ctdb_daemon.c index b0b48102420..efdaf12084b 100644 --- a/ctdb/common/ctdb_daemon.c +++ b/ctdb/common/ctdb_daemon.c @@ -498,13 +498,14 @@ static void ctdb_daemon_read_cb(uint8_t *data, size_t cnt, void *args) client->ctdb->status.client_packets_recv++; if (cnt < sizeof(*hdr)) { - ctdb_set_error(client->ctdb, "Bad packet length %u in daemon\n", cnt); + ctdb_set_error(client->ctdb, "Bad packet length %u in daemon\n", + (unsigned)cnt); return; } hdr = (struct ctdb_req_header *)data; if (cnt != hdr->length) { ctdb_set_error(client->ctdb, "Bad header length %u expected %u\n in daemon", - hdr->length, cnt); + (unsigned)hdr->length, (unsigned)cnt); return; } diff --git a/ctdb/tcp/tcp_io.c b/ctdb/tcp/tcp_io.c index 150d726afb0..3e267e504cd 100644 --- a/ctdb/tcp/tcp_io.c +++ b/ctdb/tcp/tcp_io.c @@ -43,13 +43,13 @@ void ctdb_tcp_read_cb(uint8_t *data, size_t cnt, void *args) } if (cnt < sizeof(*hdr)) { - ctdb_set_error(in->ctdb, "Bad packet length %d\n", cnt); + ctdb_set_error(in->ctdb, "Bad packet length %u\n", (unsigned)cnt); return; } hdr = (struct ctdb_req_header *)data; if (cnt != hdr->length) { - ctdb_set_error(in->ctdb, "Bad header length %d expected %d\n", - hdr->length, cnt); + ctdb_set_error(in->ctdb, "Bad header length %u expected %u\n", + (unsigned)hdr->length, (unsigned)cnt); return; } diff --git a/ctdb/tests/ctdb_messaging.c b/ctdb/tests/ctdb_messaging.c index 557cc5b2586..84f187e512a 100644 --- a/ctdb/tests/ctdb_messaging.c +++ b/ctdb/tests/ctdb_messaging.c @@ -36,7 +36,8 @@ static int num_clients = 2; static void message_handler(struct ctdb_context *ctdb, uint64_t srvid, TDB_DATA data, void *private_data) { - printf("client vnn:%d received a message to srvid:%lld [%s]\n",ctdb_get_vnn(ctdb),srvid,data.dptr); + printf("client vnn:%d received a message to srvid:%llu [%s]\n", + ctdb_get_vnn(ctdb), (unsigned long long)srvid, data.dptr); fflush(stdout); }