From 5e7099598901e038e477dc84df355b2a770ef498 Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Wed, 13 May 2026 11:12:33 +0500 Subject: [PATCH] ref: gl: more maybe unused stuff --- ref/gl/gl_image.c | 4 ++-- ref/gl/gl_opengl.c | 24 +++++++++++------------- 2 files changed, 13 insertions(+), 15 deletions(-) diff --git a/ref/gl/gl_image.c b/ref/gl/gl_image.c index 68d0df88..7da56351 100644 --- a/ref/gl/gl_image.c +++ b/ref/gl/gl_image.c @@ -922,8 +922,8 @@ static void GL_TextureImageRAW( gl_texture_t *tex, GLint side, GLint level, GLin static void GL_TextureImageCompressed( gl_texture_t *tex, GLint side, GLint level, GLint width, GLint height, GLint depth, size_t size, const void *data ) { - GLuint cubeTarget = GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB; - qboolean subImage = FBitSet( tex->flags, TF_IMG_UPLOADED ); + GLuint cubeTarget MAYBE_UNUSED = GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB; + qboolean subImage MAYBE_UNUSED = FBitSet( tex->flags, TF_IMG_UPLOADED ); Assert( tex != NULL ); diff --git a/ref/gl/gl_opengl.c b/ref/gl/gl_opengl.c index 6583c16e..d9936274 100644 --- a/ref/gl/gl_opengl.c +++ b/ref/gl/gl_opengl.c @@ -200,14 +200,14 @@ static const dllfunc_t multitexturefuncs[] = { GL_CALL( glClientActiveTextureARB ) }, }; -static const dllfunc_t texture3dextfuncs[] = +static const dllfunc_t texture3dextfuncs[] MAYBE_UNUSED = { { GL_CALL( glTexImage3D ) }, { GL_CALL( glTexSubImage3D ) }, { GL_CALL( glCopyTexSubImage3D ) }, }; -static const dllfunc_t texturecompressionfuncs[] = +static const dllfunc_t texturecompressionfuncs[] MAYBE_UNUSED = { { GL_CALL( glCompressedTexImage3DARB ) }, { GL_CALL( glCompressedTexImage2DARB ) }, @@ -232,17 +232,17 @@ static const dllfunc_t vbofuncs[] = { GL_CALL( glBufferSubDataARB ) }, }; -static const dllfunc_t multisampletexfuncs[] = +static const dllfunc_t multisampletexfuncs[] MAYBE_UNUSED = { { GL_CALL(glTexImage2DMultisample) }, }; -static const dllfunc_t drawrangeelementsfuncs[] = +static const dllfunc_t drawrangeelementsfuncs[] MAYBE_UNUSED = { { GL_CALL( glDrawRangeElements ) }, }; -static const dllfunc_t drawrangeelementsextfuncs[] = +static const dllfunc_t drawrangeelementsextfuncs[] MAYBE_UNUSED = { { GL_CALL( glDrawRangeElementsEXT ) }, }; @@ -271,7 +271,7 @@ static const dllfunc_t bufferstoragefuncs[] = { GL_CALL( glBufferStorage ) }, }; -static const dllfunc_t shaderobjectsfuncs[] = +static const dllfunc_t shaderobjectsfuncs[] MAYBE_UNUSED = { { GL_CALL( glDeleteObjectARB ) }, { GL_CALL( glGetHandleARB ) }, @@ -472,18 +472,16 @@ GL_CheckExtension */ static qboolean GL_CheckExtension( const char *name, const dllfunc_t *funcs, size_t num_funcs, const char *cvarname, int r_ext, float minver ) { - size_t i; - cvar_t *parm = NULL; - const char *extensions_string; - char desc[MAX_VA_STRING]; - float glver = (float)glConfig.version_major + glConfig.version_minor / 10.0f; + const float glver = (float)glConfig.version_major + glConfig.version_minor / 10.0f; gEngfuncs.Con_Reportf( "%s: %s ", __func__, name ); GL_SetExtension( r_ext, true ); + cvar_t *parm = NULL; if( cvarname ) { // system config disable extensions + char desc[MAX_VA_STRING]; Q_snprintf( desc, sizeof( desc ), CVAR_GLCONFIG_DESCRIPTION, name ); parm = gEngfuncs.Cvar_Get( cvarname, "1", FCVAR_GLCONFIG|FCVAR_READ_ONLY, desc ); } @@ -495,7 +493,7 @@ static qboolean GL_CheckExtension( const char *name, const dllfunc_t *funcs, siz return false; // nothing to process at } - extensions_string = glConfig.extensions_string; + const char *extensions_string = glConfig.extensions_string; if(( name[2] == '_' || name[3] == '_' ) && !Q_strstr( extensions_string, name ) && ( glver < minver || !minver || !glver ) ) { @@ -508,7 +506,7 @@ static qboolean GL_CheckExtension( const char *name, const dllfunc_t *funcs, siz // clear exports ClearExports( funcs, num_funcs ); - for( i = 0; i < num_funcs; i++ ) + for( size_t i = 0; i < num_funcs; i++ ) { // functions are cleared before all the extensions are evaluated if(( *(funcs[i].func) = (void *)gEngfuncs.GL_GetProcAddress( funcs[i].name )) == NULL )