summaryrefslogtreecommitdiffstats
path: root/src/gallium/include/pipe
diff options
context:
space:
mode:
authorJosé Fonseca <[email protected]>2008-03-24 18:25:31 +0000
committerJosé Fonseca <[email protected]>2008-03-24 18:25:59 +0000
commit48726e129a3727ec01e130835e74d62007093051 (patch)
tree034b92fc8d47e206beee49198149dfaf2d04e3a4 /src/gallium/include/pipe
parent22a3d022542fed267d48b48a44e10226d55c8afd (diff)
gallium: Protect operator precedence in macro.
Diffstat (limited to 'src/gallium/include/pipe')
-rw-r--r--src/gallium/include/pipe/p_util.h2
1 files changed, 1 insertions, 1 deletions
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))
/**