replace GLint with gl_state_index
diff --git a/src/mesa/shader/arbprogparse.c b/src/mesa/shader/arbprogparse.c
index 43e2c7e..6058fc9 100644
--- a/src/mesa/shader/arbprogparse.c
+++ b/src/mesa/shader/arbprogparse.c
@@ -1085,7 +1085,8 @@
*/
static GLuint
parse_state_single_item (GLcontext * ctx, const GLubyte ** inst,
- struct arb_program *Program, GLint * state_tokens)
+ struct arb_program *Program,
+ gl_state_index state_tokens[STATE_LENGTH])
{
switch (*(*inst)++) {
case STATE_MATERIAL_PARSER:
@@ -1269,7 +1270,8 @@
case STATE_CLIP_PLANE:
state_tokens[0] = STATE_CLIPPLANE;
state_tokens[1] = parse_integer (inst, Program);
- if (parse_clipplane_num (ctx, inst, Program, &state_tokens[1]))
+ if (parse_clipplane_num (ctx, inst, Program,
+ (GLint *) &state_tokens[1]))
return 1;
break;
@@ -1287,9 +1289,10 @@
/* XXX: I think this is the correct format for a matrix row */
case STATE_MATRIX_ROWS:
- if (parse_matrix
- (ctx, inst, Program, &state_tokens[0], &state_tokens[1],
- &state_tokens[4]))
+ if (parse_matrix(ctx, inst, Program,
+ (GLint *) &state_tokens[0],
+ (GLint *) &state_tokens[1],
+ (GLint *) &state_tokens[4]))
return 1;
state_tokens[2] = parse_integer (inst, Program); /* The first row to grab */
@@ -1345,7 +1348,8 @@
*/
static GLuint
parse_program_single_item (GLcontext * ctx, const GLubyte ** inst,
- struct arb_program *Program, GLint * state_tokens)
+ struct arb_program *Program,
+ gl_state_index state_tokens[STATE_LENGTH])
{
if (Program->Base.Target == GL_FRAGMENT_PROGRAM_ARB)
state_tokens[0] = STATE_FRAGMENT_PROGRAM;
@@ -1720,7 +1724,7 @@
{
GLint idx;
GLuint err = 0;
- GLint state_tokens[STATE_LENGTH];
+ gl_state_index state_tokens[STATE_LENGTH];
GLfloat const_values[4];
switch (*(*inst)++) {
diff --git a/src/mesa/shader/prog_parameter.c b/src/mesa/shader/prog_parameter.c
index 505c501..14b272c 100644
--- a/src/mesa/shader/prog_parameter.c
+++ b/src/mesa/shader/prog_parameter.c
@@ -370,7 +370,7 @@
*/
GLint
_mesa_add_state_reference(struct gl_program_parameter_list *paramList,
- const GLint stateTokens[STATE_LENGTH])
+ const gl_state_index stateTokens[STATE_LENGTH])
{
const GLuint size = 4; /* XXX fix */
const char *name;
diff --git a/src/mesa/shader/prog_parameter.h b/src/mesa/shader/prog_parameter.h
index 459643f..3d32a64 100644
--- a/src/mesa/shader/prog_parameter.h
+++ b/src/mesa/shader/prog_parameter.h
@@ -50,7 +50,7 @@
/**
* A sequence of STATE_* tokens and integers to identify GL state.
*/
- GLint StateIndexes[STATE_LENGTH];
+ gl_state_index StateIndexes[STATE_LENGTH];
};
@@ -115,7 +115,7 @@
extern GLint
_mesa_add_state_reference(struct gl_program_parameter_list *paramList,
- const GLint stateTokens[STATE_LENGTH]);
+ const gl_state_index stateTokens[STATE_LENGTH]);
extern GLfloat *
_mesa_lookup_parameter_value(const struct gl_program_parameter_list *paramList,
diff --git a/src/mesa/shader/prog_statevars.c b/src/mesa/shader/prog_statevars.c
index 0d70af3..93d9244 100644
--- a/src/mesa/shader/prog_statevars.c
+++ b/src/mesa/shader/prog_statevars.c
@@ -439,7 +439,7 @@
* some GL state has changed.
*/
GLbitfield
-_mesa_program_state_flags(const GLint state[STATE_LENGTH])
+_mesa_program_state_flags(const gl_state_index state[STATE_LENGTH])
{
switch (state[0]) {
case STATE_MATERIAL:
@@ -678,7 +678,7 @@
* Use _mesa_free() to deallocate the string.
*/
const char *
-_mesa_program_state_string(const GLint state[STATE_LENGTH])
+_mesa_program_state_string(const gl_state_index state[STATE_LENGTH])
{
char str[1000] = "";
char tmp[30];
diff --git a/src/mesa/shader/prog_statevars.h b/src/mesa/shader/prog_statevars.h
index 8216934..3281a4a 100644
--- a/src/mesa/shader/prog_statevars.h
+++ b/src/mesa/shader/prog_statevars.h
@@ -119,11 +119,11 @@
extern GLbitfield
-_mesa_program_state_flags(const GLint state[STATE_LENGTH]);
+_mesa_program_state_flags(const gl_state_index state[STATE_LENGTH]);
extern const char *
-_mesa_program_state_string(const GLint state[STATE_LENGTH]);
+_mesa_program_state_string(const gl_state_index state[STATE_LENGTH]);
#endif /* PROG_STATEVARS_H */
diff --git a/src/mesa/shader/programopt.c b/src/mesa/shader/programopt.c
index 18da39c..2d14cd3 100644
--- a/src/mesa/shader/programopt.c
+++ b/src/mesa/shader/programopt.c
@@ -56,7 +56,7 @@
* Setup state references for the modelview/projection matrix.
* XXX we should check if these state vars are already declared.
*/
- static const GLint mvpState[4][STATE_LENGTH] = {
+ static const gl_state_index mvpState[4][STATE_LENGTH] = {
{ STATE_MVP_MATRIX, 0, 0, 0, 0 }, /* state.matrix.mvp.row[0] */
{ STATE_MVP_MATRIX, 0, 1, 1, 0 }, /* state.matrix.mvp.row[1] */
{ STATE_MVP_MATRIX, 0, 2, 2, 0 }, /* state.matrix.mvp.row[2] */
@@ -125,9 +125,9 @@
void
_mesa_append_fog_code(GLcontext *ctx, struct gl_fragment_program *fprog)
{
- static const GLint fogPStateOpt[STATE_LENGTH]
+ static const gl_state_index fogPStateOpt[STATE_LENGTH]
= { STATE_INTERNAL, STATE_FOG_PARAMS_OPTIMIZED, 0, 0, 0 };
- static const GLint fogColorState[STATE_LENGTH]
+ static const gl_state_index fogColorState[STATE_LENGTH]
= { STATE_FOG_COLOR, 0, 0, 0, 0};
struct prog_instruction *newInst, *inst;
const GLuint origLen = fprog->Base.NumInstructions;
diff --git a/src/mesa/shader/slang/slang_builtin.c b/src/mesa/shader/slang/slang_builtin.c
index 2e4687a..b01b74d 100644
--- a/src/mesa/shader/slang/slang_builtin.c
+++ b/src/mesa/shader/slang/slang_builtin.c
@@ -309,7 +309,7 @@
GLuint j;
for (j = 0; j < 4; j++) {
tokens[2] = tokens[3] = j; /* jth row of matrix */
- pos[j] = _mesa_add_state_reference(paramList, (GLint *) tokens);
+ pos[j] = _mesa_add_state_reference(paramList, tokens);
assert(pos[j] >= 0);
ASSERT(pos[j] >= 0);
}
@@ -317,7 +317,7 @@
}
else {
/* allocate a single register */
- GLint pos = _mesa_add_state_reference(paramList, (GLint *) tokens);
+ GLint pos = _mesa_add_state_reference(paramList, tokens);
ASSERT(pos >= 0);
return pos;
}
diff --git a/src/mesa/shader/slang/slang_link.c b/src/mesa/shader/slang/slang_link.c
index e2bb6ee..f468a8c 100644
--- a/src/mesa/shader/slang/slang_link.c
+++ b/src/mesa/shader/slang/slang_link.c
@@ -199,7 +199,7 @@
j = _mesa_add_named_constant(shProg->Uniforms, p->Name, pVals, p->Size);
break;
case PROGRAM_STATE_VAR:
- j = _mesa_add_state_reference(shProg->Uniforms, (const GLint *) p->StateIndexes);
+ j = _mesa_add_state_reference(shProg->Uniforms, p->StateIndexes);
break;
case PROGRAM_UNIFORM:
j = _mesa_add_uniform(shProg->Uniforms, p->Name, p->Size);