Change type of shader->executable field from void * to generic function pointer.
authorBrian <brian.paul@tungstengraphics.com>
Thu, 18 Oct 2007 17:09:12 +0000 (11:09 -0600)
committerBrian <brian.paul@tungstengraphics.com>
Thu, 18 Oct 2007 17:41:13 +0000 (11:41 -0600)
Fix warnings in draw_create_vertex_shader()

src/mesa/pipe/draw/draw_vertex_shader.c
src/mesa/pipe/p_state.h

index 8519daf17c1054a2c6a7437deb76d625da6d096d..fd0183f8cd4cf4830b385d091a0a8de489d3bf09 100644 (file)
@@ -212,12 +212,14 @@ draw_create_vertex_shader(struct draw_context *draw,
    vs->state = shader;
 #if defined(__i386__) || defined(__386__)
    if (draw->use_sse) {
-      x86_init_func( &shader->sse2_program );
+      /* cast-away const */
+      struct pipe_shader_state *sh = (struct pipe_shader_state *) shader;
 
-      tgsi_emit_sse2( shader->tokens, &shader->sse2_program );
+      x86_init_func( &sh->sse2_program );
 
-      ((struct pipe_shader_state *)shader)->executable = (void *)
-        x86_get_func( &shader->sse2_program );
+      tgsi_emit_sse2( sh->tokens, &sh->sse2_program );
+
+      sh->executable = x86_get_func( &sh->sse2_program );
    }
 #endif
 
index da62aa1b274e4123b4c06463e217fa46c302fd31..1c3b2811a4a63cc56fe292100cfee261ed5e6b29 100644 (file)
@@ -148,7 +148,7 @@ struct pipe_shader_state {
 #if defined(__i386__) || defined(__386__)
    struct x86_function sse2_program;
 #endif
-   void *executable;
+   void (*executable)();
 
    ubyte num_inputs;
    ubyte num_outputs;