[Mesa-dev] [PATCH] i915: Fix GCC unused-but-set-variable warning in release build.

Vinson Lee vlee at freedesktop.org
Fri Mar 6 21:56:14 PST 2015


i915_fragprog.c: In function ‘i915ValidateFragmentProgram’:
i915_fragprog.c:1453:11: warning: variable ‘k’ set but not used [-Wunused-but-set-variable]
       int k;
           ^

Signed-off-by: Vinson Lee <vlee at freedesktop.org>
---
 src/mesa/drivers/dri/i915/i915_fragprog.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/src/mesa/drivers/dri/i915/i915_fragprog.c b/src/mesa/drivers/dri/i915/i915_fragprog.c
index d42da5a..9b00223 100644
--- a/src/mesa/drivers/dri/i915/i915_fragprog.c
+++ b/src/mesa/drivers/dri/i915/i915_fragprog.c
@@ -1450,8 +1450,6 @@ i915ValidateFragmentProgram(struct i915_context *i915)
 
    if (s2 != i915->state.Ctx[I915_CTXREG_LIS2] ||
        s4 != i915->state.Ctx[I915_CTXREG_LIS4]) {
-      int k;
-
       I915_STATECHANGE(i915, I915_UPLOAD_CTX);
 
       /* Must do this *after* statechange, so as not to affect
@@ -1471,8 +1469,7 @@ i915ValidateFragmentProgram(struct i915_context *i915)
       i915->state.Ctx[I915_CTXREG_LIS2] = s2;
       i915->state.Ctx[I915_CTXREG_LIS4] = s4;
 
-      k = intel->vtbl.check_vertex_size(intel, intel->vertex_size);
-      assert(k);
+      assert(intel->vtbl.check_vertex_size(intel, intel->vertex_size));
    }
 
    if (!p->params_uptodate)
-- 
2.3.1



More information about the mesa-dev mailing list