linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] btrfs-progs: fix 32bit int/pointer cast warnings
@ 2012-11-15 22:24 Zach Brown
  0 siblings, 0 replies; only message in thread
From: Zach Brown @ 2012-11-15 22:24 UTC (permalink / raw)
  To: linux-btrfs

This uses uintptr_t to cast pointers to u64 ioctl arguments to silence
some 32bit build warnings:

cmds-inspect.c: In function ‘__ino_to_path_fd’:
cmds-inspect.c:47:15: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
cmds-inspect.c: In function ‘cmd_logical_resolve’:
cmds-inspect.c:171:15: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]

Signed-off-by: Zach Brown <zab@redhat.com>
---
 cmds-inspect.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/cmds-inspect.c b/cmds-inspect.c
index edabff5..25b83d2 100644
--- a/cmds-inspect.c
+++ b/cmds-inspect.c
@@ -17,6 +17,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
+#include <stdint.h>
 #include <sys/ioctl.h>
 #include <errno.h>
 
@@ -44,7 +45,7 @@ static int __ino_to_path_fd(u64 inum, int fd, int verbose, const char *prepend)
 
 	ipa.inum = inum;
 	ipa.size = 4096;
-	ipa.fspath = (u64)fspath;
+	ipa.fspath = (uintptr_t)fspath;
 
 	ret = ioctl(fd, BTRFS_IOC_INO_PATHS, &ipa);
 	if (ret) {
@@ -168,7 +169,7 @@ static int cmd_logical_resolve(int argc, char **argv)
 
 	loi.logical = atoll(argv[optind]);
 	loi.size = size;
-	loi.inodes = (u64)inodes;
+	loi.inodes = (uintptr_t)inodes;
 
 	fd = open_file_or_dir(argv[optind+1]);
 	if (fd < 0) {
-- 
1.7.11.4


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2012-11-15 22:24 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-11-15 22:24 [PATCH] btrfs-progs: fix 32bit int/pointer cast warnings Zach Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).