From: Emil Velikov Date: Mon, 31 Jul 2017 18:45:48 +0000 (+0100) Subject: util: use cannonical form of ARRAY_SIZE X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=c9ec28b1c09be3d60520bf96dec8445d60bd75af;p=mesa.git util: use cannonical form of ARRAY_SIZE Namely sizeof(foo)/sizeof((foo)[0]) Signed-off-by: Emil Velikov Reviewed-by: Eric Engestrom --- 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() */