[Mesa-dev] [PATCH 01/15] glsl: Resolve GCC sign-compare warning.

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


mesa/src/glsl/nir/nir_lower_tex_projector.c: In function 'nir_lower_tex_projector_block':
mesa/src/glsl/nir/nir_lower_tex_projector.c:63:25: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
       for (int i = 0; i < tex->num_srcs; i++) {
                         ^

Signed-off-by: Rhys Kidd <rhyskidd at gmail.com>
---
 src/glsl/nir/nir_lower_tex_projector.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/glsl/nir/nir_lower_tex_projector.c b/src/glsl/nir/nir_lower_tex_projector.c
index 8a482b1..19f1bbd 100644
--- a/src/glsl/nir/nir_lower_tex_projector.c
+++ b/src/glsl/nir/nir_lower_tex_projector.c
@@ -60,7 +60,7 @@ nir_lower_tex_projector_block(nir_block *block, void *void_state)
          nir_frcp(b, nir_ssa_for_src(b, tex->src[proj_index].src, 1));
 
       /* Walk through the sources projecting the arguments. */
-      for (int i = 0; i < tex->num_srcs; i++) {
+      for (unsigned i = 0; i < tex->num_srcs; i++) {
          switch (tex->src[i].src_type) {
          case nir_tex_src_coord:
          case nir_tex_src_comparitor:
-- 
2.1.4



More information about the mesa-dev mailing list