projects
/
platform
/
upstream
/
nasm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1930007
)
eval: Use is_power2 helper instead of open code
author
Cyrill Gorcunov
<gorcunov@gmail.com>
Sun, 17 Feb 2013 21:38:11 +0000
(
01:38
+0400)
committer
Cyrill Gorcunov
<gorcunov@gmail.com>
Sun, 17 Feb 2013 21:38:11 +0000
(
01:38
+0400)
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
eval.c
patch
|
blob
|
history
diff --git
a/eval.c
b/eval.c
index
d7cf844
..
0035088
100644
(file)
--- a/
eval.c
+++ b/
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: