[Mesa-dev] [PATCH 09/15] i965: Resolve GCC sign-compare warning.

Rhys Kidd rhyskidd at gmail.com
Tue Sep 8 03:12:58 PDT 2015


mesa/src/mesa/drivers/dri/i965/brw_eu_compact.c: In function 'set_3src_source_index':
mesa/src/mesa/drivers/dri/i965/brw_eu_compact.c:839:22: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
    for (int i = 0; i < ARRAY_SIZE(gen8_3src_source_index_table); i++) {
                      ^

Signed-off-by: Rhys Kidd <rhyskidd at gmail.com>
---
 src/mesa/drivers/dri/i965/brw_eu_compact.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/mesa/drivers/dri/i965/brw_eu_compact.c b/src/mesa/drivers/dri/i965/brw_eu_compact.c
index ea1ae25..b798931 100644
--- a/src/mesa/drivers/dri/i965/brw_eu_compact.c
+++ b/src/mesa/drivers/dri/i965/brw_eu_compact.c
@@ -836,7 +836,7 @@ set_3src_source_index(const struct brw_device_info *devinfo,
          (brw_inst_bits(src, 104, 104) << 44);  /* 1b */
    }
 
-   for (int i = 0; i < ARRAY_SIZE(gen8_3src_source_index_table); i++) {
+   for (unsigned i = 0; i < ARRAY_SIZE(gen8_3src_source_index_table); i++) {
       if (gen8_3src_source_index_table[i] == uncompacted) {
          brw_compact_inst_set_3src_source_index(dst, i);
 	 return true;
-- 
2.1.4



More information about the mesa-dev mailing list