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");
return 1;
}
+ *attrib = (GLuint) i;
+
return 0;
}
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;
}
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;
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)++) {
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;
}
/* 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 {