mirror of
https://github.com/netwide-assembler/nasm.git
synced 2025-03-25 18:10:23 +08:00
eval: Use is_power2 helper instead of open code
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
This commit is contained in:
parent
1930007f3f
commit
71ba1f0e7b
4
eval.c
4
eval.c
@ -742,8 +742,8 @@ static int64_t eval_ifunc(int64_t val, enum ifunc func)
|
||||
case IFUNC_ILOG2E:
|
||||
case IFUNC_ILOG2W:
|
||||
errtype = (func == IFUNC_ILOG2E) ? ERR_NONFATAL : ERR_WARNING;
|
||||
|
||||
if ((!uval) | (uval & (uval-1)))
|
||||
|
||||
if (!is_power2(uval))
|
||||
error(errtype, "ilog2 argument is not a power of two");
|
||||
/* fall through */
|
||||
case IFUNC_ILOG2F:
|
||||
|
Loading…
x
Reference in New Issue
Block a user