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

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


mesa/src/mesa/drivers/dri/i965/brw_eu_compact.c: In function 'set_3src_control_index':
mesa/src/mesa/drivers/dri/i965/brw_eu_compact.c:805:22: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
    for (int i = 0; i < ARRAY_SIZE(gen8_3src_control_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 67f0b45..ea1ae25 100644
--- a/src/mesa/drivers/dri/i965/brw_eu_compact.c
+++ b/src/mesa/drivers/dri/i965/brw_eu_compact.c
@@ -802,7 +802,7 @@ set_3src_control_index(const struct brw_device_info *devinfo,
    if (devinfo->gen >= 9 || devinfo->is_cherryview)
       uncompacted |= brw_inst_bits(src, 36, 35) << 24; /* 2b */
 
-   for (int i = 0; i < ARRAY_SIZE(gen8_3src_control_index_table); i++) {
+   for (unsigned i = 0; i < ARRAY_SIZE(gen8_3src_control_index_table); i++) {
       if (gen8_3src_control_index_table[i] == uncompacted) {
          brw_compact_inst_set_3src_control_index(dst, i);
 	 return true;
-- 
2.1.4



More information about the mesa-dev mailing list