Btrfs-progs: fix compile warnings in i386 machine
authorWang Shilong <wangsl-fnst@cn.fujitsu.com>
Tue, 7 May 2013 12:24:40 +0000 (12:24 +0000)
committerChris Mason <chris.mason@fusionio.com>
Fri, 10 May 2013 14:55:22 +0000 (10:55 -0400)
See the warnings below:

   [CC]     btrfs-list.o
btrfs-list.c: In function 'filter_by_parent':
btrfs-list.c:1183:34: warning: cast to pointer from integer of different size
[-Wint-to-pointer-cast]
     [CC]     cmds-subvolume.o
cmds-subvolume.c: In function 'cmd_subvol_show':
cmds-subvolume.c:917:5: warning: cast from pointer to integer of different size
[-Wpointer-to-int-cast]
     [CC]     cmds-restore.o
cmds-restore.c: In function 'decompress_lzo':
cmds-restore.c:116:10: warning: passing argument 4 of 'lzo1x_decompress_safe'
from incompatible pointer type [enabled by default]
In file included from cmds-restore.c:31:0:
/usr/include/lzo/lzo1x.h:77:1: note: expected 'lzo_uint *' but argument is of
type 'size_t *'

Reported-by: Russell Coker <russell@coker.com.au>
Signed-off-by: Wang Shilong <wangsl-fnst@cn.fujitsu.com>
Signed-off-by: Chris Mason <chris.mason@fusionio.com>
btrfs-list.c
cmds-restore.c
cmds-subvolume.c

index 1246a2538eb943a8c38219559242d5365c2a7c35..c3d35de33cd7571311c46d578fb03fa772f80021 100644 (file)
@@ -1180,7 +1180,7 @@ static int filter_full_path(struct root_info *ri, u64 data)
 
 static int filter_by_parent(struct root_info *ri, u64 data)
 {
-       return !uuid_compare(ri->puuid, (u8 *)data);
+       return !uuid_compare(ri->puuid, (u8 *)(unsigned long)data);
 }
 
 static btrfs_list_filter_func all_filter_funcs[] = {
index fc31f0cfa2944aca84b6c6b9a16ed6ce8c229c21..dcf459ffb0f72a1861e860ffcba798152fa4b96a 100644 (file)
@@ -113,7 +113,8 @@ static int decompress_lzo(unsigned char *inbuf, char *outbuf, u64 compress_len,
 
                new_len = lzo1x_worst_compress(PAGE_CACHE_SIZE);
                ret = lzo1x_decompress_safe((const unsigned char *)inbuf, in_len,
-                                           (unsigned char *)outbuf, &new_len, NULL);
+                                           (unsigned char *)outbuf,
+                                           (void *)&new_len, NULL);
                if (ret != LZO_E_OK) {
                        fprintf(stderr, "failed to inflate: %d\n", ret);
                        return -1;
index e97297a9657868ba5563810f236020d3a938c567..ccb47627424072acad8ee516ba916fea8ef31c3c 100644 (file)
@@ -920,7 +920,7 @@ static int cmd_subvol_show(int argc, char **argv)
        printf("\tSnapshot(s):\n");
        filter_set = btrfs_list_alloc_filter_set();
        btrfs_list_setup_filter(&filter_set, BTRFS_LIST_FILTER_BY_PARENT,
-                               (u64)get_ri.uuid);
+                               (u64)(unsigned long)get_ri.uuid);
        btrfs_list_setup_print_column(BTRFS_LIST_PATH);
        btrfs_list_subvols_print(fd, filter_set, NULL, BTRFS_LIST_LAYOUT_RAW,
                        1, raw_prefix);