qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] block: Explicitly specify 'unsigned long long'


From: Peter Maydell
Subject: Re: [Qemu-devel] [PATCH] block: Explicitly specify 'unsigned long long' for VHDX 64-bit constants
Date: Fri, 14 Mar 2014 15:38:55 +0000

On 14 March 2014 15:36, Richard W.M. Jones <address@hidden> wrote:
> On Fri, Mar 14, 2014 at 06:50:37AM -0400, Jeff Cody wrote:
>> On 32-bit hosts, some compilers will warn on too large integer constants
>> for constants that are 64-bit in length.  Explicitly put a 'ULL' suffix
>> on those defines.
>> -#define VHDX_FILE_SIGNATURE 0x656C696678646876  /* "vhdxfile" in ASCII */
>> +#define VHDX_FILE_SIGNATURE 0x656C696678646876ULL  /* "vhdxfile" in ASCII */
>
> I think it's better to use this C99-defined feature (from <stdint.h>):
>
> #define VHDX_FILE_SIGNATURE UINT64_C(0x656C696678646876)

Why? It's longer and we barely use it anywhere else
in the codebase, whereas we use the ULL suffix all
over the place...

thanks
-- PMM



reply via email to

[Prev in Thread] Current Thread [Next in Thread]