From 792b45b142e6b901e1de20886bc3369211582b8c Mon Sep 17 00:00:00 2001 From: Riccardo Magliocchetti Date: Wed, 19 May 2010 22:53:44 +0200 Subject: vvfat: Fix compilation with DEBUG defined MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit gcc does not like passing a NULL where an int value is expected: block/vvfat.c: In function ‘checkpoint’: block/vvfat.c:2868: error: passing argument 2 of ‘remove_mapping’ makes integer from pointer without a cast Signed-off-by: Riccardo Magliocchetti Signed-off-by: Kevin Wolf --- block/vvfat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'block') diff --git a/block/vvfat.c b/block/vvfat.c index ce16bbd8c4..13c31fadd9 100644 --- a/block/vvfat.c +++ b/block/vvfat.c @@ -2865,7 +2865,7 @@ static void checkpoint(void) { return; /* avoid compiler warnings: */ hexdump(NULL, 100); - remove_mapping(vvv, NULL); + remove_mapping(vvv, 0); print_mapping(NULL); print_direntry(NULL); } -- cgit v1.2.3 From 3e89cb0419cf5ff8f97fe219c6faa58f4c0c8728 Mon Sep 17 00:00:00 2001 From: Kevin Wolf Date: Thu, 20 May 2010 10:34:50 +0200 Subject: vvfat: More build fixes with DEBUG Casting a pointer to an int doesn't work on 64 bit platforms. Use the %p printf conversion specifier instead. Signed-off-by: Kevin Wolf --- block/vvfat.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'block') diff --git a/block/vvfat.c b/block/vvfat.c index 13c31fadd9..6d61c2e6c3 100644 --- a/block/vvfat.c +++ b/block/vvfat.c @@ -1244,7 +1244,7 @@ static void print_direntry(const direntry_t* direntry) int j = 0; char buffer[1024]; - fprintf(stderr, "direntry 0x%x: ", (int)direntry); + fprintf(stderr, "direntry %p: ", direntry); if(!direntry) return; if(is_long_name(direntry)) { @@ -1273,7 +1273,11 @@ static void print_direntry(const direntry_t* direntry) static void print_mapping(const mapping_t* mapping) { - fprintf(stderr, "mapping (0x%x): begin, end = %d, %d, dir_index = %d, first_mapping_index = %d, name = %s, mode = 0x%x, " , (int)mapping, mapping->begin, mapping->end, mapping->dir_index, mapping->first_mapping_index, mapping->path, mapping->mode); + fprintf(stderr, "mapping (%p): begin, end = %d, %d, dir_index = %d, " + "first_mapping_index = %d, name = %s, mode = 0x%x, " , + mapping, mapping->begin, mapping->end, mapping->dir_index, + mapping->first_mapping_index, mapping->path, mapping->mode); + if (mapping->mode & MODE_DIRECTORY) fprintf(stderr, "parent_mapping_index = %d, first_dir_index = %d\n", mapping->info.dir.parent_mapping_index, mapping->info.dir.first_dir_index); else -- cgit v1.2.3