[pve-devel] [PATCH cluster] cleanup format strings for cfs_* messages

Thomas Lamprecht t.lamprecht at proxmox.com
Tue May 24 15:55:53 CEST 2016


This does not change semantics on our current target platform
(x86_64) but is needed for porting it to other platforms.

The GCC on ARM, for example, complains about them.

For all:
* size_t use "%z*"
* off_t use "%j*"
* uint64_t use "PRI*64"

where * may be one of (X,d,u).

Also cast guint64 to uint64_t to allow use of a general, portable
format which also supports hex output as the GUINT64_FORMAT allows
decimal output only.

Signed-off-by: Thomas Lamprecht <t.lamprecht at proxmox.com>
Cc: mir at datanom.net
---

This allows me to compile pmxcfs successfully under armhf
and naturally the already working x86_64.

 data/src/cfs-plug.c |  6 +++---
 data/src/database.c | 25 +++++++++++++------------
 data/src/dcdb.c     | 29 +++++++++++++++--------------
 data/src/dfsm.c     | 23 ++++++++++++-----------
 data/src/logger.c   |  3 ++-
 data/src/memdb.c    | 17 +++++++++--------
 data/src/pmxcfs.c   |  6 +++---
 data/src/status.c   |  6 +++---
 8 files changed, 60 insertions(+), 55 deletions(-)

diff --git a/data/src/cfs-plug.c b/data/src/cfs-plug.c
index 9ccbb3d..3eee161 100644
--- a/data/src/cfs-plug.c
+++ b/data/src/cfs-plug.c
@@ -268,7 +268,7 @@ static int cfs_plug_base_read(cfs_plug_t *plug, const char *path, char *buf,
 	g_return_val_if_fail(buf != NULL, PARAM_CHECK_ERRNO);
 	g_return_val_if_fail(fi != NULL, PARAM_CHECK_ERRNO);
 
-	cfs_debug("enter cfs_plug_base_read %s %lu %ld", path, size, offset);
+	cfs_debug("enter cfs_plug_base_read %s %zu %jd", path, size, offset);
 
 	int ret = -EACCES;
 
@@ -291,7 +291,7 @@ static int cfs_plug_base_write(cfs_plug_t *plug, const char *path, const char *b
 	g_return_val_if_fail(buf != NULL, PARAM_CHECK_ERRNO);
 	g_return_val_if_fail(fi != NULL, PARAM_CHECK_ERRNO);
 
-	cfs_debug("enter cfs_plug_base_write %s %lu %ld", path, size, offset);
+	cfs_debug("enter cfs_plug_base_write %s %zu %jd", path, size, offset);
 
 	int ret = -EACCES;
 
@@ -309,7 +309,7 @@ static int cfs_plug_base_truncate(cfs_plug_t *plug, const char *path, off_t size
 	g_return_val_if_fail(plug->ops == &cfs_ops, PARAM_CHECK_ERRNO);
 	g_return_val_if_fail(path != NULL, PARAM_CHECK_ERRNO);
 
-	cfs_debug("enter cfs_plug_base_truncate %s %ld", path, size);
+	cfs_debug("enter cfs_plug_base_truncate %s %jd", path, size);
 
 	int ret = -EACCES;
 
diff --git a/data/src/database.c b/data/src/database.c
index 391f3e6..e6f4ee8 100644
--- a/data/src/database.c
+++ b/data/src/database.c
@@ -25,6 +25,7 @@
 #endif /* HAVE_CONFIG_H */
 
 #include <stdlib.h>
+#include <inttypes.h>
 #include <stdio.h>
 #include <string.h>
 #include <unistd.h>
@@ -153,7 +154,7 @@ static int backend_write_inode(
 {
 	int rc;
 
-	cfs_debug("enter backend_write_inode %016zX", inode);
+	cfs_debug("enter backend_write_inode %016" PRIX64, inode);
 
 	if ((rc = sqlite3_bind_int64(stmt, 1, inode)) !=  SQLITE_OK) {
 		cfs_critical("sqlite3_bind failed: %s\n", sqlite3_errmsg(db));
@@ -271,7 +272,7 @@ int bdb_backend_write(
 			goto rollback;
 
 		if (sqlite3_changes(bdb->db) != 1) {
-			cfs_critical("no such inode %016zX", inode);
+			cfs_critical("no such inode %016" PRIX64, inode);
 			goto rollback;
 		}
 	}
@@ -332,7 +333,7 @@ static gboolean bdb_backend_load_index(
 		const char *name = (const char *)sqlite3_column_text(stmt, 6);
 		int namelen = sqlite3_column_bytes(stmt, 6);
 		if (name == NULL || namelen == 0) {
-			cfs_critical("inode has no name (inode = %016zX)", inode);
+			cfs_critical("inode has no name (inode = %016" PRIX64 ")", inode);
 			goto fail;
 		} 
 		te = g_malloc0(sizeof(memdb_tree_entry_t) + namelen + 1);
@@ -355,20 +356,20 @@ static gboolean bdb_backend_load_index(
 				te->data.value = g_memdup(value, size);
 		} else if (te->type == DT_DIR) {
 			if (size) {
-				cfs_critical("directory inode contains data (inode = %016zX)",
+				cfs_critical("directory inode contains data (inode = %016" PRIX64 ")",
 					   te->inode);
 				g_free(te);
 				goto fail;
 			}
 			te->data.entries = NULL;
 		} else {
-			cfs_critical("inode has unknown type (inode = %016zX, type = %d)",
+			cfs_critical("inode has unknown type (inode = %016" PRIX64 ", type = %d)",
 				   te->inode, te->type);
 			g_free(te);
 			goto fail;
 		}
 
-		cfs_debug("name %s (inode = %016zX, parent = %016zX)", 
+		cfs_debug("name %s (inode = %016" PRIX64 ", parent = %016" PRIX64 ")",
 			te->name, te->inode, te->parent);
 
 		if (te->inode == 0) {
@@ -396,7 +397,7 @@ static gboolean bdb_backend_load_index(
 
 			} else if (!(pte->type == DT_DIR || pte->type == 0)) {
 				cfs_critical("parent is not a directory "
-					     "(inode = %016zX, parent = %016zX, name = '%s')", 
+					     "(inode = %016" PRIX64 ", parent = %016" PRIX64 ", name = '%s')",
 					     te->inode, te->parent, te->name);
 				memdb_tree_entry_free(te);
 				goto fail;
@@ -408,7 +409,7 @@ static gboolean bdb_backend_load_index(
 				if ((tmpte = g_hash_table_lookup(index, &te->inode))) {
 					if (tmpte->type != 0) {
 						cfs_critical("found strange placeholder for "
-							     "(inode = %016zX, parent = %016zX, name = '%s', type = '%d')", 
+							     "(inode = %016" PRIX64 ", parent = %016" PRIX64 ", name = '%s', type = '%d')",
 							     te->inode, te->parent, te->name, tmpte->type);
 						memdb_tree_entry_free(te);
 						goto fail;
@@ -423,7 +424,7 @@ static gboolean bdb_backend_load_index(
 				
 			if (g_hash_table_lookup(pte->data.entries, te->name)) {
 				cfs_critical("found entry with duplicate name "
-					     "(inode = %016zX, parent = %016zX, name = '%s')", 
+					     "(inode = %016" PRIX64 ", parent = %016" PRIX64 ", name = '%s')",
 					     te->inode, te->parent, te->name);
 				goto fail;
 			}
@@ -444,7 +445,7 @@ static gboolean bdb_backend_load_index(
 	while (g_hash_table_iter_next (&iter, &key, &value)) {
 		memdb_tree_entry_t *te = (memdb_tree_entry_t *)value;
 		if (te->type == 0) {
-			cfs_critical("missing directory inode (inode = %016zX)", te->inode);
+			cfs_critical("missing directory inode (inode = %016" PRIX64 ")", te->inode);
 			goto fail;
 		}
 	}
@@ -505,7 +506,7 @@ gboolean bdb_backend_commit_update(
 				if (bdb_backend_delete_inode(bdb, slave_inode) != SQLITE_OK)
 					goto abort;
 
-				cfs_debug("deleted inode %016zX", slave_inode);
+				cfs_debug("deleted inode %016" PRIX64, slave_inode);
 			}
 			j++;
 		}
@@ -519,7 +520,7 @@ gboolean bdb_backend_commit_update(
 		if (bdb_backend_delete_inode(bdb, slave_inode) != SQLITE_OK)
 			goto abort;
 	       
-		cfs_debug("deleted inode %016zX", slave_inode);
+		cfs_debug("deleted inode %016" PRIX64, slave_inode);
 
 		j++;
 	}
diff --git a/data/src/dcdb.c b/data/src/dcdb.c
index b83caa4..df7b37a 100644
--- a/data/src/dcdb.c
+++ b/data/src/dcdb.c
@@ -26,6 +26,7 @@
 
 #include <stdlib.h>
 #include <stdio.h>
+#include <inttypes.h>
 #include <string.h>
 #include <unistd.h>
 #include <glib.h>
@@ -88,7 +89,7 @@ dcdb_parse_unlock_request(
 	g_return_val_if_fail(csum != NULL, FALSE);
 
 	if (msg_len < 33) {
-		cfs_critical("received short unlock message (%lu < 33)", msg_len);
+		cfs_critical("received short unlock message (%zu < 33)", msg_len);
 		return FALSE;
 	}
 
@@ -178,7 +179,7 @@ dcdb_parse_fuse_message(
 	g_return_val_if_fail(flags != NULL, FALSE);
 
 	if (msg_len < 20) {
-		cfs_critical("received short fuse message (%lu < 20)", msg_len);
+		cfs_critical("received short fuse message (%zu < 20)", msg_len);
 		return FALSE;
 	}
 
@@ -399,7 +400,7 @@ dcdb_sync_corosync_conf(
 	if (!atomic_write_file(HOST_CLUSTER_CONF_FN, data, len, 0644, 0))
 		goto ret;
 
-	cfs_message("wrote new corosync config '%s' (version = %zd)",
+	cfs_message("wrote new corosync config '%s' (version = %" G_GUINT64_FORMAT ")",
 		    HOST_CLUSTER_CONF_FN, new_version);
 	
 	if (notify_corosync && old_version) {
@@ -434,7 +435,7 @@ dcdb_get_state(
 
 	g_return_val_if_fail(memdb->root != NULL, FALSE);
 
-	cfs_debug("enter %s %016zX %08X", __func__, memdb->root->version, memdb->root->mtime);
+	cfs_debug("enter %s %016" PRIX64 " %08X", __func__, (uint64_t) memdb->root->version, memdb->root->mtime);
 
 	g_mutex_lock (&memdb->mutex);
 	memdb_index_t *idx = memdb_encode_index(memdb->index, memdb->root);
@@ -524,12 +525,12 @@ dcdb_create_and_send_updates(
 			if (g_hash_table_lookup(updates, &inode))
 				continue;
 			
-			cfs_debug("found different inode %d %016zX", i, inode);
+			cfs_debug("found different inode %d %016" PRIX64, i, (uint64_t) inode);
 			
 			memdb_tree_entry_t *te, *cpy;
 
 			if (!(te = g_hash_table_lookup(memdb->index, &inode))) {
-				cfs_critical("can get inode data for inode %016zX", inode);
+				cfs_critical("can get inode data for inode %016" PRIX64, (uint64_t) inode);
 				goto ret;
 			}
 			
@@ -555,9 +556,9 @@ dcdb_create_and_send_updates(
 
 		if (!dcdb_send_update_inode(dfsm, te)) {
 			/* tolerate error here */
-			cfs_critical("sending update inode failed %016zX", te->inode);
+			cfs_critical("sending update inode failed %016" PRIX64, (uint64_t) te->inode);
 		} else {
-			cfs_debug("sent update inode %016zX", te->inode);
+			cfs_debug("sent update inode %016" PRIX64, (uint64_t) te->inode);
 		}
 			
 		memdb_tree_entry_free(te);
@@ -683,8 +684,8 @@ dcdb_process_update(
 	if (!(te = dcdb_parse_update_inode(msg, msg_len)))
 		return -1;
 
-	cfs_debug("received inode update %016zX from node %d", 
-		  te->inode, nodeid);
+	cfs_debug("received inode update %016" PRIX64 " from node %d",
+		  (uint64_t) te->inode, nodeid);
 
 	dcdb_sync_info_t *localsi = (dcdb_sync_info_t *)syncinfo->data;
 
@@ -764,13 +765,13 @@ dcdb_checksum(
 
 	g_return_val_if_fail(memdb != NULL, FALSE);
 
-	cfs_debug("enter %s %016zX %08X", __func__, memdb->root->version, memdb->root->mtime);
+	cfs_debug("enter %s %016" PRIX64 " %08X", __func__, memdb->root->version, memdb->root->mtime);
 
 	g_mutex_lock (&memdb->mutex);
 	gboolean res = memdb_compute_checksum(memdb->index, memdb->root, csum, csum_len);
 	g_mutex_unlock (&memdb->mutex);
 
-	cfs_debug("leave %s %016zX (%d)", __func__, *(uint64_t *)csum, res); 
+	cfs_debug("leave %s %016" PRIX64 " (%d)", __func__, *( (uint64_t *) csum), res);
 
 	return res;
 }
@@ -802,7 +803,7 @@ dcdb_deliver(
 	if (!DCDB_VALID_MESSAGE_TYPE(msg_type)) 
 		goto unknown;
 
-	cfs_debug("process message %d (length = %ld)", msg_type, msg_len); 
+	cfs_debug("process message %u (length = %zd)", msg_type, msg_len);
 	
 	if (!cfs_is_quorate()) {
 		cfs_critical("received write while not quorate - trigger resync");
@@ -920,7 +921,7 @@ ret:
 	return res;
 
 unknown:
-	cfs_critical("received unknown message type (msg_type == %d)", msg_type);
+	cfs_critical("received unknown message type (msg_type == %u)", msg_type);
 leave:
 	res = -1;
 	goto ret;
diff --git a/data/src/dfsm.c b/data/src/dfsm.c
index fd35174..cdf473e 100644
--- a/data/src/dfsm.c
+++ b/data/src/dfsm.c
@@ -30,6 +30,7 @@
 #endif /* HAVE_CONFIG_H */
 
 #include <sys/types.h>
+#include <inttypes.h>
 #include <unistd.h>
 #include <string.h>
 #include <stdlib.h>
@@ -667,7 +668,7 @@ dfsm_cpg_deliver_callback(
 	}
 
 	if (msg_len < sizeof(dfsm_message_header_t)) {
-		cfs_dom_critical(dfsm->log_domain, "received short message (%ld bytes)", msg_len);
+		cfs_dom_critical(dfsm->log_domain, "received short message (%zd bytes)", msg_len);
 		goto leave;
 	}
 
@@ -689,13 +690,13 @@ dfsm_cpg_deliver_callback(
 		dfsm_message_normal_header_t *header = (dfsm_message_normal_header_t *)msg;
 
 		if (msg_len < sizeof(dfsm_message_normal_header_t)) {
-			cfs_dom_critical(dfsm->log_domain, "received short message (type = %d, subtype = %d, %ld bytes)",
+			cfs_dom_critical(dfsm->log_domain, "received short message (type = %d, subtype = %d, %zd bytes)",
 					 base_header->type, base_header->subtype, msg_len);
 			goto leave;
 		}
 
 		if (mode != DFSM_MODE_SYNCED) {
-			cfs_dom_debug(dfsm->log_domain, "queue message %zu (subtype = %d, length = %ld)", 
+			cfs_dom_debug(dfsm->log_domain, "queue message %" PRIu64 " (subtype = %d, length = %zd)",
 				      header->count, base_header->subtype, msg_len); 
 
 			if (!dfsm_queue_add_message(dfsm, nodeid, pid, header->count, msg, msg_len))
@@ -725,7 +726,7 @@ dfsm_cpg_deliver_callback(
 	dfsm_message_state_header_t *header = (dfsm_message_state_header_t *)msg;
 
 	if (msg_len < sizeof(dfsm_message_state_header_t)) {
-		cfs_dom_critical(dfsm->log_domain, "received short state message (type = %d, subtype = %d, %ld bytes)",
+		cfs_dom_critical(dfsm->log_domain, "received short state message (type = %d, subtype = %d, %zd bytes)",
 				 base_header->type, base_header->subtype, msg_len);
 		goto leave;
 	}
@@ -755,14 +756,14 @@ dfsm_cpg_deliver_callback(
 		} else if (base_header->type == DFSM_MESSAGE_VERIFY_REQUEST) {
 
 			if (msg_len != sizeof(dfsm->csum_counter)) {
-				cfs_dom_critical(dfsm->log_domain, "cpg received verify request with wrong length (%ld bytes) form node %d/%d", msg_len, nodeid, pid);
+				cfs_dom_critical(dfsm->log_domain, "cpg received verify request with wrong length (%zd bytes) form node %d/%d", msg_len, nodeid, pid);
 				goto leave;
 			}
 
 			uint64_t csum_id = *((uint64_t *)msg);
 			msg += 8; msg_len -= 8;
 
-			cfs_dom_debug(dfsm->log_domain, "got verify request from node %d %016zX", nodeid, csum_id);
+			cfs_dom_debug(dfsm->log_domain, "got verify request from node %d %016" PRIX64, nodeid, csum_id);
 
 			if (dfsm->dfsm_callbacks->dfsm_checksum_fn) {
 				if (!dfsm->dfsm_callbacks->dfsm_checksum_fn(
@@ -789,7 +790,7 @@ dfsm_cpg_deliver_callback(
 			if (dfsm->dfsm_callbacks->dfsm_checksum_fn) {
 
 				if (msg_len != (sizeof(dfsm->csum_id) + sizeof(dfsm->csum))) {
-					cfs_dom_critical(dfsm->log_domain, "cpg received verify message with wrong length (%ld bytes)", msg_len);
+					cfs_dom_critical(dfsm->log_domain, "cpg received verify message with wrong length (%zd bytes)", msg_len);
 					goto leave;
 				}
 
@@ -799,7 +800,7 @@ dfsm_cpg_deliver_callback(
 				if (dfsm->csum_id == csum_id &&
 				    (memcmp(&dfsm->csum_epoch, &header->epoch, sizeof(dfsm_sync_epoch_t)) == 0)) {
 					if (memcmp(msg, dfsm->csum, sizeof(dfsm->csum)) != 0) {
-						cfs_dom_critical(dfsm->log_domain, "wrong checksum %016zX != %016zX - restarting",
+						cfs_dom_critical(dfsm->log_domain, "wrong checksum %016" PRIX64 " != %016" PRIX64 " - restarting",
 								 *(uint64_t *)msg, *(uint64_t *)dfsm->csum);
 						goto leave;
 					} else {
@@ -957,7 +958,7 @@ dfsm_cpg_deliver_callback(
 		cfs_dom_debug(dfsm->log_domain, "ignore verify message %d while not synced", base_header->type);
     
 	} else {
-		cfs_dom_critical(dfsm->log_domain, "received unknown state message type (type = %d, %ld bytes)", 
+		cfs_dom_critical(dfsm->log_domain, "received unknown state message type (type = %d, %zd bytes)",
 				 base_header->type, msg_len);
 		goto leave;
 	}
@@ -1309,7 +1310,7 @@ dfsm_verify_request(dfsm_t *dfsm)
 	struct iovec iov[len];
 
 	if (dfsm->csum_counter != dfsm->csum_id) {
-		g_message("delay verify request %016zX", dfsm->csum_counter + 1);
+		g_message("delay verify request %016" PRIX64, dfsm->csum_counter + 1);
 		return CS_OK;
 	};
 
@@ -1317,7 +1318,7 @@ dfsm_verify_request(dfsm_t *dfsm)
 	iov[0].iov_base = (char *)&dfsm->csum_counter;
 	iov[0].iov_len = sizeof(dfsm->csum_counter);
 	
-	cfs_debug("send verify request %016zX", dfsm->csum_counter);
+	cfs_debug("send verify request %016" PRIX64, dfsm->csum_counter);
 
 	cs_error_t result;
 	result = dfsm_send_state_message_full(dfsm, DFSM_MESSAGE_VERIFY_REQUEST, iov, len);
diff --git a/data/src/logger.c b/data/src/logger.c
index c0c61fb..c3d682b 100644
--- a/data/src/logger.c
+++ b/data/src/logger.c
@@ -27,6 +27,7 @@
 
 #include <unistd.h>
 #include <stdio.h>
+#include <inttypes.h>
 #include <stdint.h>
 #include <glib.h>
 #include <string.h>
@@ -121,7 +122,7 @@ clog_dump_entry(clog_entry_t *cur, uint32_t cpos)
 	char tbuf[256];
 	strftime(tbuf, sizeof(tbuf), "%F %T", localtime(&lt));
 	printf("cpos %05d %08x %s", cpos, cur->uid, tbuf);
-	printf(" %s{%016zX} %s[%s{%016zX}]: %s\n", node, cur->node_digest, tag, ident, cur->ident_digest, msg);
+	printf(" %s{%016" PRIX64 "} %s[%s{%016" PRIX64 "}]: %s\n", node, cur->node_digest, tag, ident, cur->ident_digest, msg);
 	
 }
 
diff --git a/data/src/memdb.c b/data/src/memdb.c
index 560cd4b..1c95e95 100644
--- a/data/src/memdb.c
+++ b/data/src/memdb.c
@@ -23,6 +23,7 @@
 #endif /* HAVE_CONFIG_H */
 
 #include <stdio.h>
+#include <inttypes.h>
 #include <stdlib.h>
 #include <sys/types.h>
 #include <sys/stat.h>
@@ -530,7 +531,7 @@ memdb_open(const char *dbfilename)
 
 	memdb_update_locks(memdb);
 
-	cfs_debug("memdb open '%s' successful (version = %016zX)", 
+	cfs_debug("memdb open '%s' successful (version = %016" PRIX64 ")",
 		  dbfilename, memdb->root->version);
 
 	return memdb;
@@ -630,7 +631,7 @@ int memdb_mkdir(
 	g_hash_table_replace(parent->data.entries, te->name, te);
 	g_hash_table_replace(memdb->index, &te->inode, te);
 
-	cfs_debug("memdb_mkdir %s %s %016zX", dirname, base, memdb->root->version);
+	cfs_debug("memdb_mkdir %s %s %016" PRIX64, dirname, base, memdb->root->version);
 
 	if (bdb_backend_write(memdb->bdb, te->inode, te->parent, te->version, 
 			      te->writer, te->mtime, 0, DT_DIR, te->name, NULL, 0)) {
@@ -832,7 +833,7 @@ memdb_pwrite(
 
 	record_memdb_change(path);
 
-	cfs_debug("memdb_pwrite %s %s %016zX %016zX", dirname, te->name, te->inode, te->version);
+	cfs_debug("memdb_pwrite %s %s %016" PRIX64 " %016" PRIX64, dirname, te->name, te->inode, te->version);
 
 	if (bdb_backend_write(memdb->bdb, te->inode, te->parent, te->version, 
 			      te->writer, te->mtime, te->size, te->type, te->name, 
@@ -935,7 +936,7 @@ memdb_mtime(
 
 	record_memdb_change(path);
 
-	cfs_debug("memdb_mtime %s %s %016zX %016zX", dirname, te->name, te->inode, te->version);
+	cfs_debug("memdb_mtime %s %s %016" PRIX64 " %016" PRIX64, dirname, te->name, te->inode, te->version);
 
 	if (bdb_backend_write(memdb->bdb, te->inode, te->parent, te->version, 
 			      te->writer, te->mtime, te->size, te->type, te->name, 
@@ -1365,7 +1366,7 @@ tree_entry_debug(memdb_tree_entry_t *te)
 
 	// same as  tree_entry_print(), but use cfs_debug() instead of g_print()
 
-	cfs_debug("%016zX %c %016zX %016zX %08X %08X %08X %s\n", 
+	cfs_debug("%016" PRIX64 " %c %016" PRIX64 " %016" PRIX64 " %08X %08X %08X %s\n",
 		te->inode, te->type == DT_DIR ? 'D' : 'R', te->parent, te->version,
 		te->writer, te->mtime, te->size, te->name); 
 }
@@ -1375,7 +1376,7 @@ tree_entry_print(memdb_tree_entry_t *te)
 {
 	g_return_if_fail(te != NULL);
 
-	g_print("%016zX %c %016zX %016zX %08X %08X %08X %s\n", 
+	g_print("%016" PRIX64 " %c %016" PRIX64 " %016" PRIX64 " %08X %08X %08X %s\n",
 		te->inode, te->type == DT_DIR ? 'D' : 'R', te->parent, te->version,
 		te->writer, te->mtime, te->size, te->name); 
 }
@@ -1413,11 +1414,11 @@ memdb_dump_index (memdb_index_t *idx)
 {
 	g_return_if_fail(idx != NULL);
 
-	g_print ("INDEX DUMP %016zX\n", idx->version);
+	g_print ("INDEX DUMP %016" PRIX64 "\n", idx->version);
 
 	int i;
 	for (i = 0; i < idx->size; i++) {
-		g_print ("%016zX %016zX%016zX%016zX%016zX\n", idx->entries[i].inode,
+		g_print ("%016" PRIX64 " %016" PRIX64 "%016" PRIX64 "%016" PRIX64 "%016" PRIX64 "\n", idx->entries[i].inode,
 			 *((guint64 *)idx->entries[i].digest),
 			 *((guint64 *)(idx->entries[i].digest + 8)),
 			 *((guint64 *)(idx->entries[i].digest + 16)),
diff --git a/data/src/pmxcfs.c b/data/src/pmxcfs.c
index 26cbc30..e1b6fed 100644
--- a/data/src/pmxcfs.c
+++ b/data/src/pmxcfs.c
@@ -295,7 +295,7 @@ static int cfs_fuse_read(const char *path, char *buf, size_t size, off_t offset,
 {
 	(void) fi;
 
-	cfs_debug("enter cfs_fuse_read %s %lu %ld", path, size, offset);
+	cfs_debug("enter cfs_fuse_read %s %zu %jd", path, size, offset);
 
 	int ret = -EACCES;
 
@@ -320,7 +320,7 @@ static int cfs_fuse_write(const char *path, const char *buf, size_t size,
 {
 	(void) fi;
 
-	cfs_debug("enter cfs_fuse_write %s %lu %ld", path, size, offset);
+	cfs_debug("enter cfs_fuse_write %s %zu %jd", path, size, offset);
 
 	int ret = -EACCES;
 
@@ -343,7 +343,7 @@ static int cfs_fuse_write(const char *path, const char *buf, size_t size,
 
 static int cfs_fuse_truncate(const char *path, off_t size)
 {
-	cfs_debug("enter cfs_fuse_truncate %s %ld", path, size);
+	cfs_debug("enter cfs_fuse_truncate %s %jd", path, size);
 
 	int ret = -EACCES;
 
diff --git a/data/src/status.c b/data/src/status.c
index bcd9145..3896fcb 100644
--- a/data/src/status.c
+++ b/data/src/status.c
@@ -1204,7 +1204,7 @@ kvstore_parse_log_message(
 	g_return_val_if_fail(msg != NULL, NULL);
 
 	if (msg_len < sizeof(clog_entry_t)) {
-		cfs_critical("received short log message (%lu < %lu)", msg_len, sizeof(clog_entry_t));
+		cfs_critical("received short log message (%zu < %zu)", msg_len, sizeof(clog_entry_t));
 		return NULL;
 	}
 
@@ -1214,7 +1214,7 @@ kvstore_parse_log_message(
 		entry->ident_len + entry->tag_len + entry->msg_len;
 
 	if (msg_len != size) {
-		cfs_critical("received log message with wrong size (%lu != %u)", msg_len, size);
+		cfs_critical("received log message with wrong size (%zu != %u)", msg_len, size);
 		return NULL;
 	}
 
@@ -1260,7 +1260,7 @@ kvstore_parse_update_message(
 	g_return_val_if_fail(len != NULL, FALSE);
 
 	if (msg_len < 256) {
-		cfs_critical("received short kvstore message (%lu < 256)", msg_len);
+		cfs_critical("received short kvstore message (%zu < 256)", msg_len);
 		return FALSE;
 	}
 
-- 
2.1.4





More information about the pve-devel mailing list