Mesa (master): draw: Avoid mixed declarations and code.

Chia-I Wu olv at kemper.freedesktop.org
Fri Aug 6 09:15:15 UTC 2010


Module: Mesa
Branch: master
Commit: d38afcd2f286e924e0f9b7f484712ac19e3f98fc
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=d38afcd2f286e924e0f9b7f484712ac19e3f98fc

Author: Chia-I Wu <olv at lunarg.com>
Date:   Fri Aug  6 16:57:04 2010 +0800

draw: Avoid mixed declarations and code.

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 |    4 ++--
 src/gallium/auxiliary/draw/draw_pt_decompose.h  |    2 +-
 src/gallium/auxiliary/draw/draw_pt_vcache_tmp.h |    2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/gallium/auxiliary/draw/draw_decompose_tmp.h b/src/gallium/auxiliary/draw/draw_decompose_tmp.h
index cb25202..a52d2b5 100644
--- a/src/gallium/auxiliary/draw/draw_decompose_tmp.h
+++ b/src/gallium/auxiliary/draw/draw_decompose_tmp.h
@@ -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;
 
diff --git a/src/gallium/auxiliary/draw/draw_pt_decompose.h b/src/gallium/auxiliary/draw/draw_pt_decompose.h
index e7ae9c4..3127aad 100644
--- a/src/gallium/auxiliary/draw/draw_pt_decompose.h
+++ b/src/gallium/auxiliary/draw/draw_pt_decompose.h
@@ -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"
diff --git a/src/gallium/auxiliary/draw/draw_pt_vcache_tmp.h b/src/gallium/auxiliary/draw/draw_pt_vcache_tmp.h
index 861ce1a..1a3748d 100644
--- a/src/gallium/auxiliary/draw/draw_pt_vcache_tmp.h
+++ b/src/gallium/auxiliary/draw/draw_pt_vcache_tmp.h
@@ -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)
 




More information about the mesa-commit mailing list