summaryrefslogtreecommitdiff
path: root/qgroup-verify.c
diff options
context:
space:
mode:
authorWang Shilong <wangshilong1991@gmail.com>2014-07-27 00:49:55 +0800
committerDavid Sterba <dsterba@suse.cz>2014-08-22 15:07:03 +0200
commit84ebfa6d88fb9bfe10b26be03cf4982973b4fa17 (patch)
tree00d6c01eb27225cbc13df105a71f1648a7604d15 /qgroup-verify.c
parent645235106025b53f9ede6ef38971890323b97af2 (diff)
downloadbtrfs-progs-84ebfa6d88fb9bfe10b26be03cf4982973b4fa17.tar.gz
Btrfs-progs: fix some build warnings on 32bit platform
Fix following build warnings on 32bit platform: ... utils.c:1708:3: warning: left shift count >= width of type [enabled by default] if (x << i & (1UL << 63)) ^ qgroup-verify.c:393:9: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] return (struct tree_block *)unode->aux; ^ qgroup-verify.c:407:38: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] if (ulist_add(tree_blocks, bytenr, (unsigned long long)block, 0) >= 0) ^ cmds-restore.c:120:4: warning: format %lu expects argument of type long unsigned int, but argument 3 has type size_t [-Wformat=] fprintf(stderr, "bad compress length %lu\n", in_len); ... BTW, this patch also switches other castings with new helpers. Signed-off-by: Wang Shilong <wangshilong1991@gmail.com> Signed-off-by: David Sterba <dsterba@suse.cz>
Diffstat (limited to 'qgroup-verify.c')
-rw-r--r--qgroup-verify.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/qgroup-verify.c b/qgroup-verify.c
index 2e1716d..a5bd4f8 100644
--- a/qgroup-verify.c
+++ b/qgroup-verify.c
@@ -390,7 +390,7 @@ static u64 resolve_one_root(u64 bytenr)
static inline struct tree_block *unode_tree_block(struct ulist_node *unode)
{
- return (struct tree_block *)unode->aux;
+ return u64_to_ptr(unode->aux);
}
static inline u64 unode_bytenr(struct ulist_node *unode)
{
@@ -404,7 +404,7 @@ static int alloc_tree_block(u64 bytenr, u64 num_bytes, int level)
if (block) {
block->num_bytes = num_bytes;
block->level = level;
- if (ulist_add(tree_blocks, bytenr, (unsigned long long)block, 0) >= 0)
+ if (ulist_add(tree_blocks, bytenr, ptr_to_u64(block), 0) >= 0)
return 0;
free(block);
}