summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/nvprogram.c
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2012-07-18 15:33:11 -0600
committerBrian Paul <[email protected]>2012-07-18 16:51:47 -0600
commite4f8d33aea7e0112dfbf3a38fdc36d11b2e7be10 (patch)
tree7275efcba72bcbcc87546a392303e9155999e39a /src/mesa/main/nvprogram.c
parent1170b5aa9f8394fefcbab759c09d26293ba4b0ee (diff)
mesa: use gl_program cast wrappers
In a few cases, remove unneeded casts. And fix a few other const-correctness issues. Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/mesa/main/nvprogram.c')
-rw-r--r--src/mesa/main/nvprogram.c21
1 files changed, 9 insertions, 12 deletions
diff --git a/src/mesa/main/nvprogram.c b/src/mesa/main/nvprogram.c
index dae11566e39..fc5749afc8a 100644
--- a/src/mesa/main/nvprogram.c
+++ b/src/mesa/main/nvprogram.c
@@ -71,7 +71,7 @@ _mesa_ExecuteProgramNV(GLenum target, GLuint id, const GLfloat *params)
FLUSH_VERTICES(ctx, _NEW_PROGRAM);
- vprog = (struct gl_vertex_program *) _mesa_lookup_program(ctx, id);
+ vprog = gl_vertex_program(_mesa_lookup_program(ctx, id));
if (!vprog || vprog->Base.Target != GL_VERTEX_STATE_PROGRAM_NV) {
_mesa_error(ctx, GL_INVALID_OPERATION, "glExecuteProgramNV");
@@ -627,10 +627,9 @@ _mesa_LoadProgramNV(GLenum target, GLuint id, GLsizei len,
if ((target == GL_VERTEX_PROGRAM_NV ||
target == GL_VERTEX_STATE_PROGRAM_NV)
&& ctx->Extensions.NV_vertex_program) {
- struct gl_vertex_program *vprog = (struct gl_vertex_program *) prog;
+ struct gl_vertex_program *vprog = gl_vertex_program(prog);
if (!vprog || prog == &_mesa_DummyProgram) {
- vprog = (struct gl_vertex_program *)
- ctx->Driver.NewProgram(ctx, target, id);
+ vprog = gl_vertex_program(ctx->Driver.NewProgram(ctx, target, id));
if (!vprog) {
_mesa_error(ctx, GL_OUT_OF_MEMORY, "glLoadProgramNV");
return;
@@ -647,10 +646,9 @@ _mesa_LoadProgramNV(GLenum target, GLuint id, GLsizei len,
}
else if (target == GL_FRAGMENT_PROGRAM_NV
&& ctx->Extensions.NV_fragment_program) {
- struct gl_fragment_program *fprog = (struct gl_fragment_program *) prog;
+ struct gl_fragment_program *fprog = gl_fragment_program(prog);
if (!fprog || prog == &_mesa_DummyProgram) {
- fprog = (struct gl_fragment_program *)
- ctx->Driver.NewProgram(ctx, target, id);
+ fprog = gl_fragment_program(ctx->Driver.NewProgram(ctx, target, id));
if (!fprog) {
_mesa_error(ctx, GL_OUT_OF_MEMORY, "glLoadProgramNV");
return;
@@ -661,10 +659,9 @@ _mesa_LoadProgramNV(GLenum target, GLuint id, GLsizei len,
}
else if (target == GL_FRAGMENT_PROGRAM_ARB
&& ctx->Extensions.ARB_fragment_program) {
- struct gl_fragment_program *fprog = (struct gl_fragment_program *) prog;
+ struct gl_fragment_program *fprog = gl_fragment_program(prog);
if (!fprog || prog == &_mesa_DummyProgram) {
- fprog = (struct gl_fragment_program *)
- ctx->Driver.NewProgram(ctx, target, id);
+ fprog = gl_fragment_program(ctx->Driver.NewProgram(ctx, target, id));
if (!fprog) {
_mesa_error(ctx, GL_OUT_OF_MEMORY, "glLoadProgramNV");
return;
@@ -830,7 +827,7 @@ _mesa_ProgramNamedParameter4fNV(GLuint id, GLsizei len, const GLubyte *name,
return;
}
- fragProg = (struct gl_fragment_program *) prog;
+ fragProg = gl_fragment_program(prog);
v = _mesa_lookup_parameter_value(fragProg->Base.Parameters, len,
(char *) name);
if (v) {
@@ -895,7 +892,7 @@ _mesa_GetProgramNamedParameterfvNV(GLuint id, GLsizei len, const GLubyte *name,
return;
}
- fragProg = (struct gl_fragment_program *) prog;
+ fragProg = gl_fragment_program(prog);
v = _mesa_lookup_parameter_value(fragProg->Base.Parameters,
len, (char *) name);
if (v) {