summaryrefslogtreecommitdiff
path: root/nasmlib/ilog2.c
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2017-04-29 13:11:55 -0700
committerH. Peter Anvin <hpa@zytor.com>2017-04-29 13:13:59 -0700
commit65ce38a8199b8df4524e0ce883678a852de1b10a (patch)
tree73065d668d4efb60796f80131a4807962ece3467 /nasmlib/ilog2.c
parent062429683494ef521ab81eb9bfec78156c25a766 (diff)
downloadnasm-65ce38a8199b8df4524e0ce883678a852de1b10a.tar.gz
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>
Diffstat (limited to 'nasmlib/ilog2.c')
-rw-r--r--nasmlib/ilog2.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/nasmlib/ilog2.c b/nasmlib/ilog2.c
index 51c3e07a..1bd24dba 100644
--- a/nasmlib/ilog2.c
+++ b/nasmlib/ilog2.c
@@ -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)