intel/compiler: fix -Wsign-compare warning
authorCaio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Mon, 16 Jul 2018 20:32:36 +0000 (13:32 -0700)
committerCaio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Wed, 18 Jul 2018 15:29:51 +0000 (08:29 -0700)
Explicitly convert to signed integer. Conversion is valid since is the
same (implicitly) used to initialize the loop. Avoids the warning:

../../src/intel/compiler/brw_fs.cpp: In member function ‘bool fs_visitor::lower_simd_width()’:
../../src/intel/compiler/brw_fs.cpp:5761:45: warning: comparison of integer expressions of different signedness: ‘int’ and ‘unsigned int’ [-Wsign-compare]
             split_inst.eot = inst->eot && i == n - 1;
                                           ~~^~~~~~~~

Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
src/intel/compiler/brw_fs.cpp

index 8c8dfb706def3b72ca8e07a04439296e0a8f934b..7ddbd285fe29f4f6617ef6ebe1722b3d02e881db 100644 (file)
@@ -5758,7 +5758,7 @@ fs_visitor::lower_simd_width()
              */
             fs_inst split_inst = *inst;
             split_inst.exec_size = lower_width;
-            split_inst.eot = inst->eot && i == n - 1;
+            split_inst.eot = inst->eot && i == int(n - 1);
 
             /* Select the correct channel enables for the i-th group, then
              * transform the sources and destination and emit the lowered