nasmlib/ilog2.c: force the shift in ROUND() to be an uint32_t

Some compilers apparently warn on 1 << w for w == 31; fix it by
explicitly making it UINT32_C(1).

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
This commit is contained in:
H. Peter Anvin 2017-04-29 13:11:55 -07:00
parent 0624296834
commit 65ce38a819

View File

@ -1,6 +1,6 @@
/* ----------------------------------------------------------------------- *
*
* Copyright 1996-2016 The NASM Authors - All Rights Reserved
* Copyright 1996-2017 The NASM Authors - All Rights Reserved
* See the file AUTHORS included with the NASM distribution for
* the specific copyright holders.
*
@ -35,12 +35,12 @@
#include "nasmlib.h"
#include <limits.h>
#define ROUND(v, a, w) \
do { \
if (v & (((1 << w) - 1) << w)) { \
a += w; \
v >>= w; \
} \
#define ROUND(v, a, w) \
do { \
if (v & (((UINT32_C(1) << w) - 1) << w)) { \
a += w; \
v >>= w; \
} \
} while (0)