added a const, clean-up

This commit is contained in:
Brian Paul
2005-11-03 02:26:47 +00:00
parent 45cd2f9305
commit 1624162b0c
2 changed files with 16 additions and 12 deletions

View File

@@ -1,8 +1,8 @@
/* /*
* Mesa 3-D graphics library * Mesa 3-D graphics library
* Version: 6.2 * Version: 6.5
* *
* Copyright (C) 1999-2004 Brian Paul All Rights Reserved. * Copyright (C) 1999-2005 Brian Paul All Rights Reserved.
* *
* Permission is hereby granted, free of charge, to any person obtaining a * Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"), * copy of this software and associated documentation files (the "Software"),
@@ -383,6 +383,7 @@ _mesa_free_parameters(struct program_parameter_list *paramList)
/** /**
* Helper function used by the functions below. * Helper function used by the functions below.
* \return index of new parameter in the list, or -1 if error (out of mem)
*/ */
static GLint static GLint
add_parameter(struct program_parameter_list *paramList, add_parameter(struct program_parameter_list *paramList,
@@ -483,19 +484,22 @@ _mesa_add_unnamed_constant(struct program_parameter_list *paramList,
*/ */
GLint GLint
_mesa_add_state_reference(struct program_parameter_list *paramList, _mesa_add_state_reference(struct program_parameter_list *paramList,
GLint *stateTokens) const GLint *stateTokens)
{ {
/* XXX Should we parse <stateString> here and produce the parameter's /* XXX we should probably search the current parameter list to see if
* list of STATE_* tokens here, or in the parser? * the new state reference is already present.
*/ */
GLint a, idx; GLint index;
idx = add_parameter(paramList, NULL, NULL, STATE); index = add_parameter(paramList, NULL, NULL, STATE);
if (index >= 0) {
for (a=0; a<6; a++) GLuint i;
paramList->Parameters[idx].StateIndexes[a] = (enum state_index) stateTokens[a]; for (i = 0; i < 6; i++)
paramList->Parameters[index].StateIndexes[i]
= (enum state_index) stateTokens[i];
}
return idx; return index;
} }

View File

@@ -249,7 +249,7 @@ _mesa_add_unnamed_constant(struct program_parameter_list *paramList,
extern GLint extern GLint
_mesa_add_state_reference(struct program_parameter_list *paramList, _mesa_add_state_reference(struct program_parameter_list *paramList,
GLint *stateTokens); const GLint *stateTokens);
extern GLfloat * extern GLfloat *
_mesa_lookup_parameter_value(struct program_parameter_list *paramList, _mesa_lookup_parameter_value(struct program_parameter_list *paramList,