intel/compiler: Cast reg types explicitly
authorTopi Pohjolainen <topi.pohjolainen@intel.com>
Fri, 25 Aug 2017 18:32:27 +0000 (21:32 +0300)
committerTopi Pohjolainen <topi.pohjolainen@intel.com>
Mon, 28 Aug 2017 11:43:39 +0000 (14:43 +0300)
Makes coverity happier.

CID: 1416799
Fixes: c1ac1a3d25 (i965: Add a brw_hw_type_to_reg_type() function)
Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
src/intel/compiler/brw_reg_type.c

index a0f674f0d74569f032aa41571ae5978d1506b615..98c4cf72345b477aaaa1d60cceca75bdb94718ac 100644 (file)
@@ -111,13 +111,13 @@ brw_hw_type_to_reg_type(const struct gen_device_info *devinfo,
 {
    if (file == BRW_IMMEDIATE_VALUE) {
       for (enum brw_reg_type i = 0; i <= BRW_REGISTER_TYPE_LAST; i++) {
-         if (gen4_hw_type[i].imm_type == hw_type) {
+         if (gen4_hw_type[i].imm_type == (enum hw_imm_type)hw_type) {
             return i;
          }
       }
    } else {
       for (enum brw_reg_type i = 0; i <= BRW_REGISTER_TYPE_LAST; i++) {
-         if (gen4_hw_type[i].reg_type == hw_type) {
+         if (gen4_hw_type[i].reg_type == (enum hw_reg_type)hw_type) {
             return i;
          }
       }