intel: Initialize color and spec arrays in LOCAL_VARS macro.
authorKristian Høgsberg <krh@redhat.com>
Mon, 25 Feb 2008 22:28:09 +0000 (17:28 -0500)
committerKristian Høgsberg <krh@redhat.com>
Tue, 26 Feb 2008 00:02:06 +0000 (19:02 -0500)
Avoids spamming compilation output with tons of warnings about
use of possibly uninitialized variables.

src/mesa/drivers/dri/i915/intel_tris.c

index 9d93636900583950f9673905b70168ddf0c0766b..29f0b51ba63edb5fbc8bed9be63c5a97fba01239 100644 (file)
@@ -465,10 +465,10 @@ do {                                                      \
 #define VERT_RESTORE_SPEC( idx ) if (specoffset) v[idx]->ui[specoffset] = spec[idx]
 
 #define LOCAL_VARS(n)                                                  \
-   struct intel_context *intel = intel_context(ctx);                           \
-   GLuint color[n], spec[n];                                           \
-   GLuint coloroffset = intel->coloroffset;            \
-   GLboolean specoffset = intel->specoffset;                   \
+   struct intel_context *intel = intel_context(ctx);                   \
+   GLuint color[n] = { 0, }, spec[n] = { 0, };                         \
+   GLuint coloroffset = intel->coloroffset;                            \
+   GLboolean specoffset = intel->specoffset;                           \
    (void) color; (void) spec; (void) coloroffset; (void) specoffset;