Module: Mesa
Branch: master
Commit: 81ed629b385af62bbac2d7975986ea7ad4ed2d1a
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=81ed629b385af62bbac2d7975986ea7ad4ed2d1a

Author: Ian Romanick <ian.d.roman...@intel.com>
Date:   Thu Mar 29 11:29:09 2018 -0700

intel/compiler: Explicitly cast register type in switch

brw_reg::type is "enum brw_reg_type type:4".  For whatever reason, GCC
is treating this as an int instead of an enum.  As a result, it doesn't
detect missing switch cases and it doesn't detect that flow can get out
of the switch.

This silences the warning:

src/intel/compiler/brw_reg.h: In function ‘bool brw_regs_negative_equal(const 
brw_reg*, const brw_reg*)’:
src/intel/compiler/brw_reg.h:305:1: warning: control reaches end of non-void 
function [-Wreturn-type]
 }
 ^

Signed-off-by: Ian Romanick <ian.d.roman...@intel.com>
Reviewed-by: Matt Turner <matts...@gmail.com>
Reviewed-by: Brian Paul <bri...@vmware.com>

---

 src/intel/compiler/brw_reg.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/intel/compiler/brw_reg.h b/src/intel/compiler/brw_reg.h
index afcd146de2..dff9b970b2 100644
--- a/src/intel/compiler/brw_reg.h
+++ b/src/intel/compiler/brw_reg.h
@@ -262,7 +262,7 @@ brw_regs_negative_equal(const struct brw_reg *a, const 
struct brw_reg *b)
       if (a->bits != b->bits)
          return false;
 
-      switch (a->type) {
+      switch ((enum brw_reg_type) a->type) {
       case BRW_REGISTER_TYPE_UQ:
       case BRW_REGISTER_TYPE_Q:
          return a->d64 == -b->d64;

_______________________________________________
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to