summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/dri/sis
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/sis
parentcb3bc2c49adee6533397bae73812527e50ab82f2 (diff)
Enclose passed macro values in brackets to ensure correct read/write span
values.
Diffstat (limited to 'src/mesa/drivers/dri/sis')
-rw-r--r--src/mesa/drivers/dri/sis/sis_span.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/mesa/drivers/dri/sis/sis_span.c b/src/mesa/drivers/dri/sis/sis_span.c
index 47790a5f85..8f4b3af62e 100644
--- a/src/mesa/drivers/dri/sis/sis_span.c
+++ b/src/mesa/drivers/dri/sis/sis_span.c
@@ -143,10 +143,10 @@ do { \
/* 16 bit depthbuffer functions.
*/
#define WRITE_DEPTH( _x, _y, d ) \
- *(GLushort *)(buf + _x*2 + _y*smesa->depthPitch) = d;
+ *(GLushort *)(buf + (_x)*2 + (_y)*smesa->depthPitch) = d;
#define READ_DEPTH( d, _x, _y ) \
- d = *(GLushort *)(buf + _x*2 + _y*smesa->depthPitch);
+ d = *(GLushort *)(buf + (_x)*2 + (_y)*smesa->depthPitch);
#define TAG(x) sis##x##_16
#include "depthtmp.h"
@@ -155,10 +155,10 @@ do { \
/* 32 bit depthbuffer functions.
*/
#define WRITE_DEPTH( _x, _y, d ) \
- *(GLuint *)(buf + _x*4 + _y*smesa->depthPitch) = d;
+ *(GLuint *)(buf + (_x)*4 + (_y)*smesa->depthPitch) = d;
#define READ_DEPTH( d, _x, _y ) \
- d = *(GLuint *)(buf + _x*4 + _y*smesa->depthPitch);
+ d = *(GLuint *)(buf + (_x)*4 + (_y)*smesa->depthPitch);
#define TAG(x) sis##x##_32
#include "depthtmp.h"
@@ -167,28 +167,28 @@ do { \
/* 8/24 bit interleaved depth/stencil functions
*/
#define WRITE_DEPTH( _x, _y, d ) { \
- GLuint tmp = *(GLuint *)(buf + _x*4 + _y*smesa->depthPitch); \
+ GLuint tmp = *(GLuint *)(buf + (_x)*4 + (_y)*smesa->depthPitch); \
tmp &= 0xff000000; \
tmp |= (d & 0x00ffffff); \
- *(GLuint *)(buf + _x*4 + _y*smesa->depthPitch) = tmp; \
+ *(GLuint *)(buf + (_x)*4 + (_y)*smesa->depthPitch) = tmp; \
}
#define READ_DEPTH( d, _x, _y ) { \
- d = *(GLuint *)(buf + _x*4 + _y*smesa->depthPitch) & 0x00ffffff; \
+ d = *(GLuint *)(buf + (_x)*4 + (_y)*smesa->depthPitch) & 0x00ffffff; \
}
#define TAG(x) sis##x##_24_8
#include "depthtmp.h"
#define WRITE_STENCIL( _x, _y, d ) { \
- GLuint tmp = *(GLuint *)(buf + _x*4 + _y*smesa->depthPitch); \
+ GLuint tmp = *(GLuint *)(buf + (_x)*4 + (_y)*smesa->depthPitch); \
tmp &= 0x00ffffff; \
tmp |= (d << 24); \
- *(GLuint *)(buf + _x*4 + _y*smesa->depthPitch) = tmp; \
+ *(GLuint *)(buf + (_x)*4 + (_y)*smesa->depthPitch) = tmp; \
}
#define READ_STENCIL( d, _x, _y ) \
- d = (*(GLuint *)(buf + _x*4 + _y*smesa->depthPitch) & 0xff000000) >> 24;
+ d = (*(GLuint *)(buf + (_x)*4 + (_y)*smesa->depthPitch) & 0xff000000) >> 24;
#define TAG(x) sis##x##_24_8
#include "stenciltmp.h"