summaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2015-01-08 14:08:58 -0700
committerBrian Paul <[email protected]>2015-01-08 14:35:07 -0700
commite2bf5b183b104d7c3b7b458e655bd16cd4f2b702 (patch)
tree0d639d995bee236d6ffd954546ae40274e12a586 /src/mesa
parent8d2542fc9d5af4db355b67cc2a1ff2f413685a27 (diff)
mesa: fix MSVC compilation errors
Move assertions after declarations and don't use void pointer arithmetic. Reviewed-by: Jose Fonseca <[email protected]>
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/main/texgetimage.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/mesa/main/texgetimage.c b/src/mesa/main/texgetimage.c
index 58d9cc51407..96b019d657e 100644
--- a/src/mesa/main/texgetimage.c
+++ b/src/mesa/main/texgetimage.c
@@ -811,13 +811,12 @@ getteximage_error_check(struct gl_context *ctx,
GLenum format, GLenum type, GLsizei clientMemSize,
GLvoid *pixels, bool dsa)
{
- assert(texImage);
-
const GLint maxLevels = _mesa_max_texture_levels(ctx, target);
const GLuint dimensions = (target == GL_TEXTURE_3D) ? 3 : 2;
GLenum baseFormat;
const char *suffix = dsa ? "ture" : "";
+ assert(texImage);
assert(maxLevels != 0);
if (level < 0 || level >= maxLevels) {
_mesa_error(ctx, GL_INVALID_VALUE,
@@ -1133,7 +1132,7 @@ _mesa_GetTextureImage(GLuint texture, GLint level, GLenum format,
image_stride = _mesa_image_image_stride(&ctx->Pack, texImage->Width,
texImage->Height, format,
type);
- pixels += image_stride;
+ pixels = (GLubyte *) pixels + image_stride;
bufSize -= image_stride;
}
}
@@ -1158,11 +1157,12 @@ getcompressedteximage_error_check(struct gl_context *ctx,
GLint level, GLsizei clientMemSize,
GLvoid *img, bool dsa)
{
- assert(texImage);
const GLint maxLevels = _mesa_max_texture_levels(ctx, target);
GLuint compressedSize, dimensions;
const char *suffix = dsa ? "ture" : "";
+ assert(texImage);
+
if (!legal_getteximage_target(ctx, target, dsa)) {
_mesa_error(ctx, GL_INVALID_ENUM,
"glGetCompressedTex%sImage(target=%s)", suffix,
@@ -1343,7 +1343,7 @@ _mesa_GetCompressedTextureImage(GLuint texture, GLint level,
texImage->Width,
texImage->Height, 1);
- pixels += image_stride;
+ pixels = (GLubyte *) pixels + image_stride;
bufSize -= image_stride;
}
}