From: Brian Paul Date: Fri, 21 Nov 2003 16:38:56 +0000 (+0000) Subject: fix a bunch of warnings X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=ba254c08c0fa896ac425961c7900b99775979e16;p=mesa.git fix a bunch of warnings --- diff --git a/src/mesa/main/arbfragparse.c b/src/mesa/main/arbfragparse.c index eb7d0c24a66..ca4b68d8e24 100644 --- a/src/mesa/main/arbfragparse.c +++ b/src/mesa/main/arbfragparse.c @@ -147,6 +147,9 @@ debug_fp_inst(GLint num, struct fp_instruction *fp) case FP_OPCODE_X2D: fprintf(stderr, "FP_OPCODE_XPD"); break; + + default: + _mesa_warning(NULL, "Bad opcode in debug_fg_inst()"); } fprintf(stderr, " D(0x%x:%d:%d%d%d%d) ", @@ -200,6 +203,8 @@ _mesa_parse_arb_fragment_program(GLcontext * ctx, GLenum target, #if DEBUG_FP debug_fp_inst(ap.Base.NumInstructions, ap.FPInstructions); +#else + (void) debug_fp_inst; #endif /* copy the relvant contents of the arb_program struct into the @@ -214,7 +219,7 @@ _mesa_parse_arb_fragment_program(GLcontext * ctx, GLenum target, program->Instructions = ap.FPInstructions; program->InputsRead = ap.InputsRead; program->OutputsWritten = ap.OutputsWritten; - for (retval=0; retvalTexturesUsed[retval] = ap.TexturesUsed[retval]; program->NumAluInstructions = ap.NumAluInstructions; program->NumTexInstructions = ap.NumTexInstructions; diff --git a/src/mesa/main/arbparse.c b/src/mesa/main/arbparse.c index 032b5cc5035..2071835049e 100644 --- a/src/mesa/main/arbparse.c +++ b/src/mesa/main/arbparse.c @@ -42,9 +42,6 @@ #include "nvfragprog.h" #include "arbparse.h" -#include -#include -#include /* TODO: * Fragment Program Stuff: @@ -667,8 +664,10 @@ static const byte *OUT_OF_MEMORY = (byte *) "internal error 1001: out of physical memory"; static const byte *UNRESOLVED_REFERENCE = (byte *) "internal error 1002: unresolved reference '$'"; +/* static const byte *INVALID_PARAMETER = (byte *) "internal error 1003: invalid parameter"; +*/ static const byte *error_message = NULL; static byte *error_param = NULL; /* this is inserted into error_message in place of $ */ @@ -2346,7 +2345,7 @@ match (dict * di, const byte * text, GLuint * index, defntn * de, static byte * error_get_token (error * er, dict * di, const byte * text, unsigned int ind) { - byte *str = NULL, *result = NULL; + byte *str = NULL; if (er->m_token) { barray *ba; @@ -3039,6 +3038,7 @@ parse_face_type (byte ** inst) case FACE_BACK: return 1; } + return 0; } /** @@ -3590,7 +3590,6 @@ static GLuint parse_result_binding (GLcontext * ctx, byte ** inst, GLuint * binding, GLuint * binding_idx, struct arb_program *Program) { - GLint a; GLuint b; switch (*(*inst)++) { @@ -3723,10 +3722,9 @@ parse_param_elements (GLcontext * ctx, byte ** inst, struct arb_program *Program, GLboolean use) { GLint idx; - GLuint found, specified_length, err; + GLuint err; GLint state_tokens[6]; GLfloat const_values[4]; - char *error_msg; err = 0; @@ -3864,8 +3862,6 @@ parse_param (GLcontext * ctx, byte ** inst, struct var_cache **vc_head, struct arb_program *Program) { GLuint found, specified_length, err; - GLint state_tokens[6]; - GLfloat const_values[4]; char *error_msg; struct var_cache *param_var; @@ -4205,7 +4201,7 @@ parse_masked_dst_reg (GLcontext * ctx, byte ** inst, struct var_cache **vc_head, struct arb_program *Program, GLint * File, GLint * Index, GLboolean * WriteMask) { - GLuint err, result; + GLuint result; byte mask; struct var_cache *dst; @@ -4293,9 +4289,8 @@ parse_masked_address_reg (GLcontext * ctx, byte ** inst, struct arb_program *Program, GLint * Index, GLboolean * WriteMask) { - GLuint err, result; - byte mask; struct var_cache *dst; + GLuint result; dst = parse_string (inst, vc_head, Program, &result); Program->Position = parse_position (inst); @@ -4572,8 +4567,6 @@ parse_scalar_src_reg (GLcontext * ctx, byte ** inst, GLint * File, GLint * Index, GLboolean * Negate, GLubyte * Swizzle) { - GLint a; - /* Grab the sign */ *Negate = parse_sign (inst); diff --git a/src/mesa/main/arbvertparse.c b/src/mesa/main/arbvertparse.c index 0df17f370af..7a6fc6e7dbb 100644 --- a/src/mesa/main/arbvertparse.c +++ b/src/mesa/main/arbvertparse.c @@ -32,6 +32,7 @@ #include "glheader.h" #include "context.h" +#include "arbvertparse.h" #include "hash.h" #include "imports.h" #include "macros.h" @@ -175,7 +176,7 @@ _mesa_parse_arb_vertex_program(GLcontext * ctx, GLenum target, GLuint retval; struct arb_program ap; - retval = _mesa_parse_arb_program(ctx, str, len, &ap); + retval = _mesa_parse_arb_program(ctx, str, len, &ap); /* XXX: Parse error. Cleanup things and return */ if (retval) @@ -191,6 +192,8 @@ _mesa_parse_arb_vertex_program(GLcontext * ctx, GLenum target, #if DEBUG_VP debug_vp_inst(ap.Base.NumInstructions, ap.VPInstructions); +#else + (void) debug_vp_inst; #endif /* copy the relvant contents of the arb_program struct into the