Mesa (master): intel: Fix signed/unsigned comparison warnings.

Eric Anholt anholt at kemper.freedesktop.org
Tue May 15 00:01:36 UTC 2012


Module: Mesa
Branch: master
Commit: 1e188f2daef1ae31224d2429bcc1fab75c81fb36
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=1e188f2daef1ae31224d2429bcc1fab75c81fb36

Author: Eric Anholt <eric at anholt.net>
Date:   Thu May 10 08:50:14 2012 -0700

intel: Fix signed/unsigned comparison warnings.

---

 src/mesa/drivers/dri/i965/brw_fs_visitor.cpp       |    5 +++--
 .../drivers/dri/i965/brw_vec4_reg_allocate.cpp     |    6 +++---
 2 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp b/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp
index bb0c8bd..cba0165 100644
--- a/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp
@@ -74,7 +74,7 @@ fs_visitor::visit(ir_variable *ir)
 
       if (ir->location == FRAG_RESULT_COLOR) {
 	 /* Writing gl_FragColor outputs to all color regions. */
-	 for (int i = 0; i < MAX2(c->key.nr_color_regions, 1); i++) {
+	 for (unsigned int i = 0; i < MAX2(c->key.nr_color_regions, 1); i++) {
 	    this->outputs[i] = *reg;
 	 }
       } else if (ir->location == FRAG_RESULT_DEPTH) {
@@ -1256,7 +1256,8 @@ fs_visitor::visit(ir_texture *ir)
    }
 
    if (ir->coordinate && needs_gl_clamp) {
-      for (int i = 0; i < MIN2(ir->coordinate->type->vector_elements, 3); i++) {
+      for (unsigned int i = 0;
+	   i < MIN2(ir->coordinate->type->vector_elements, 3); i++) {
 	 if (c->key.tex.gl_clamp_mask[i] & (1 << sampler)) {
 	    fs_reg chan = coordinate;
 	    chan.reg_offset += i;
diff --git a/src/mesa/drivers/dri/i965/brw_vec4_reg_allocate.cpp b/src/mesa/drivers/dri/i965/brw_vec4_reg_allocate.cpp
index 57b0519..2d9d0c8 100644
--- a/src/mesa/drivers/dri/i965/brw_vec4_reg_allocate.cpp
+++ b/src/mesa/drivers/dri/i965/brw_vec4_reg_allocate.cpp
@@ -34,7 +34,7 @@ using namespace brw;
 namespace brw {
 
 static void
-assign(int *reg_hw_locations, reg *reg)
+assign(unsigned int *reg_hw_locations, reg *reg)
 {
    if (reg->file == GRF) {
       reg->reg = reg_hw_locations[reg->reg];
@@ -44,7 +44,7 @@ assign(int *reg_hw_locations, reg *reg)
 void
 vec4_visitor::reg_allocate_trivial()
 {
-   int hw_reg_mapping[this->virtual_grf_count];
+   unsigned int hw_reg_mapping[this->virtual_grf_count];
    bool virtual_grf_used[this->virtual_grf_count];
    int i;
    int next;
@@ -142,7 +142,7 @@ brw_alloc_reg_set_for_classes(struct brw_context *brw,
 void
 vec4_visitor::reg_allocate()
 {
-   int hw_reg_mapping[virtual_grf_count];
+   unsigned int hw_reg_mapping[virtual_grf_count];
    int first_assigned_grf = this->first_non_payload_grf;
    int base_reg_count = max_grf - first_assigned_grf;
    int class_sizes[base_reg_count];




More information about the mesa-commit mailing list