projects
/
mesa.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
df83213
)
util: use cannonical form of ARRAY_SIZE
author
Emil Velikov
<emil.velikov@collabora.com>
Mon, 31 Jul 2017 18:45:48 +0000
(19:45 +0100)
committer
Emil Velikov
<emil.l.velikov@gmail.com>
Wed, 2 Aug 2017 19:43:33 +0000
(20:43 +0100)
Namely sizeof(foo)/sizeof((foo)[0])
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
src/util/macros.h
patch
|
blob
|
history
diff --git
a/src/util/macros.h
b/src/util/macros.h
index a66f1bfed072b843bc01e94be0a13285d02edad3..a9a52a1a47821f269f2773d2312dde730ff6d483 100644
(file)
--- a/
src/util/macros.h
+++ b/
src/util/macros.h
@@
-30,7
+30,7
@@
/* Compute the size of an array */
#ifndef ARRAY_SIZE
-# define ARRAY_SIZE(x) (sizeof(x) / sizeof(
*(x)
))
+# define ARRAY_SIZE(x) (sizeof(x) / sizeof(
(x)[0]
))
#endif
/* For compatibility with Clang's __has_builtin() */