util: use cannonical form of ARRAY_SIZE
Namely sizeof(foo)/sizeof((foo)[0]) Signed-off-by: Emil Velikov <emil.velikov@collabora.com> Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
This commit is contained in:

committed by
Emil Velikov

parent
df83213702
commit
c9ec28b1c0
@@ -30,7 +30,7 @@
|
|||||||
|
|
||||||
/* Compute the size of an array */
|
/* Compute the size of an array */
|
||||||
#ifndef ARRAY_SIZE
|
#ifndef ARRAY_SIZE
|
||||||
# define ARRAY_SIZE(x) (sizeof(x) / sizeof(*(x)))
|
# define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* For compatibility with Clang's __has_builtin() */
|
/* For compatibility with Clang's __has_builtin() */
|
||||||
|
Reference in New Issue
Block a user