mirror of
https://github.com/netwide-assembler/nasm.git
synced 2025-01-30 16:41:05 +08:00
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:
parent
0624296834
commit
65ce38a819
@ -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)
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user