summaryrefslogtreecommitdiffstats
path: root/src/mesa/shader/arbprogparse.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/shader/arbprogparse.c')
-rw-r--r--src/mesa/shader/arbprogparse.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/src/mesa/shader/arbprogparse.c b/src/mesa/shader/arbprogparse.c
index de449fe0980..718162fd23d 100644
--- a/src/mesa/shader/arbprogparse.c
+++ b/src/mesa/shader/arbprogparse.c
@@ -801,9 +801,9 @@ static GLuint
parse_generic_attrib_num(GLcontext *ctx, GLubyte ** inst,
struct arb_program *Program, GLuint *attrib)
{
- *attrib = parse_integer(inst, Program);
+ GLint i = parse_integer(inst, Program);
- if ((*attrib < 0) || (*attrib > MAX_VERTEX_PROGRAM_ATTRIBS))
+ if ((i < 0) || (i > MAX_VERTEX_PROGRAM_ATTRIBS))
{
_mesa_set_program_error (ctx, Program->Position,
"Invalid generic vertex attribute index");
@@ -812,6 +812,8 @@ parse_generic_attrib_num(GLcontext *ctx, GLubyte ** inst,
return 1;
}
+ *attrib = (GLuint) i;
+
return 0;
}
@@ -824,15 +826,16 @@ static GLuint
parse_texcoord_num (GLcontext * ctx, GLubyte ** inst,
struct arb_program *Program, GLuint * coord)
{
- *coord = parse_integer (inst, Program);
+ GLint i = parse_integer (inst, Program);
- if ((*coord < 0) || (*coord >= ctx->Const.MaxTextureUnits)) {
+ if ((i < 0) || (i >= ctx->Const.MaxTextureUnits)) {
_mesa_set_program_error (ctx, Program->Position,
"Invalid texture unit index");
_mesa_error (ctx, GL_INVALID_OPERATION, "Invalid texture unit index");
return 1;
}
+ *coord = (GLuint) i;
return 0;
}
@@ -1833,7 +1836,8 @@ static GLuint
parse_param (GLcontext * ctx, GLubyte ** inst, struct var_cache **vc_head,
struct arb_program *Program)
{
- GLuint found, specified_length, err;
+ GLuint found, err;
+ GLint specified_length;
char *error_msg;
struct var_cache *param_var;
@@ -2435,7 +2439,8 @@ parse_src_reg (GLcontext * ctx, GLubyte ** inst, struct var_cache **vc_head,
GLboolean *IsRelOffset )
{
struct var_cache *src;
- GLuint binding_state, binding_idx, is_generic, found, offset;
+ GLuint binding_state, binding_idx, is_generic, found;
+ GLint offset;
/* And the binding for the src */
switch (*(*inst)++) {
@@ -3861,7 +3866,6 @@ _mesa_parse_arb_program (GLcontext * ctx, const GLubyte * str, GLsizei len,
grammar_get_last_error ((GLubyte *) error_msg, 300, &error_pos);
_mesa_set_program_error (ctx, error_pos, error_msg);
_mesa_error (ctx, GL_INVALID_OPERATION, "Parse Error");
-
grammar_destroy (arbprogram_syn_id);
return 1;
}
@@ -3903,7 +3907,7 @@ _mesa_parse_arb_program (GLcontext * ctx, const GLubyte * str, GLsizei len,
/* Check the grammer rev */
if (*inst++ != REVISION) {
_mesa_set_program_error (ctx, 0, "Grammar version mismatch");
- _mesa_error (ctx, GL_INVALID_OPERATION, "Grammar verison mismatch");
+ _mesa_error (ctx, GL_INVALID_OPERATION, "Grammar version mismatch");
err = 1;
}
else {