r300-gallium: Fix a handful of compile warnings.
authorCorbin Simpson <MostAwesomeDude@gmail.com>
Mon, 23 Feb 2009 12:36:41 +0000 (04:36 -0800)
committerCorbin Simpson <MostAwesomeDude@gmail.com>
Mon, 23 Feb 2009 12:37:58 +0000 (04:37 -0800)
Some harmless, some very dangerous.

src/gallium/drivers/r300/r300_context.h
src/gallium/drivers/r300/r300_state_derived.c
src/gallium/drivers/r300/r300_swtcl_emit.c

index 5bcf23e2c5991c66e6dd738ab13e900c0a93cb53..aaab1dd2bcba701f23af22d93ad7c7ba9af915c3 100644 (file)
@@ -250,6 +250,7 @@ static struct r300_context* r300_context(struct pipe_context* context) {
 }
 
 /* Context initialization. */
+struct draw_stage* r300_draw_swtcl_stage(struct r300_context* r300);
 void r300_init_state_functions(struct r300_context* r300);
 void r300_init_surface_functions(struct r300_context* r300);
 
index 2d611b951d16336a084829801dfdb3cc0451e839..a51904096f225e332e70c8a9f7e13128058e763b 100644 (file)
@@ -40,7 +40,13 @@ static uint32_t translate_vertex_data_type(int type) {
         case EMIT_4F:
             return R300_DATA_TYPE_FLOAT_4;
             break;
+        default:
+            debug_printf("r300: Implementation error: "
+                    "Bad vertex data type!\n");
+            break;
     }
+
+    return 0;
 }
 
 /* Update the vertex_info struct in our r300_context.
@@ -98,7 +104,7 @@ static void r300_update_vertex_layout(struct r300_context* r300)
     vinfo.hwfmt[0] = 0x5555; /* XXX this is classic Mesa bonghits */
 
     if (!pos) {
-        debug_printf("r300: Forcing vertex position attribute emit...");
+        debug_printf("r300: Forcing vertex position attribute emit...\n");
     }
 
     draw_emit_vertex_attr(&vinfo, EMIT_4F, INTERP_POS,
index 3ce1837ed1ba5522aa00baad23ebfc317420eabf..1ae69e7d13049e5f0ce6be37171a3c2e7e51d280 100644 (file)
@@ -78,7 +78,7 @@ static boolean r300_swtcl_render_allocate_vertices(struct vbuf_render* render,
     size_t size = (size_t)vertex_size * (size_t)count;
 
     if (r300render->vbo) {
-        pipe_buffer_reference(screen, r300render->vbo, NULL);
+        pipe_buffer_reference(screen, &r300render->vbo, NULL);
     }
 
     r300render->vbo_size = MAX2(size, r300render->vbo_alloc_size);
@@ -108,9 +108,9 @@ static void* r300_swtcl_render_map_vertices(struct vbuf_render* render)
     return (unsigned char*)r300render->vbo_map + r300render->vbo_offset;
 }
 
-static void* r300_swtcl_render_unmap_vertices(struct vbuf_render* render,
-                                              ushort min,
-                                              ushort max)
+static void r300_swtcl_render_unmap_vertices(struct vbuf_render* render,
+                                             ushort min,
+                                             ushort max)
 {
     struct r300_swtcl_render* r300render = r300_swtcl_render(render);
     struct pipe_screen* screen = r300render->r300->context.screen;
@@ -126,7 +126,7 @@ static void r300_swtcl_render_release_vertices(struct vbuf_render* render)
     struct r300_swtcl_render* r300render = r300_swtcl_render(render);
     struct pipe_screen* screen = r300render->r300->context.screen;
 
-    pipe_buffer_reference(screen, r300render->vbo, NULL);
+    pipe_buffer_reference(screen, &r300render->vbo, NULL);
 }
 
 static boolean r300_swtcl_render_set_primitive(struct vbuf_render* render,