diff options
author | Emil Velikov <[email protected]> | 2017-07-31 19:45:48 +0100 |
---|---|---|
committer | Emil Velikov <[email protected]> | 2017-08-02 20:43:33 +0100 |
commit | c9ec28b1c09be3d60520bf96dec8445d60bd75af (patch) | |
tree | 514c20224e3677d09f305d9b2a344dd0409fec07 /src/util/macros.h | |
parent | df8321370204434f2a7ca7cf29be973e060781ed (diff) |
util: use cannonical form of ARRAY_SIZE
Namely sizeof(foo)/sizeof((foo)[0])
Signed-off-by: Emil Velikov <[email protected]>
Reviewed-by: Eric Engestrom <[email protected]>
Diffstat (limited to 'src/util/macros.h')
-rw-r--r-- | src/util/macros.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/util/macros.h b/src/util/macros.h index a66f1bfed07..a9a52a1a478 100644 --- 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() */ |