fixed more warnings on 64 bit boxes
authorAndrew Tridgell <tridge@samba.org>
Tue, 29 May 2007 03:58:41 +0000 (13:58 +1000)
committerAndrew Tridgell <tridge@samba.org>
Tue, 29 May 2007 03:58:41 +0000 (13:58 +1000)
common/ctdb_client.c
common/ctdb_daemon.c
common/ctdb_io.c
common/ctdb_message.c
common/ctdb_recoverd.c
include/ctdb_private.h
tcp/tcp_io.c

index c384fb3bda53e6de13f360a0205ab0249d829a97..8a96dbc7caf81afb06b5e1e042359733d3d91c9f 100644 (file)
@@ -115,7 +115,7 @@ static void ctdb_client_read_cb(uint8_t *data, size_t cnt, void *args)
        }
 
        if (cnt < sizeof(*hdr)) {
-               DEBUG(0,("Bad packet length %u in client\n", cnt));
+               DEBUG(0,("Bad packet length %u in client\n", (unsigned)cnt));
                goto done;
        }
        if (cnt != hdr->length) {
@@ -527,7 +527,7 @@ struct ctdb_record_handle *ctdb_fetch_lock(struct ctdb_db_context *ctdb_db, TALL
        }
        h->data    = data;
 
-       DEBUG(3,("ctdb_fetch_lock: key=%*.*s\n", key.dsize, key.dsize, 
+       DEBUG(3,("ctdb_fetch_lock: key=%*.*s\n", (int)key.dsize, (int)key.dsize, 
                 (const char *)key.dptr));
 
 again:
@@ -823,7 +823,7 @@ int ctdb_ctrl_statistics(struct ctdb_context *ctdb, uint32_t destnode, struct ct
 
        if (data.dsize != sizeof(struct ctdb_statistics)) {
                DEBUG(0,(__location__ " Wrong statistics size %u - expected %u\n",
-                        data.dsize, sizeof(struct ctdb_statistics)));
+                        (unsigned)data.dsize, (unsigned)sizeof(struct ctdb_statistics)));
                      return -1;
        }
 
@@ -1330,7 +1330,7 @@ int ctdb_ctrl_get_debuglevel(struct ctdb_context *ctdb, uint32_t destnode, uint3
        }
        if (data.dsize != sizeof(uint32_t)) {
                DEBUG(0,("Bad control reply size in ctdb_get_debuglevel (got %u)\n",
-                             data.dsize));
+                        (unsigned)data.dsize));
                return -1;
        }
        *level = *(uint32_t *)data.dptr;
@@ -1518,7 +1518,7 @@ static void traverse_handler(struct ctdb_context *ctdb, uint64_t srvid, TDB_DATA
 
        if (data.dsize < sizeof(uint32_t) ||
            d->length != data.dsize) {
-               DEBUG(0,("Bad data size %u in traverse_handler\n", data.dsize));
+               DEBUG(0,("Bad data size %u in traverse_handler\n", (unsigned)data.dsize));
                state->done = True;
                return;
        }
index 6b76c1824cf60d76db455ff532c2feef73c78779..7e871a15cc0255b6ec190ce5214dc0f1c602ca9b 100644 (file)
@@ -142,9 +142,11 @@ int daemon_register_message_handler(struct ctdb_context *ctdb, uint32_t client_i
        }
        res = ctdb_register_message_handler(ctdb, client, srvid, daemon_message_handler, client);
        if (res != 0) {
-               DEBUG(0,(__location__ " Failed to register handler %llu in daemon\n", srvid));
+               DEBUG(0,(__location__ " Failed to register handler %llu in daemon\n", 
+                        (unsigned long long)srvid));
        } else {
-               DEBUG(2,(__location__ " Registered message handler for srvid=%llu\n", srvid));
+               DEBUG(2,(__location__ " Registered message handler for srvid=%llu\n", 
+                        (unsigned long long)srvid));
        }
        return res;
 }
@@ -789,7 +791,7 @@ struct ctdb_req_header *_ctdbd_allocate_pkt(struct ctdb_context *ctdb,
        hdr = (struct ctdb_req_header *)talloc_size(mem_ctx, size);
        if (hdr == NULL) {
                DEBUG(0,("Unable to allocate packet for operation %u of length %u\n",
-                        operation, length));
+                        operation, (unsigned)length));
                return NULL;
        }
        talloc_set_name_const(hdr, type);
@@ -825,7 +827,7 @@ struct ctdb_req_header *_ctdb_transport_allocate(struct ctdb_context *ctdb,
        hdr = (struct ctdb_req_header *)ctdb->methods->allocate_pkt(mem_ctx, size);
        if (hdr == NULL) {
                DEBUG(0,("Unable to allocate transport packet for operation %u of length %u\n",
-                        operation, length));
+                        operation, (unsigned)length));
                return NULL;
        }
        talloc_set_name_const(hdr, type);
index 2ca84212ce120a4ad0c60985325ca9287c780ce9..190b6f2e09af4e3ab31e42254c99f814db00c303 100644 (file)
@@ -85,7 +85,7 @@ static void queue_io_read(struct ctdb_queue *queue)
 
        nread = read(queue->fd, queue->partial.data + queue->partial.length, num_ready);
        if (nread <= 0) {
-               DEBUG(0,("read error nread=%d\n", nread));
+               DEBUG(0,("read error nread=%d\n", (int)nread));
                goto failed;
        }
 
@@ -135,7 +135,7 @@ static void queue_io_read(struct ctdb_queue *queue)
                        queue->partial.data = talloc_memdup(queue, data, nread);
                        if (queue->partial.data == NULL) {
                                DEBUG(0,("read error memdup partial failed for %u\n", 
-                                        nread));
+                                        (unsigned)nread));
                                goto failed;
                        }
                        queue->partial.length = nread;
index 1a7a29508f0136593448cd47cf32592ca449eb4c..89bfa61a283504d3eec39e512731a66ba14fa2fc 100644 (file)
@@ -79,7 +79,8 @@ static void ctdb_local_message_trigger(struct event_context *ev, struct timed_ev
 
        res = ctdb_dispatch_message(m->ctdb, m->srvid, m->data);
        if (res != 0) {
-               DEBUG(0, (__location__ " Failed to dispatch message for srvid=%llu\n", m->srvid));
+               DEBUG(0, (__location__ " Failed to dispatch message for srvid=%llu\n", 
+                         (unsigned long long)m->srvid));
        }
        talloc_free(m);
 }
index 2dbc9e1ce6e57886e46b1edc0108d462c2d65342..dca340bff2ebeda1d2f703c2741528edf52295c2 100644 (file)
@@ -286,7 +286,7 @@ static int vacuum_db(struct ctdb_context *ctdb, uint32_t db_id, struct ctdb_node
                                                 db_id, max_rsn+1);
                if (ret != 0) {
                        DEBUG(0,(__location__ " Failed to set rsn on node %u to %llu\n",
-                                nodemap->nodes[i].vnn, max_rsn+1));
+                                nodemap->nodes[i].vnn, (unsigned long long)max_rsn+1));
                        return -1;
                }
        }
@@ -300,7 +300,7 @@ static int vacuum_db(struct ctdb_context *ctdb, uint32_t db_id, struct ctdb_node
                                                 db_id, max_rsn+1);
                if (ret != 0) {
                        DEBUG(0,(__location__ " Failed to delete records on node %u with rsn below %llu\n",
-                                nodemap->nodes[i].vnn, max_rsn+1));
+                                nodemap->nodes[i].vnn, (unsigned long long)max_rsn+1));
                        return -1;
                }
        }
index 07dc38d8739baaee9eb8387620db4737a3e50f11..74c08e0b0e8c4fb99382f58c9eec3ce241a43ac5 100644 (file)
@@ -821,7 +821,7 @@ int ctdb_control(struct ctdb_context *ctdb, uint32_t destnode, uint64_t srvid,
 #define CHECK_CONTROL_DATA_SIZE(size) do { \
  if (indata.dsize != size) { \
         DEBUG(0,(__location__ " Invalid data size in opcode %u. Got %u expected %u\n", \
-                 opcode, indata.dsize, size));                         \
+                 opcode, (unsigned)indata.dsize, (unsigned)size));     \
         return -1; \
  } \
  } while (0)
index e90770ec73cfd80672e2c307daa9567e6868832e..ee9438d44dbe7dcaad6f42f77b0cb1747d4ccbab 100644 (file)
@@ -47,7 +47,8 @@ void ctdb_tcp_read_cb(uint8_t *data, size_t cnt, void *args)
        }
 
        if (cnt & (CTDB_TCP_ALIGNMENT-1)) {
-               DEBUG(0,(__location__ " Length 0x%x not multiple of alignment\n", cnt));
+               DEBUG(0,(__location__ " Length 0x%x not multiple of alignment\n", 
+                        (unsigned)cnt));
                goto failed;
        }