[Ocfs2-tools-devel] [PATCH 5/7] libocfs2: fix build warnings

Joseph Qi joseph.qi at huawei.com
Fri Mar 4 01:49:33 PST 2016


Fix the following build warnings:
1) warning: enumeration value ‘OCFS2_BLOCK_UNKNOWN’ not handled in
switch
2) warning: format ‘%016llx’ expects type ‘long long unsigned int *’,
but argument 3 has type ‘uint64_t *’

Signed-off-by: Joseph Qi <joseph.qi at huawei.com>
---
 libocfs2/blocktype.c | 2 ++
 libocfs2/lockid.c    | 5 +++--
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/libocfs2/blocktype.c b/libocfs2/blocktype.c
index 5c033d9..76484f0 100644
--- a/libocfs2/blocktype.c
+++ b/libocfs2/blocktype.c
@@ -139,6 +139,8 @@ static void ocfs2_swap_block(ocfs2_filesys *fs, void *block, int to_cpu)
 			else
 				ocfs2_swap_dx_leaf_from_cpu(block);
 			break;
+		default:
+			break;
 	}

 	return ;
diff --git a/libocfs2/lockid.c b/libocfs2/lockid.c
index 01ae2d2..d46e24e 100644
--- a/libocfs2/lockid.c
+++ b/libocfs2/lockid.c
@@ -99,11 +99,12 @@ errcode_t ocfs2_decode_lockres(char *lockres, enum ocfs2_lock_type *type,
 		return OCFS2_ET_INVALID_LOCKRES;

 	if (t != OCFS2_LOCK_TYPE_DENTRY) {
-		i = sscanf(l + 1, OCFS2_LOCK_ID_PAD"%016llx%08x", &b, &g);
+		i = sscanf(l + 1, OCFS2_LOCK_ID_PAD"%016llx%08x",
+				(unsigned long long *)&b, &g);
 		if (i != 2)
 			return OCFS2_ET_INVALID_LOCKRES;
 	} else {
-		i = sscanf(l + 1, "%016llx", &p);
+		i = sscanf(l + 1, "%016llx", (unsigned long long *)&p);
 		if (i != 1)
 			return OCFS2_ET_INVALID_LOCKRES;
 		b = strtoull(&l[OCFS2_DENTRY_LOCK_INO_START], NULL, 16);
-- 
1.8.4.3





More information about the Ocfs2-tools-devel mailing list