Mesa (lp-binning): llvmpipe: make nr_blocks unsigned

Brian Paul brianp at kemper.freedesktop.org
Wed Dec 2 14:16:08 PST 2009


Module: Mesa
Branch: lp-binning
Commit: 938acf0367416c989d49f231da855ba6ea8d64ca
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=938acf0367416c989d49f231da855ba6ea8d64ca

Author: Brian Paul <brianp at vmware.com>
Date:   Tue Dec  1 16:00:04 2009 -0700

llvmpipe: make nr_blocks unsigned

---

 src/gallium/drivers/llvmpipe/lp_rast_priv.h |    2 +-
 src/gallium/drivers/llvmpipe/lp_rast_tri.c  |    7 ++++---
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/src/gallium/drivers/llvmpipe/lp_rast_priv.h b/src/gallium/drivers/llvmpipe/lp_rast_priv.h
index 323c046..723bb5a 100644
--- a/src/gallium/drivers/llvmpipe/lp_rast_priv.h
+++ b/src/gallium/drivers/llvmpipe/lp_rast_priv.h
@@ -75,7 +75,7 @@ struct lp_rasterizer {
       char clear_stencil;
    } state;
 
-   int nr_blocks;
+   unsigned nr_blocks;
    struct {
       unsigned x;
       unsigned y;
diff --git a/src/gallium/drivers/llvmpipe/lp_rast_tri.c b/src/gallium/drivers/llvmpipe/lp_rast_tri.c
index 428870b..07b0ecc 100644
--- a/src/gallium/drivers/llvmpipe/lp_rast_tri.c
+++ b/src/gallium/drivers/llvmpipe/lp_rast_tri.c
@@ -44,7 +44,7 @@
 static void
 block_full_4( struct lp_rasterizer *rast, int x, int y )
 {
-   int i = rast->nr_blocks;
+   const unsigned i = rast->nr_blocks;
    assert(x % 4 == 0);
    assert(y % 4 == 0);
    rast->blocks[i].x = x;
@@ -97,7 +97,7 @@ do_block_4( struct lp_rasterizer *rast,
    /* As we do trivial reject already, masks should rarely be all zero:
     */
    if (mask) {
-      int i = rast->nr_blocks;
+      const unsigned i = rast->nr_blocks;
       rast->blocks[i].x = x;
       rast->blocks[i].y = y;
       rast->blocks[i].mask = mask;
@@ -169,7 +169,8 @@ lp_rast_triangle( struct lp_rasterizer *rast,
 
    int x = rast->x;
    int y = rast->y;
-   int ix, iy, i = 0;
+   int ix, iy;
+   unsigned i = 0;
 
    int c1 = tri->c1 + tri->dx12 * y - tri->dy12 * x;
    int c2 = tri->c2 + tri->dx23 * y - tri->dy23 * x;



More information about the mesa-commit mailing list