glsl: Fix tautological comparison.
authorMatt Turner <mattst88@gmail.com>
Fri, 21 Nov 2014 22:53:20 +0000 (14:53 -0800)
committerMatt Turner <mattst88@gmail.com>
Mon, 24 Nov 2014 22:09:23 +0000 (14:09 -0800)
Caught by clang.

warning: comparison of constant -1 with expression of type
         'ir_texture_opcode' is always false
      [-Wtautological-constant-out-of-range-compare]
      if (op == -1)
          ~~ ^  ~~

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/glsl/ir_reader.cpp

index ae00e793496c5cbc1c90fcaedfdcdad0e632e246..fd318c046e200436ea32d1d799004a8bca048900 100644 (file)
@@ -972,7 +972,7 @@ ir_reader::read_texture(s_expression *expr)
       op = ir_query_levels;
    } else if (MATCH(expr, other_pattern)) {
       op = ir_texture::get_opcode(tag->value());
-      if (op == -1)
+      if (op == (ir_texture_opcode) -1)
         return NULL;
    } else {
       ir_read_error(NULL, "unexpected texture pattern %s", tag->value());