mesa: Fix printf-like warnings.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
@@ -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;
|
||||
}
|
||||
|
||||
|
@@ -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;
|
||||
}
|
||||
|
||||
|
@@ -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;
|
||||
|
@@ -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;
|
||||
}
|
||||
|
||||
|
@@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user