diff options
author | H. Peter Anvin <hpa@zytor.com> | 2017-04-29 13:11:55 -0700 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2017-04-29 13:13:59 -0700 |
commit | 65ce38a8199b8df4524e0ce883678a852de1b10a (patch) | |
tree | 73065d668d4efb60796f80131a4807962ece3467 | |
parent | 062429683494ef521ab81eb9bfec78156c25a766 (diff) | |
download | nasm-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>
-rw-r--r-- | nasmlib/ilog2.c | 14 |
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) |