From: Vinson Lee Date: Thu, 2 Sep 2010 23:03:32 +0000 (-0700) Subject: mesa: Fix printf-like warnings. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=c5dde53f4e42612518cd927bb58f08c0e22db17a;p=mesa.git mesa: Fix printf-like warnings. --- diff --git a/src/mesa/main/dlist.c b/src/mesa/main/dlist.c index 5042e14a540..6928d21a21e 100644 --- a/src/mesa/main/dlist.c +++ b/src/mesa/main/dlist.c @@ -6818,7 +6818,7 @@ _mesa_compile_error(GLcontext *ctx, GLenum error, const char *s) if (ctx->CompileFlag) save_error(ctx, error, s); if (ctx->ExecuteFlag) - _mesa_error(ctx, error, s); + _mesa_error(ctx, error, "%s", s); } @@ -6885,7 +6885,7 @@ execute_list(GLcontext *ctx, GLuint list) else { switch (opcode) { case OPCODE_ERROR: - _mesa_error(ctx, n[1].e, (const char *) n[2].data); + _mesa_error(ctx, n[1].e, "%s", (const char *) n[2].data); break; case OPCODE_ACCUM: CALL_Accum(ctx->Exec, (n[1].e, n[2].f)); @@ -7917,7 +7917,7 @@ execute_list(GLcontext *ctx, GLuint list) char msg[1000]; _mesa_snprintf(msg, sizeof(msg), "Error in execute_list: opcode=%d", (int) opcode); - _mesa_problem(ctx, msg); + _mesa_problem(ctx, "%s", msg); } done = GL_TRUE; } diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c index f80dd859936..defdebbdefa 100644 --- a/src/mesa/main/fbobject.c +++ b/src/mesa/main/fbobject.c @@ -1022,7 +1022,7 @@ renderbuffer_storage(GLenum target, GLenum internalFormat, rb = ctx->CurrentRenderbuffer; if (!rb) { - _mesa_error(ctx, GL_INVALID_OPERATION, func); + _mesa_error(ctx, GL_INVALID_OPERATION, "%s", func); return; } diff --git a/src/mesa/main/light.c b/src/mesa/main/light.c index 5b87b8c8acb..43ae28c25ab 100644 --- a/src/mesa/main/light.c +++ b/src/mesa/main/light.c @@ -599,7 +599,7 @@ _mesa_material_bitmask( GLcontext *ctx, GLenum face, GLenum pname, bitmask |= MAT_BIT_FRONT_INDEXES | MAT_BIT_BACK_INDEXES; break; default: - _mesa_error( ctx, GL_INVALID_ENUM, where ); + _mesa_error( ctx, GL_INVALID_ENUM, "%s", where ); return 0; } @@ -610,12 +610,12 @@ _mesa_material_bitmask( GLcontext *ctx, GLenum face, GLenum pname, bitmask &= BACK_MATERIAL_BITS; } else if (face != GL_FRONT_AND_BACK) { - _mesa_error( ctx, GL_INVALID_ENUM, where ); + _mesa_error( ctx, GL_INVALID_ENUM, "%s", where ); return 0; } if (bitmask & ~legal) { - _mesa_error( ctx, GL_INVALID_ENUM, where ); + _mesa_error( ctx, GL_INVALID_ENUM, "%s", where ); return 0; } diff --git a/src/mesa/main/shaderobj.c b/src/mesa/main/shaderobj.c index 59198d788bd..2de8f279818 100644 --- a/src/mesa/main/shaderobj.c +++ b/src/mesa/main/shaderobj.c @@ -156,18 +156,18 @@ struct gl_shader * _mesa_lookup_shader_err(GLcontext *ctx, GLuint name, const char *caller) { if (!name) { - _mesa_error(ctx, GL_INVALID_VALUE, caller); + _mesa_error(ctx, GL_INVALID_VALUE, "%s", caller); return NULL; } else { struct gl_shader *sh = (struct gl_shader *) _mesa_HashLookup(ctx->Shared->ShaderObjects, name); if (!sh) { - _mesa_error(ctx, GL_INVALID_VALUE, caller); + _mesa_error(ctx, GL_INVALID_VALUE, "%s", caller); return NULL; } if (sh->Type == GL_SHADER_PROGRAM_MESA) { - _mesa_error(ctx, GL_INVALID_OPERATION, caller); + _mesa_error(ctx, GL_INVALID_OPERATION, "%s", caller); return NULL; } return sh; @@ -377,18 +377,18 @@ _mesa_lookup_shader_program_err(GLcontext *ctx, GLuint name, const char *caller) { if (!name) { - _mesa_error(ctx, GL_INVALID_VALUE, caller); + _mesa_error(ctx, GL_INVALID_VALUE, "%s", caller); return NULL; } else { struct gl_shader_program *shProg = (struct gl_shader_program *) _mesa_HashLookup(ctx->Shared->ShaderObjects, name); if (!shProg) { - _mesa_error(ctx, GL_INVALID_VALUE, caller); + _mesa_error(ctx, GL_INVALID_VALUE, "%s", caller); return NULL; } if (shProg->Type != GL_SHADER_PROGRAM_MESA) { - _mesa_error(ctx, GL_INVALID_OPERATION, caller); + _mesa_error(ctx, GL_INVALID_OPERATION, "%s", caller); return NULL; } return shProg; diff --git a/src/mesa/main/texenvprogram.c b/src/mesa/main/texenvprogram.c index 9fa8f02a8b0..20f02cefe94 100644 --- a/src/mesa/main/texenvprogram.c +++ b/src/mesa/main/texenvprogram.c @@ -907,7 +907,7 @@ static struct ureg get_zero( struct texenv_fragment_program *p ) static void program_error( struct texenv_fragment_program *p, const char *msg ) { - _mesa_problem(NULL, msg); + _mesa_problem(NULL, "%s", msg); p->error = 1; } diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c index 9b7a0215619..ca1bd6096e2 100644 --- a/src/mesa/main/teximage.c +++ b/src/mesa/main/teximage.c @@ -1405,7 +1405,7 @@ texture_error_check( GLcontext *ctx, GLenum target, char message[100]; _mesa_snprintf(message, sizeof(message), "glTexImage%dD(format/type YCBCR mismatch", dimensions); - _mesa_error(ctx, GL_INVALID_ENUM, message); + _mesa_error(ctx, GL_INVALID_ENUM, "%s", message); return GL_TRUE; /* error */ } if (target != GL_TEXTURE_2D && @@ -1422,7 +1422,7 @@ texture_error_check( GLcontext *ctx, GLenum target, _mesa_snprintf(message, sizeof(message), "glTexImage%dD(format=GL_YCBCR_MESA and border=%d)", dimensions, border); - _mesa_error(ctx, GL_INVALID_VALUE, message); + _mesa_error(ctx, GL_INVALID_VALUE, "%s", message); } return GL_TRUE; }