[Mesa-dev] [PATCH] st/mesa: convert programs to gl_program *

Boyan Ding boyan.j.ding at gmail.com
Fri Oct 16 00:16:43 PDT 2015


Fixes following warnings:
state_tracker/st_cb_program.c: In function ‘st_new_program’:
state_tracker/st_cb_program.c:108:36: warning: passing argument 1 of
‘_mesa_init_gl_program’ from incompatible pointer type
[-Wincompatible-pointer-types]
       return _mesa_init_gl_program(&prog->Base, target, id);
                                    ^
In file included from state_tracker/st_cb_program.c:38:0:
./program/program.h:67:1: note: expected ‘struct gl_program *’ but
argument is of type ‘struct gl_vertex_program *’
 _mesa_init_gl_program(struct gl_program *prog, GLenum target, GLuint
id);
 ^
state_tracker/st_cb_program.c:112:36: warning: passing argument 1 of
‘_mesa_init_gl_program’ from incompatible pointer type
[-Wincompatible-pointer-types]
       return _mesa_init_gl_program(&prog->Base, target, id);
                                    ^
In file included from state_tracker/st_cb_program.c:38:0:
./program/program.h:67:1: note: expected ‘struct gl_program *’ but
argument is of type ‘struct gl_fragment_program *’
 _mesa_init_gl_program(struct gl_program *prog, GLenum target, GLuint
id);
 ^
state_tracker/st_cb_program.c:116:36: warning: passing argument 1 of
‘_mesa_init_gl_program’ from incompatible pointer type
[-Wincompatible-pointer-types]
       return _mesa_init_gl_program(&prog->Base, target, id);
                                    ^
In file included from state_tracker/st_cb_program.c:38:0:
./program/program.h:67:1: note: expected ‘struct gl_program *’ but
argument is of type ‘struct gl_geometry_program *’
 _mesa_init_gl_program(struct gl_program *prog, GLenum target, GLuint
id);
 ^
state_tracker/st_cb_program.c:120:36: warning: passing argument 1 of
‘_mesa_init_gl_program’ from incompatible pointer type
[-Wincompatible-pointer-types]
       return _mesa_init_gl_program(&prog->Base, target, id);
                                    ^
In file included from state_tracker/st_cb_program.c:38:0:
./program/program.h:67:1: note: expected ‘struct gl_program *’ but
argument is of type ‘struct gl_tess_ctrl_program *’
 _mesa_init_gl_program(struct gl_program *prog, GLenum target, GLuint
id);
 ^
state_tracker/st_cb_program.c:124:36: warning: passing argument 1 of
‘_mesa_init_gl_program’ from incompatible pointer type
[-Wincompatible-pointer-types]
       return _mesa_init_gl_program(&prog->Base, target, id);
                                    ^
In file included from state_tracker/st_cb_program.c:38:0:
./program/program.h:67:1: note: expected ‘struct gl_program *’ but
argument is of type ‘struct gl_tess_eval_program *’
 _mesa_init_gl_program(struct gl_program *prog, GLenum target, GLuint
id);
 ^
Fixes: bcb56c2c6 (program: convert _mesa_init_gl_program to take struct
gl_program *)

Signed-off-by: Boyan Ding <boyan.j.ding at gmail.com>
---
 src/mesa/state_tracker/st_cb_program.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/mesa/state_tracker/st_cb_program.c b/src/mesa/state_tracker/st_cb_program.c
index 26d128a..708bdf5 100644
--- a/src/mesa/state_tracker/st_cb_program.c
+++ b/src/mesa/state_tracker/st_cb_program.c
@@ -105,23 +105,23 @@ st_new_program(struct gl_context *ctx, GLenum target, GLuint id)
    switch (target) {
    case GL_VERTEX_PROGRAM_ARB: {
       struct st_vertex_program *prog = ST_CALLOC_STRUCT(st_vertex_program);
-      return _mesa_init_gl_program(&prog->Base, target, id);
+      return _mesa_init_gl_program(&prog->Base.Base, target, id);
    }
    case GL_FRAGMENT_PROGRAM_ARB: {
       struct st_fragment_program *prog = ST_CALLOC_STRUCT(st_fragment_program);
-      return _mesa_init_gl_program(&prog->Base, target, id);
+      return _mesa_init_gl_program(&prog->Base.Base, target, id);
    }
    case GL_GEOMETRY_PROGRAM_NV: {
       struct st_geometry_program *prog = ST_CALLOC_STRUCT(st_geometry_program);
-      return _mesa_init_gl_program(&prog->Base, target, id);
+      return _mesa_init_gl_program(&prog->Base.Base, target, id);
    }
    case GL_TESS_CONTROL_PROGRAM_NV: {
       struct st_tessctrl_program *prog = ST_CALLOC_STRUCT(st_tessctrl_program);
-      return _mesa_init_gl_program(&prog->Base, target, id);
+      return _mesa_init_gl_program(&prog->Base.Base, target, id);
    }
    case GL_TESS_EVALUATION_PROGRAM_NV: {
       struct st_tesseval_program *prog = ST_CALLOC_STRUCT(st_tesseval_program);
-      return _mesa_init_gl_program(&prog->Base, target, id);
+      return _mesa_init_gl_program(&prog->Base.Base, target, id);
    }
    default:
       assert(0);
-- 
2.6.1



More information about the mesa-dev mailing list