[Mesa-dev] [PATCH 2/3] mesa/st: Fix compiler warnings

Jan Vesely jan.vesely at rutgers.edu
Fri Jul 25 07:33:43 PDT 2014


both array and index are unsigned types

Signed-off-by: Jan Vesely <jan.vesely at rutgers.edu>
---
 src/mesa/state_tracker/st_glsl_to_tgsi.cpp | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
index 5ea1465..34780bd 100644
--- a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
+++ b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
@@ -4321,9 +4321,8 @@ dst_register(struct st_translate *t,
       return ureg_dst_undef();
 
    case PROGRAM_TEMPORARY:
-      assert(index >= 0);
-      assert(index < (int) Elements(t->temps));
- 
+      assert(index < Elements(t->temps));
+
       if (ureg_dst_is_undef(t->temps[index]))
          t->temps[index] = ureg_DECL_local_temporary(t->ureg);
 
@@ -4332,8 +4331,7 @@ dst_register(struct st_translate *t,
    case PROGRAM_ARRAY:
       array = index >> 16;
 
-      assert(array >= 0);
-      assert(array < (int) Elements(t->arrays));
+      assert(array < Elements(t->arrays));
 
       if (ureg_dst_is_undef(t->arrays[array]))
          t->arrays[array] = ureg_DECL_array_temporary(
-- 
1.9.3



More information about the mesa-dev mailing list