* [Qemu-devel] [PATCH] fix for treating "long" as "int64_t" in block-vmdk.c
@ 2008-09-14 13:47 Zeev Tarantov
0 siblings, 0 replies; only message in thread
From: Zeev Tarantov @ 2008-09-14 13:47 UTC (permalink / raw)
To: qemu-devel
On 32bit x86 I get these warnings:
block-vmdk.c: In function 'vmdk_create':
block-vmdk.c:796: warning: format '%lu' expects type 'long unsigned
int', but argument 8 has type 'int64_t'
block-vmdk.c:796: warning: format '%lu' expects type 'long unsigned
int', but argument 8 has type 'int64_t'
It seems the code was developed on a 64bit machine because the author
treats "long in" as "int64_t".
This patch fixes the warnings and the downcast.
There are no more uses of "long"in the code.
Please consider committing this, as well as my previous patch.
--- block-vmdk.c (revision 5208)
+++ block-vmdk.c (working copy)
@@ -710,13 +710,13 @@
"createType=\"monolithicSparse\"\n"
"\n"
"# Extent description\n"
- "RW %lu SPARSE \"%s\"\n"
+ "RW %llu SPARSE \"%s\"\n"
"\n"
"# The Disk Data Base \n"
"#DDB\n"
"\n"
"ddb.virtualHWVersion = \"%d\"\n"
- "ddb.geometry.cylinders = \"%lu\"\n"
+ "ddb.geometry.cylinders = \"%llu\"\n"
"ddb.geometry.heads = \"16\"\n"
"ddb.geometry.sectors = \"63\"\n"
"ddb.adapterType = \"ide\"\n";
@@ -792,7 +792,7 @@
if ((temp_str = strrchr(real_filename, ':')) != NULL)
real_filename = temp_str + 1;
snprintf(desc, sizeof(desc), desc_template, (unsigned int)time(NULL),
- (unsigned long)total_size, real_filename,
+ (uint64_t)total_size, real_filename,
(flags & BLOCK_FLAG_COMPAT6 ? 6 : 4), total_size / (63 * 16));
/* write the descriptor */
-Zeev
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2008-09-14 13:47 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-09-14 13:47 [Qemu-devel] [PATCH] fix for treating "long" as "int64_t" in block-vmdk.c Zeev Tarantov
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).