diff options
author | Brian Paul <[email protected]> | 2003-12-04 03:19:46 +0000 |
---|---|---|
committer | Brian Paul <[email protected]> | 2003-12-04 03:19:46 +0000 |
commit | b305028464f02947c0cce0476af0e35f4ed1fafa (patch) | |
tree | 6623fb86dea2eb572743c161055e37a1d43c995d /src/mesa/main | |
parent | 03e29a5f77c13b7b888bd8443cb2752850e47d6a (diff) |
Port over changes from XFree86/Mesa 5.0.2, mostly to silence compiler warnings.
Diffstat (limited to 'src/mesa/main')
-rw-r--r-- | src/mesa/main/convolve.c | 19 | ||||
-rw-r--r-- | src/mesa/main/extensions.c | 2 | ||||
-rw-r--r-- | src/mesa/main/teximage.c | 13 | ||||
-rw-r--r-- | src/mesa/main/texstore.c | 3 | ||||
-rw-r--r-- | src/mesa/main/texutil_tmp.h | 22 |
5 files changed, 20 insertions, 39 deletions
diff --git a/src/mesa/main/convolve.c b/src/mesa/main/convolve.c index b7d2eeb20f9..e6b19fabd42 100644 --- a/src/mesa/main/convolve.c +++ b/src/mesa/main/convolve.c @@ -1,9 +1,8 @@ - /* * Mesa 3-D graphics library - * Version: 4.1 + * Version: 5.1 * - * Copyright (C) 1999-2002 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2003 Brian Paul All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -178,7 +177,7 @@ void GLAPIENTRY _mesa_ConvolutionFilter2D(GLenum target, GLenum internalFormat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *image) { GLint baseFormat; - GLint i, components; + GLint i; GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); @@ -215,8 +214,8 @@ _mesa_ConvolutionFilter2D(GLenum target, GLenum internalFormat, GLsizei width, G return; } - components = _mesa_components_in_format(format); - assert(components > 0); /* this should have been caught earlier */ + /* this should have been caught earlier */ + assert(_mesa_components_in_format(format)); ctx->Convolution2D.Format = format; ctx->Convolution2D.InternalFormat = internalFormat; @@ -304,22 +303,18 @@ void GLAPIENTRY _mesa_ConvolutionParameterfv(GLenum target, GLenum pname, const GLfloat *params) { GET_CURRENT_CONTEXT(ctx); - struct gl_convolution_attrib *conv; GLuint c; ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); switch (target) { case GL_CONVOLUTION_1D: c = 0; - conv = &ctx->Convolution1D; break; case GL_CONVOLUTION_2D: c = 1; - conv = &ctx->Convolution2D; break; case GL_SEPARABLE_2D: c = 2; - conv = &ctx->Separable2D; break; default: _mesa_error(ctx, GL_INVALID_ENUM, "glConvolutionParameterfv(target)"); @@ -403,22 +398,18 @@ void GLAPIENTRY _mesa_ConvolutionParameteriv(GLenum target, GLenum pname, const GLint *params) { GET_CURRENT_CONTEXT(ctx); - struct gl_convolution_attrib *conv; GLuint c; ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); switch (target) { case GL_CONVOLUTION_1D: c = 0; - conv = &ctx->Convolution1D; break; case GL_CONVOLUTION_2D: c = 1; - conv = &ctx->Convolution2D; break; case GL_SEPARABLE_2D: c = 2; - conv = &ctx->Separable2D; break; default: _mesa_error(ctx, GL_INVALID_ENUM, "glConvolutionParameteriv(target)"); diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c index fa7a33e0c0d..0b512c57939 100644 --- a/src/mesa/main/extensions.c +++ b/src/mesa/main/extensions.c @@ -31,7 +31,7 @@ #include "mtypes.h" -#define F(x) (int)&(((struct gl_extensions *)0)->x) +#define F(x) (int)(unsigned long)&(((struct gl_extensions *)0)->x) #define ON GL_TRUE #define OFF GL_FALSE diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c index ec08168fc02..e4579bdb6f8 100644 --- a/src/mesa/main/teximage.c +++ b/src/mesa/main/teximage.c @@ -2481,7 +2481,6 @@ _mesa_CopyTexSubImage1D( GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width ) { struct gl_texture_unit *texUnit; - struct gl_texture_object *texObj; struct gl_texture_image *texImage; GLsizei postConvWidth = width; GET_CURRENT_CONTEXT(ctx); @@ -2498,7 +2497,6 @@ _mesa_CopyTexSubImage1D( GLenum target, GLint level, return; texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; - texObj = _mesa_select_tex_object(ctx, texUnit, target); texImage = _mesa_select_tex_image(ctx, texUnit, target, level); ASSERT(texImage); @@ -2518,7 +2516,6 @@ _mesa_CopyTexSubImage2D( GLenum target, GLint level, GLint x, GLint y, GLsizei width, GLsizei height ) { struct gl_texture_unit *texUnit; - struct gl_texture_object *texObj; struct gl_texture_image *texImage; GLsizei postConvWidth = width, postConvHeight = height; GET_CURRENT_CONTEXT(ctx); @@ -2535,7 +2532,6 @@ _mesa_CopyTexSubImage2D( GLenum target, GLint level, return; texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; - texObj = _mesa_select_tex_object(ctx, texUnit, target); texImage = _mesa_select_tex_image(ctx, texUnit, target, level); ASSERT(texImage); @@ -2557,7 +2553,6 @@ _mesa_CopyTexSubImage3D( GLenum target, GLint level, GLint x, GLint y, GLsizei width, GLsizei height ) { struct gl_texture_unit *texUnit; - struct gl_texture_object *texObj; struct gl_texture_image *texImage; GLsizei postConvWidth = width, postConvHeight = height; GET_CURRENT_CONTEXT(ctx); @@ -2574,7 +2569,6 @@ _mesa_CopyTexSubImage3D( GLenum target, GLint level, return; texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; - texObj = _mesa_select_tex_object(ctx, texUnit, target); texImage = _mesa_select_tex_image(ctx, texUnit, target, level); ASSERT(texImage); @@ -2609,7 +2603,6 @@ compressed_texture_error_check(GLcontext *ctx, GLint dimensions, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize) { - GLboolean isProxy = GL_FALSE; GLint expectedSize, maxLevels = 0, maxTextureSize; if (dimensions == 1) { @@ -2619,7 +2612,6 @@ compressed_texture_error_check(GLcontext *ctx, GLint dimensions, else if (dimensions == 2) { if (target == GL_PROXY_TEXTURE_2D) { maxLevels = ctx->Const.MaxTextureLevels; - isProxy = GL_TRUE; } else if (target == GL_TEXTURE_2D) { maxLevels = ctx->Const.MaxTextureLevels; @@ -2628,7 +2620,6 @@ compressed_texture_error_check(GLcontext *ctx, GLint dimensions, if (!ctx->Extensions.ARB_texture_cube_map) return GL_INVALID_ENUM; /*target*/ maxLevels = ctx->Const.MaxCubeTextureLevels; - isProxy = GL_TRUE; } else if (target >= GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB && target <= GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB) { @@ -2698,7 +2689,6 @@ compressed_subtexture_error_check(GLcontext *ctx, GLint dimensions, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize) { - GLboolean isProxy = GL_FALSE; GLint expectedSize, maxLevels = 0, maxTextureSize; if (dimensions == 1) { @@ -2708,7 +2698,6 @@ compressed_subtexture_error_check(GLcontext *ctx, GLint dimensions, else if (dimensions == 2) { if (target == GL_PROXY_TEXTURE_2D) { maxLevels = ctx->Const.MaxTextureLevels; - isProxy = GL_TRUE; } else if (target == GL_TEXTURE_2D) { maxLevels = ctx->Const.MaxTextureLevels; @@ -2717,7 +2706,6 @@ compressed_subtexture_error_check(GLcontext *ctx, GLint dimensions, if (!ctx->Extensions.ARB_texture_cube_map) return GL_INVALID_ENUM; /*target*/ maxLevels = ctx->Const.MaxCubeTextureLevels; - isProxy = GL_TRUE; } else if (target >= GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB && target <= GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB) { @@ -3075,6 +3063,7 @@ _mesa_CompressedTexSubImage2DARB(GLenum target, GLint level, GLint xoffset, error = compressed_subtexture_error_check(ctx, 2, target, level, xoffset, yoffset, 0, width, height, 1, format, imageSize); if (error) { + /* XXX proxy target? */ _mesa_error(ctx, error, "glCompressedTexSubImage2D"); return; } diff --git a/src/mesa/main/texstore.c b/src/mesa/main/texstore.c index 36d5c25ce4b..899201e6c4a 100644 --- a/src/mesa/main/texstore.c +++ b/src/mesa/main/texstore.c @@ -627,6 +627,7 @@ _mesa_transfer_teximage(GLcontext *ctx, GLuint dimensions, srcPacking, srcAddr, dstAddr); assert(b); + (void) b; } else if (dimensions == 2) { GLboolean b; @@ -638,6 +639,7 @@ _mesa_transfer_teximage(GLcontext *ctx, GLuint dimensions, srcPacking, srcAddr, dstAddr); assert(b); + (void) b; } else { GLboolean b; @@ -648,6 +650,7 @@ _mesa_transfer_teximage(GLcontext *ctx, GLuint dimensions, srcFormat, srcType, srcPacking, srcAddr, dstAddr); assert(b); + (void) b; } } else { diff --git a/src/mesa/main/texutil_tmp.h b/src/mesa/main/texutil_tmp.h index 7b2ccaa1c90..0be341c87c3 100644 --- a/src/mesa/main/texutil_tmp.h +++ b/src/mesa/main/texutil_tmp.h @@ -385,18 +385,16 @@ TAG(texsubimage2d_stride_unpack)( const struct convert_info *convert ) DST_TYPE *dst = (DST_TYPE *)((GLubyte *)convert->dstImage + (convert->yoffset * convert->dstImageWidth + convert->xoffset) * DST_TEXEL_BYTES); - GLint adjust; - GLint row, col = 0; - (void) col; - - adjust = convert->dstImageWidth - convert->width; + GLint row; +#ifndef CONVERT_DIRECT + GLint adjust = convert->dstImageWidth - convert->width; +#endif #if DEBUG_TEXUTIL _mesa_debug( NULL, __FUNCTION__ ":\n" ); _mesa_debug( NULL, " x=%d y=%d w=%d h=%d s=%d\n", convert->xoffset, convert->yoffset, convert->width, convert->height, convert->dstImageWidth ); - _mesa_debug( NULL, " adjust=%d\n", adjust ); #endif for ( row = 0 ; row < convert->height ; row++ ) { @@ -406,6 +404,7 @@ TAG(texsubimage2d_stride_unpack)( const struct convert_info *convert ) dst += convert->dstImageWidth; #else const GLubyte *srcRow = src; + GLint col; for ( col = 0 ; col < convert->width ; col++ ) { CONVERT_TEXEL( *dst++, src ); src += SRC_TEXEL_BYTES; @@ -437,18 +436,16 @@ TAG(texsubimage3d_stride_unpack)( const struct convert_info *convert ) ((convert->zoffset * convert->dstImageHeight + convert->yoffset) * convert->dstImageWidth + convert->xoffset) * DST_TEXEL_BYTES); - GLint adjust; - GLint row, col = 0, img; - (void) col; - - adjust = convert->dstImageWidth - convert->width; + GLint row, img; +#ifndef CONVERT_DIRECT + GLint adjust = convert->dstImageWidth - convert->width; +#endif #if DEBUG_TEXUTIL _mesa_debug( NULL, __FUNCTION__ ":\n" ); _mesa_debug( NULL, " x=%d y=%d w=%d h=%d s=%d\n", convert->xoffset, convert->yoffset, convert->width, convert->height, convert->dstImageWidth ); - _mesa_debug( NULL, " adjust=%d\n", adjust ); #endif for ( img = 0 ; img < convert->depth ; img++ ) { @@ -460,6 +457,7 @@ TAG(texsubimage3d_stride_unpack)( const struct convert_info *convert ) dst += convert->dstImageWidth; #else const GLubyte *srcRow = src; + GLint col; for ( col = 0 ; col < convert->width ; col++ ) { CONVERT_TEXEL( *dst++, src ); src += SRC_TEXEL_BYTES; |