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:
6a6eafd
)
nasmlib.c: prefix_name(): use the elements() macro
author
H. Peter Anvin
<hpa@zytor.com>
Fri, 9 Nov 2007 03:34:01 +0000
(19:34 -0800)
committer
H. Peter Anvin
<hpa@zytor.com>
Fri, 9 Nov 2007 03:34:01 +0000
(19:34 -0800)
Use the elements() macro to count the elements in a static array.
nasmlib.c
patch
|
blob
|
history
diff --git
a/nasmlib.c
b/nasmlib.c
index
44e3a36
..
170c95f
100644
(file)
--- a/
nasmlib.c
+++ b/
nasmlib.c
@@
-776,7
+776,7
@@
static const char *prefix_names[] = {
const char *prefix_name(int token)
{
unsigned int prefix = token-PREFIX_ENUM_START;
- if (prefix >
sizeof prefix_names / sizeof(const char *
))
+ if (prefix >
elements(prefix_names
))
return NULL;
return prefix_names[prefix];