draw: Avoid mixed declarations and code.
authorChia-I Wu <olv@lunarg.com>
Fri, 6 Aug 2010 08:57:04 +0000 (16:57 +0800)
committerChia-I Wu <olv@lunarg.com>
Fri, 6 Aug 2010 09:14:21 +0000 (17:14 +0800)
Do not expand LOCAL_VARS to void expression.  Otherwise, declarations
and code will be mixed when more variables are declared in FUNC_ENTER.

This fixes fdo bug #29416.

src/gallium/auxiliary/draw/draw_decompose_tmp.h
src/gallium/auxiliary/draw/draw_pt_decompose.h
src/gallium/auxiliary/draw/draw_pt_vcache_tmp.h

index cb252023238e0337b6442a49a3c805dbe631f573..a52d2b50588a1ad1b7def3120c4d23b5fd2a652a 100644 (file)
@@ -30,7 +30,7 @@
 
 /* these macros are optional */
 #ifndef LOCAL_VARS
-#define LOCAL_VARS do {} while (0)
+#define LOCAL_VARS
 #endif
 #ifndef FUNC_ENTER
 #define FUNC_ENTER do {} while (0)
@@ -50,7 +50,7 @@ FUNC(FUNC_VARS)
 {
    unsigned idx[6], i;
    ushort flags;
-   LOCAL_VARS;
+   LOCAL_VARS
 
    FUNC_ENTER;
 
index e7ae9c4449944bd8fd838f6d2672d9e7fecd251c..3127aad731024d01e6c6999aecc44d011d2cad04 100644 (file)
@@ -2,6 +2,6 @@
    char *verts = (char *) vertices;          \
    const boolean last_vertex_last =          \
       !(draw->rasterizer->flatshade &&       \
-        draw->rasterizer->flatshade_first)
+        draw->rasterizer->flatshade_first);
 
 #include "draw_decompose_tmp.h"
index 861ce1adaa1f15711ec4a4541a31f4c75dae2b61..1a3748d5f0b0196efe846f548ac5e843528c732b 100644 (file)
@@ -10,7 +10,7 @@
    struct draw_context *draw = vcache->draw;                               \
    const unsigned prim = vcache->input_prim;                               \
    const boolean last_vertex_last = !(draw->rasterizer->flatshade &&       \
-                                      draw->rasterizer->flatshade_first)
+                                      draw->rasterizer->flatshade_first);
 
 #define GET_ELT(idx) (get_elt(elts, idx) + elt_bias)