[Sheepdog] [PATCH 1/5] use PRIuXX macros in group.c
Steven Dake
sdake at redhat.com
Mon May 17 22:56:38 CEST 2010
The C language has problems around typing and format printing. The usual
solution to this problem is to use the PRIuXX macro set.
Signed-off-by: Steven Dake <sdake at redhat.com>
---
sheep/group.c | 18 +++++++++---------
1 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/sheep/group.c b/sheep/group.c
index 3313b10..51b3300 100644
--- a/sheep/group.c
+++ b/sheep/group.c
@@ -389,36 +389,36 @@ static int get_cluster_status(struct sheepdog_node_list_entry *from,
break;
if (ctime != get_cluster_ctime()) {
- eprintf("joining node has invalid ctime, %ld\n", from->id);
+ eprintf("joining node has invalid ctime, %"PRIu64"\n", from->id);
return SD_RES_INVALID_CTIME;
}
local_epoch = get_latest_epoch();
if (epoch > local_epoch) {
- eprintf("sheepdog is running with older epoch, %d %d %ld\n",
+ eprintf("sheepdog is running with older epoch, %"PRIu32" %"PRIu32" %"PRIu64"\n",
epoch, local_epoch, from->id);
return SD_RES_OLD_NODE_VER;
}
break;
case SD_STATUS_WAIT_FOR_FORMAT:
if (nr_entries != 0) {
- eprintf("joining node is not clean, %ld\n", from->id);
+ eprintf("joining node is not clean, %"PRIu64"\n", from->id);
return SD_RES_NOT_FORMATTED;
}
break;
case SD_STATUS_WAIT_FOR_JOIN:
if (ctime != get_cluster_ctime()) {
- eprintf("joining node has invalid ctime, %ld\n", from->id);
+ eprintf("joining node has invalid ctime, %"PRIu64"\n", from->id);
return SD_RES_INVALID_CTIME;
}
local_epoch = get_latest_epoch();
if (epoch > local_epoch) {
- eprintf("sheepdog is waiting with older epoch, %d %d %ld\n",
+ eprintf("sheepdog is waiting with older epoch, %"PRIu32" %"PRIu32" %"PRIu64"\n",
epoch, local_epoch, from->id);
return SD_RES_OLD_NODE_VER;
} else if (epoch < local_epoch) {
- eprintf("sheepdog is waiting with newer epoch, %d %d %ld\n",
+ eprintf("sheepdog is waiting with newer epoch, %"PRIu32" %"PRIu32" %"PRIu64"\n",
epoch, local_epoch, from->id);
return SD_RES_NEW_NODE_VER;
}
@@ -428,13 +428,13 @@ static int get_cluster_status(struct sheepdog_node_list_entry *from,
nr_local_entries /= sizeof(local_entries[0]);
if (nr_entries != nr_local_entries) {
- eprintf("joining node has invalid epoch, %d %ld\n",
+ eprintf("joining node has invalid epoch, %"PRIu32" %"PRIu64"\n",
epoch, from->id);
return SD_RES_INVALID_EPOCH;
}
if (memcmp(entries, local_entries, sizeof(entries[0]) * nr_entries) != 0) {
- eprintf("joining node has invalid epoch, %ld\n", from->id);
+ eprintf("joining node has invalid epoch, %"PRIu64"\n", from->id);
return SD_RES_INVALID_EPOCH;
}
@@ -1274,7 +1274,7 @@ static void cpg_event_fn(struct work *w, int idx)
break;
case CPG_EVENT_DELIVER:
{
- struct work_deliver *w = container_of(cevent, struct work_deliver, cev);
+ struct work_deliver *w = container_of(cevent, struct work_deliver, cev);
vprintf(SDOG_DEBUG "%d\n", w->msg->state);
__sd_deliver(cevent);
break;
--
1.6.2.5
More information about the sheepdog
mailing list