Mesa (lp-binning): llvmpipe: area is an int here, not float

Brian Paul brianp at kemper.freedesktop.org
Fri Jan 22 02:10:47 UTC 2010


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

Author: Brian Paul <brianp at vmware.com>
Date:   Thu Jan 21 17:31:43 2010 -0700

llvmpipe: area is an int here, not float

---

 src/gallium/drivers/llvmpipe/lp_setup_tri.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/gallium/drivers/llvmpipe/lp_setup_tri.c b/src/gallium/drivers/llvmpipe/lp_setup_tri.c
index dcd849b..b637c35 100644
--- a/src/gallium/drivers/llvmpipe/lp_setup_tri.c
+++ b/src/gallium/drivers/llvmpipe/lp_setup_tri.c
@@ -265,7 +265,8 @@ do_triangle_ccw(struct setup_context *setup,
 
    struct lp_scene *scene = lp_setup_get_current_scene(setup);
    struct lp_rast_triangle *tri = lp_scene_alloc_aligned( scene, sizeof *tri, 16 );
-   float area, oneoverarea;
+   int area;
+   float oneoverarea;
    int minx, maxx, miny, maxy;
 
    tri->dx12 = x1 - x2;
@@ -276,8 +277,7 @@ do_triangle_ccw(struct setup_context *setup,
    tri->dy23 = y2 - y3;
    tri->dy31 = y3 - y1;
 
-   area = (tri->dx12 * tri->dy31 - 
-	   tri->dx31 * tri->dy12);
+   area = (tri->dx12 * tri->dy31 - tri->dx31 * tri->dy12);
 
    LP_COUNT(nr_tris);
 
@@ -285,7 +285,7 @@ do_triangle_ccw(struct setup_context *setup,
     *
     * XXX: subject to overflow??
     */
-   if (area <= 0.0f) {
+   if (area <= 0) {
       lp_scene_putback_data( scene, sizeof *tri );
       LP_COUNT(nr_culled_tris);
       return;




More information about the mesa-commit mailing list