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

Rhys Kidd rhyskidd at gmail.com
Tue Sep 8 03:13:02 PDT 2015


mesa/src/mesa/drivers/dri/i965/intel_mipmap_tree.c: In function 'intel_gen8_hiz_buf_create':
mesa/src/mesa/drivers/dri/i965/intel_mipmap_tree.c:1638:44: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
    for (int level = mt->first_level; level <= mt->last_level; ++level) {
                                            ^

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

diff --git a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
index cd8ebd3..caf7388 100644
--- a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
+++ b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
@@ -1635,7 +1635,7 @@ intel_gen8_hiz_buf_create(struct brw_context *brw,
    unsigned Z_i = Z0;
    unsigned sum_h_i = 0;
    unsigned hz_height_3d_sum = 0;
-   for (int level = mt->first_level; level <= mt->last_level; ++level) {
+   for (unsigned level = mt->first_level; level <= mt->last_level; ++level) {
       unsigned i = level - mt->first_level;
       unsigned h_i = ALIGN(H_i, vertical_align);
       /* sum(i=2 to m; h_i) */
-- 
2.1.4



More information about the mesa-dev mailing list