* [Qemu-devel] Fix 64 bit number formatting on Windows
@ 2007-02-13 21:44 Hervé Poussineau
2007-02-16 17:34 ` Rob Landley
0 siblings, 1 reply; 2+ messages in thread
From: Hervé Poussineau @ 2007-02-13 21:44 UTC (permalink / raw)
To: qemu-devel
[-- Attachment #1: Type: text/plain, Size: 110 bytes --]
Hi,
Correct number formatting on Windows for 64 bit numbers is "I64", while it
is "ll" on *nix.
Hervé
[-- Attachment #2: 64bit_display.diff --]
[-- Type: application/octet-stream, Size: 528 bytes --]
Index: target-mips/cpu.h
===================================================================
RCS file: /cvsroot/qemu/qemu/target-mips/cpu.h,v
retrieving revision 1.20
diff -u -r1.20 cpu.h
--- target-mips/cpu.h 24 Jan 2007 18:01:23 -0000 1.20
+++ target-mips/cpu.h 13 Feb 2007 21:24:28 -0000
@@ -19,7 +19,11 @@
/* target_ulong size spec */
#ifdef MIPS_HAS_MIPS64
-#define TLSZ "%016llx"
+# ifdef _WIN32
+# define TLSZ "%016I64x"
+# else
+# define TLSZ "%016llx"
+# endif
#else
#define TLSZ "%08x"
#endif
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [Qemu-devel] Fix 64 bit number formatting on Windows
2007-02-13 21:44 [Qemu-devel] Fix 64 bit number formatting on Windows Hervé Poussineau
@ 2007-02-16 17:34 ` Rob Landley
0 siblings, 0 replies; 2+ messages in thread
From: Rob Landley @ 2007-02-16 17:34 UTC (permalink / raw)
To: qemu-devel; +Cc: Hervé Poussineau
On Tuesday 13 February 2007 4:44 pm, Hervé Poussineau wrote:
> Hi,
>
> Correct number formatting on Windows for 64 bit numbers is "I64", while it
> is "ll" on *nix.
Might I introduce you to the c99 PRIu64 macro (and friends)?
uint64_t bytes=1234;
printf("%"PRIu64" bytes\n", bytes);
Rob
--
"Perfection is reached, not when there is no longer anything to add, but
when there is no longer anything to take away." - Antoine de Saint-Exupery
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2007-02-16 17:34 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-02-13 21:44 [Qemu-devel] Fix 64 bit number formatting on Windows Hervé Poussineau
2007-02-16 17:34 ` Rob Landley
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).