summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/dri/gamma
diff options
context:
space:
mode:
authorAlan Hourihane <alanh@tungstengraphics.com>2005-01-20 13:24:08 +0000
committerAlan Hourihane <alanh@tungstengraphics.com>2005-01-20 13:24:08 +0000
commitddfa61ee194b9d4ec88d499c71cd6810e7f6a022 (patch)
tree1680e1f498b7a5b9c7d351a9105020d817eeec7d /src/mesa/drivers/dri/gamma
parentcb3bc2c49adee6533397bae73812527e50ab82f2 (diff)
Enclose passed macro values in brackets to ensure correct read/write span
values.
Diffstat (limited to 'src/mesa/drivers/dri/gamma')
-rw-r--r--src/mesa/drivers/dri/gamma/gamma_span.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/mesa/drivers/dri/gamma/gamma_span.c b/src/mesa/drivers/dri/gamma/gamma_span.c
index 2cf0d49efb..c953dfd08f 100644
--- a/src/mesa/drivers/dri/gamma/gamma_span.c
+++ b/src/mesa/drivers/dri/gamma/gamma_span.c
@@ -147,10 +147,10 @@ do { \
/* 16 bit depthbuffer functions.
*/
#define WRITE_DEPTH( _x, _y, d ) \
- *(GLushort *)(buf + _x*2 + _y*pitch) = d;
+ *(GLushort *)(buf + (_x)*2 + (_y)*pitch) = d;
#define READ_DEPTH( d, _x, _y ) \
- d = *(GLushort *)(buf + _x*2 + _y*pitch);
+ d = *(GLushort *)(buf + (_x)*2 + (_y)*pitch);
#define TAG(x) gamma##x##_16
#include "depthtmp.h"
@@ -161,10 +161,10 @@ do { \
/* 32 bit depthbuffer functions.
*/
#define WRITE_DEPTH( _x, _y, d ) \
- *(GLuint *)(buf + _x*4 + _y*pitch) = d;
+ *(GLuint *)(buf + (_x)*4 + (_y)*pitch) = d;
#define READ_DEPTH( d, _x, _y ) \
- d = *(GLuint *)(buf + _x*4 + _y*pitch);
+ d = *(GLuint *)(buf + (_x)*4 + (_y)*pitch);
#define TAG(x) gamma##x##_32
#include "depthtmp.h"
@@ -174,14 +174,14 @@ do { \
/* 24/8 bit interleaved depth/stencil functions
*/
#define WRITE_DEPTH( _x, _y, d ) { \
- GLuint tmp = *(GLuint *)(buf + _x*4 + _y*pitch); \
+ GLuint tmp = *(GLuint *)(buf + (_x)*4 + (_y)*pitch); \
tmp &= 0xff; \
tmp |= (d) & 0xffffff00; \
- *(GLuint *)(buf + _x*4 + _y*pitch) = tmp; \
+ *(GLuint *)(buf + (_x)*4 + (_y)*pitch) = tmp; \
}
#define READ_DEPTH( d, _x, _y ) \
- d = *(GLuint *)(buf + _x*4 + _y*pitch) & ~0xff;
+ d = *(GLuint *)(buf + (_x)*4 + (_y)*pitch) & ~0xff;
#define TAG(x) gamma##x##_24_8