[Mesa-dev] [PATCHv2 4/4] glsl opt_flip_matrices: Silence unused variable warning in the release build

Emil Velikov emil.l.velikov at gmail.com
Mon Jul 8 10:30:44 PDT 2013


Resolves the following gcc warning

 opt_flip_matrices.cpp:84:32: warning: unused variable 'deref'

v2: keep the variable, but wrap it in a ifndef NDEBUG block(suggested by Ian)

Signed-off-by: Emil Velikov <emil.l.velikov at gmail.com>
Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
---
Feel free to commit
---
 src/glsl/opt_flip_matrices.cpp | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/glsl/opt_flip_matrices.cpp b/src/glsl/opt_flip_matrices.cpp
index 497513f..2107b1d 100644
--- a/src/glsl/opt_flip_matrices.cpp
+++ b/src/glsl/opt_flip_matrices.cpp
@@ -81,8 +81,10 @@ matrix_flipper::visit_enter(ir_expression *ir)
 
    if (mvp_transpose &&
        strcmp(mat_var->name, "gl_ModelViewProjectionMatrix") == 0) {
+#ifndef NDEBUG
       ir_dereference_variable *deref = ir->operands[0]->as_dereference_variable();
       assert(deref && deref->var == mat_var);
+#endif
 
       void *mem_ctx = ralloc_parent(ir);
 
-- 
1.8.3.2



More information about the mesa-dev mailing list