From: José Fonseca Date: Mon, 24 Mar 2008 18:25:31 +0000 (+0000) Subject: gallium: Protect operator precedence in macro. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=48726e129a3727ec01e130835e74d62007093051;p=mesa.git gallium: Protect operator precedence in macro. --- diff --git a/src/gallium/include/pipe/p_util.h b/src/gallium/include/pipe/p_util.h index d3b2fa29507..283f7fb8f5d 100644 --- a/src/gallium/include/pipe/p_util.h +++ b/src/gallium/include/pipe/p_util.h @@ -201,7 +201,7 @@ mem_dup(const void *src, uint size) #define MIN2( A, B ) ( (A)<(B) ? (A) : (B) ) #define MAX2( A, B ) ( (A)>(B) ? (A) : (B) ) -#define Elements(x) sizeof(x)/sizeof(*(x)) +#define Elements(x) (sizeof(x)/sizeof((x)[0])) #define Offset(TYPE, MEMBER) ((unsigned)&(((TYPE *)NULL)->MEMBER)) /**