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

Vinson Lee vlee at freedesktop.org
Tue Mar 3 18:49:59 PST 2015


  CXX      ast_array_index.lo
ast_array_index.cpp: In function ‘void update_max_array_access(ir_rvalue*, int, YYLTYPE*, _mesa_glsl_parse_state*)’:
ast_array_index.cpp:86:30: warning: unused variable ‘interface_type’ [-Wunused-variable]
             const glsl_type *interface_type =
                              ^

Signed-off-by: Vinson Lee <vlee at freedesktop.org>
---
 src/glsl/ast_array_index.cpp | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/src/glsl/ast_array_index.cpp b/src/glsl/ast_array_index.cpp
index ff0c757..ecef651 100644
--- a/src/glsl/ast_array_index.cpp
+++ b/src/glsl/ast_array_index.cpp
@@ -83,11 +83,9 @@ update_max_array_access(ir_rvalue *ir, int idx, YYLTYPE *loc,
 
       if (deref_var != NULL) {
          if (deref_var->var->is_interface_instance()) {
-            const glsl_type *interface_type =
-               deref_var->var->get_interface_type();
             unsigned field_index =
                deref_record->record->type->field_index(deref_record->field);
-            assert(field_index < interface_type->length);
+            assert(field_index < deref_var->var->get_interface_type()->length);
 
             unsigned *const max_ifc_array_access =
                deref_var->var->get_max_ifc_array_access();
-- 
2.3.1



More information about the mesa-dev mailing list