summaryrefslogtreecommitdiff
path: root/src/mesa/shader
diff options
context:
space:
mode:
authorKeith Whitwell <keith@tungstengraphics.com>2008-09-11 18:32:05 +0100
committerKeith Whitwell <keith@tungstengraphics.com>2008-09-11 18:32:05 +0100
commitcc7dd4fc1b3c765ca1ecd943d189bb156dae529d (patch)
tree1a3560eb6df8a443c4f0e5af0a916f190b1542f6 /src/mesa/shader
parent685248bea1fef5fd6335982570e34d0f6672030d (diff)
parentd50d68a1c940ed9c8d8c65e8e33667fa90d5baa1 (diff)
Merge commit 'origin/gallium-0.1' into gallium-0.2
Conflicts: Makefile progs/demos/Makefile progs/glsl/Makefile progs/redbook/Makefile progs/samples/Makefile progs/tests/Makefile progs/trivial/Makefile progs/xdemos/Makefile src/gallium/Makefile src/mesa/main/attrib.c src/mesa/main/bufferobj.c src/mesa/vbo/vbo_exec_draw.c
Diffstat (limited to 'src/mesa/shader')
-rw-r--r--src/mesa/shader/arbprogparse.c4
-rw-r--r--src/mesa/shader/prog_parameter.c4
-rw-r--r--src/mesa/shader/prog_print.c4
-rw-r--r--src/mesa/shader/prog_statevars.c2
-rw-r--r--src/mesa/shader/prog_statevars.h2
5 files changed, 9 insertions, 7 deletions
diff --git a/src/mesa/shader/arbprogparse.c b/src/mesa/shader/arbprogparse.c
index 78cc6aa9cc..26ccdc7395 100644
--- a/src/mesa/shader/arbprogparse.c
+++ b/src/mesa/shader/arbprogparse.c
@@ -3354,11 +3354,11 @@ debug_variables (GLcontext * ctx, struct var_cache *vc_head,
fprintf (stderr, "%s\n",
Program->Base.Parameters->Parameters[a + b].Name);
if (Program->Base.Parameters->Parameters[a + b].Type == PROGRAM_STATE_VAR) {
- const char *s;
+ char *s;
s = _mesa_program_state_string(Program->Base.Parameters->Parameters
[a + b].StateIndexes);
fprintf(stderr, "%s\n", s);
- _mesa_free((char *) s);
+ _mesa_free(s);
}
else
fprintf (stderr, "%f %f %f %f\n",
diff --git a/src/mesa/shader/prog_parameter.c b/src/mesa/shader/prog_parameter.c
index 2dfd923a0f..bfe27d2f63 100644
--- a/src/mesa/shader/prog_parameter.c
+++ b/src/mesa/shader/prog_parameter.c
@@ -420,7 +420,7 @@ _mesa_add_state_reference(struct gl_program_parameter_list *paramList,
const gl_state_index stateTokens[STATE_LENGTH])
{
const GLuint size = 4; /* XXX fix */
- const char *name;
+ char *name;
GLint index;
/* Check if the state reference is already in the list */
@@ -447,7 +447,7 @@ _mesa_add_state_reference(struct gl_program_parameter_list *paramList,
paramList->StateFlags |= _mesa_program_state_flags(stateTokens);
/* free name string here since we duplicated it in add_parameter() */
- _mesa_free((void *) name);
+ _mesa_free(name);
return index;
}
diff --git a/src/mesa/shader/prog_print.c b/src/mesa/shader/prog_print.c
index 10c5afec18..ec260f18a9 100644
--- a/src/mesa/shader/prog_print.c
+++ b/src/mesa/shader/prog_print.c
@@ -250,7 +250,9 @@ reg_string(enum register_file f, GLint index, gl_prog_print_mode mode,
{
struct gl_program_parameter *param
= prog->Parameters->Parameters + index;
- sprintf(str, _mesa_program_state_string(param->StateIndexes));
+ char *state = _mesa_program_state_string(param->StateIndexes);
+ sprintf(str, state);
+ _mesa_free(state);
}
break;
case PROGRAM_ADDRESS:
diff --git a/src/mesa/shader/prog_statevars.c b/src/mesa/shader/prog_statevars.c
index 971eb25a49..d4e31207e8 100644
--- a/src/mesa/shader/prog_statevars.c
+++ b/src/mesa/shader/prog_statevars.c
@@ -784,7 +784,7 @@ append_index(char *dst, GLint index)
* For example, return "state.matrix.texture[2].inverse".
* Use _mesa_free() to deallocate the string.
*/
-const char *
+char *
_mesa_program_state_string(const gl_state_index state[STATE_LENGTH])
{
char str[1000] = "";
diff --git a/src/mesa/shader/prog_statevars.h b/src/mesa/shader/prog_statevars.h
index d3091147f8..20643ca794 100644
--- a/src/mesa/shader/prog_statevars.h
+++ b/src/mesa/shader/prog_statevars.h
@@ -130,7 +130,7 @@ extern GLbitfield
_mesa_program_state_flags(const gl_state_index state[STATE_LENGTH]);
-extern const char *
+extern char *
_mesa_program_state_string(const gl_state_index state[STATE_LENGTH]);