From: Igor Mitsyanko Date: Tue, 6 Nov 2012 15:28:02 +0000 (+0400) Subject: hw/yagl_log.c: fix printf specifier for target_ulong type X-Git-Tag: Tizen_Studio_1.3_Release_p2.3.1~1331^2~16 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9bbc2033b1788d3bcb10db732af743e45f480186;p=sdk%2Femulator%2Fqemu.git hw/yagl_log.c: fix printf specifier for target_ulong type On 64-bit hosts %lX specifies 64-bit long variable, therefore when its used with 32-bit target_ulong, it prints bogus 64 bit long value. Note that PRIX64 macro could be broken on mingw32, maybe we should manually check host word size in the future. Signed-off-by: Igor Mitsyanko --- diff --git a/hw/yagl_log.c b/hw/yagl_log.c index 7c749c6a5b..2ad0ca2b31 100644 --- a/hw/yagl_log.c +++ b/hw/yagl_log.c @@ -46,7 +46,13 @@ static struct { "GLchar", "%" PRIi8 }, { "GLintptr", "%ld" }, { "GLsizeiptr", "%ld" }, - { "target_ulong", "0x%lX" } +#if TARGET_LONG_SIZE == 4 + { "target_ulong", "0x%X" } +#elif TARGET_LONG_SIZE == 8 + { "target_ulong", "0x%" PRIX64 } +#else +#error TARGET_LONG_SIZE undefined +#endif }; static yagl_log_level g_log_level = yagl_log_level_off;