[cairo-commit] test/pdiff

Behdad Esfahbod behdad at kemper.freedesktop.org
Sat Dec 16 15:16:51 PST 2006


 test/pdiff/pdiff.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletion(-)

New commits:
diff-tree 8f2ad0affd4fe4821992e87487bc2737e9c538e5 (from be6edd64a3f45f7fb33f7d57b71b1ef467b474e1)
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Sat Dec 16 18:16:46 2006 -0500

    [pdiff] Fix compiler warnings, that were causing crashes

diff --git a/test/pdiff/pdiff.c b/test/pdiff/pdiff.c
index 1b73e79..b117d79 100644
--- a/test/pdiff/pdiff.c
+++ b/test/pdiff/pdiff.c
@@ -196,6 +196,8 @@ xmalloc (size_t size)
 	fprintf (stderr, "Out of memory.\n");
 	exit (1);
     }
+
+    return buf;
 }
 
 int
@@ -288,6 +290,7 @@ pdiff_compare (cairo_surface_t *surface_
 	    float F_mask[MAX_PYR_LEVELS - 2];
 	    float factor;
 	    float delta;
+	    float adapt;
 	    bool pass;
 	    float sum_contrast = 0;
 	    for (i = 0; i < MAX_PYR_LEVELS - 2; i++) {
@@ -302,7 +305,7 @@ pdiff_compare (cairo_surface_t *surface_
 		sum_contrast += contrast[i];
 	    }
 	    if (sum_contrast < 1e-5) sum_contrast = 1e-5f;
-	    float adapt = lpyramid_get_value(la,x,y,adaptation_level) + lpyramid_get_value(lb,x,y,adaptation_level);
+	    adapt = lpyramid_get_value(la,x,y,adaptation_level) + lpyramid_get_value(lb,x,y,adaptation_level);
 	    adapt *= 0.5f;
 	    if (adapt < 1e-5) adapt = 1e-5f;
 	    for (i = 0; i < MAX_PYR_LEVELS - 2; i++) {


More information about the cairo-commit mailing list