On 06/24/2013 01:22 PM, Ian Romanick wrote:
On 06/22/2013 08:43 AM, Emil Velikov wrote:
Resolves the following gcc warning

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

Signed-off-by: Emil Velikov <emil.l.veli...@gmail.com>
---
  src/glsl/opt_flip_matrices.cpp | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/glsl/opt_flip_matrices.cpp
b/src/glsl/opt_flip_matrices.cpp
index 497513f..be3ccf8 100644
--- a/src/glsl/opt_flip_matrices.cpp
+++ b/src/glsl/opt_flip_matrices.cpp
@@ -81,8 +81,8 @@ matrix_flipper::visit_enter(ir_expression *ir)

     if (mvp_transpose &&
         strcmp(mat_var->name, "gl_ModelViewProjectionMatrix") == 0) {
-      ir_dereference_variable *deref =
ir->operands[0]->as_dereference_variable();
-      assert(deref && deref->var == mat_var);
+      assert(ir->operands[0]->as_dereference_variable() &&
+             ir->operands[0]->as_dereference_variable()->var ==
mat_var);

Rather than dipping into as_dereference_variable() twice, I'd surround
both lines with a '#ifndef NDEBUG' block.

Or just (void) deref;

I don't have a preference...either of those three approaches would get:
Reviewed-by: Kenneth Graunke <kenn...@whitecape.org>

_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to