summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/r200
diff options
context:
space:
mode:
authorEmil Velikov <[email protected]>2015-10-13 11:26:09 +0100
committerEmil Velikov <[email protected]>2015-10-15 13:30:52 +0100
commitbcb56c2c69dd1695d7828d831d71c957e7e497c6 (patch)
treec2ac6d67a12ebdb58197894c1213f75c55408564 /src/mesa/drivers/dri/r200
parent2034bdd46ce757a18fdb3498f6a0232db16522f3 (diff)
program: convert _mesa_init_gl_program() to take struct gl_program *
Rather than accepting a void pointer, only to down and up cast around it, convert the function to take the base (struct gl_program) pointer. Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
Diffstat (limited to 'src/mesa/drivers/dri/r200')
-rw-r--r--src/mesa/drivers/dri/r200/r200_vertprog.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/mesa/drivers/dri/r200/r200_vertprog.c b/src/mesa/drivers/dri/r200/r200_vertprog.c
index d173605d110..628c5708090 100644
--- a/src/mesa/drivers/dri/r200/r200_vertprog.c
+++ b/src/mesa/drivers/dri/r200/r200_vertprog.c
@@ -1200,18 +1200,19 @@ r200BindProgram(struct gl_context *ctx, GLenum target, struct gl_program *prog)
static struct gl_program *
r200NewProgram(struct gl_context *ctx, GLenum target, GLuint id)
{
- struct r200_vertex_program *vp;
-
switch(target){
- case GL_VERTEX_PROGRAM_ARB:
- vp = CALLOC_STRUCT(r200_vertex_program);
- return _mesa_init_gl_program(&vp->mesa_program, target, id);
- case GL_FRAGMENT_PROGRAM_ARB:
- return _mesa_init_gl_program(CALLOC_STRUCT(gl_fragment_program), target, id);
+ case GL_VERTEX_PROGRAM_ARB: {
+ struct r200_vertex_program *vp = CALLOC_STRUCT(r200_vertex_program);
+ return _mesa_init_gl_program(&vp->mesa_program.Base, target, id);
+ }
+ case GL_FRAGMENT_PROGRAM_ARB: {
+ struct gl_fragment_program *prog = CALLOC_STRUCT(gl_fragment_program);
+ return _mesa_init_gl_program(&prog->Base, target, id);
+ }
default:
_mesa_problem(ctx, "Bad target in r200NewProgram");
+ return NULL;
}
- return NULL;
}