summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2013-04-30 13:35:23 -0600
committerJosé Fonseca <[email protected]>2013-05-01 11:53:02 +0100
commit236ea7900ff263fdb3d01e1a904c43c600e2654d (patch)
tree4d79fc653fd3a5906d00242b3fe0efd39fdcd770
parent22c5e048bd43da78317a06ad3c6d8f0b787d7096 (diff)
swrast: add casts for ImageSlices pointer arithmetic
MSVC doesn't like pointer arithmetic with void * so use GLubyte *. Reviewed-by: Jose Fonseca<[email protected]>
-rw-r--r--src/mesa/swrast/s_texfetch_tmp.h6
-rw-r--r--src/mesa/swrast/s_texfilter.c2
2 files changed, 4 insertions, 4 deletions
diff --git a/src/mesa/swrast/s_texfetch_tmp.h b/src/mesa/swrast/s_texfetch_tmp.h
index c9991cd84d9..44fa8170b2c 100644
--- a/src/mesa/swrast/s_texfetch_tmp.h
+++ b/src/mesa/swrast/s_texfetch_tmp.h
@@ -51,8 +51,8 @@
#elif DIM == 2
#define TEXEL_ADDR( type, image, i, j, k, size ) \
- ((void) (k), \
- ((type *)((image)->ImageSlices[0] + (image)->RowStride * (j)) + \
+ ((void) (k), \
+ ((type *)((GLubyte *) (image)->ImageSlices[0] + (image)->RowStride * (j)) + \
(i) * (size)))
#define FETCH(x) fetch_texel_2d_##x
@@ -60,7 +60,7 @@
#elif DIM == 3
#define TEXEL_ADDR( type, image, i, j, k, size ) \
- ((type *)((image)->ImageSlices[k] + \
+ ((type *)((GLubyte *) (image)->ImageSlices[k] + \
(image)->RowStride * (j)) + (i) * (size))
#define FETCH(x) fetch_texel_3d_##x
diff --git a/src/mesa/swrast/s_texfilter.c b/src/mesa/swrast/s_texfilter.c
index c8ea26adae8..fba8e6cba80 100644
--- a/src/mesa/swrast/s_texfilter.c
+++ b/src/mesa/swrast/s_texfilter.c
@@ -1436,7 +1436,7 @@ opt_sample_rgb_2d(struct gl_context *ctx,
GLint i = IFLOOR(texcoords[k][0] * width) & colMask;
GLint j = IFLOOR(texcoords[k][1] * height) & rowMask;
GLint pos = (j << shift) | i;
- GLubyte *texel = swImg->ImageSlices[0] + 3 * pos;
+ GLubyte *texel = (GLubyte *) swImg->ImageSlices[0] + 3 * pos;
rgba[k][RCOMP] = UBYTE_TO_FLOAT(texel[2]);
rgba[k][GCOMP] = UBYTE_TO_FLOAT(texel[1]);
rgba[k][BCOMP] = UBYTE_TO_FLOAT(texel[0]);