On 12/09/2016 03:28 AM, Greg Kurz wrote: > The u16 and u32 types don't exist in QEMU common headers. It never broke > build because these two macros aren't use by the current code, but this > is about to change with the future addition of functional tests for 9P. > > This patch convert the types to uintXX_t. > > Signed-off-by: Greg Kurz <gr...@kaod.org> > --- > hw/9pfs/9p.h | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/hw/9pfs/9p.h b/hw/9pfs/9p.h > index 3976b7fe3dcd..89c904bdb7e7 100644 > --- a/hw/9pfs/9p.h > +++ b/hw/9pfs/9p.h > @@ -99,8 +99,8 @@ enum p9_proto_version { > V9FS_PROTO_2000L = 0x02, > }; > > -#define P9_NOTAG (u16)(~0) > -#define P9_NOFID (u32)(~0) > +#define P9_NOTAG (uint16_t)(~0) > +#define P9_NOFID (uint32_t)(~0)
Don't you want to write ((uint16_t)(~0)), to ensure that this expression can be used as a drop-in in any other syntactical situation? Or even write it as UINT16_C(~0) (using <stdint.h>), or as UINT16_MAX. (Be aware: the type of (uint16_t)(~0) is uint16_t, while the type of UINT16_MAX is int, due to the rules of integer promotion, if that matters) -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature