[cairo-commit] test/pixman-downscale.c

Chris Wilson ickle at kemper.freedesktop.org
Tue Sep 17 00:53:02 PDT 2013


 test/pixman-downscale.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 0ac81988c199df1a6652dc0ea72627122bf95c6c
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Tue Sep 17 08:32:29 2013 +0100

    test/pixman-downscale: Open-code fmin()
    
    fmin() requires a bump to either _XOPEN_SOURCE_ >= 600 (POSIX 2004) or
    c99 - which is a needless dependency for a single simple routine.
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/test/pixman-downscale.c b/test/pixman-downscale.c
index 621a5b9..60e9618 100644
--- a/test/pixman-downscale.c
+++ b/test/pixman-downscale.c
@@ -51,7 +51,7 @@ draw (cairo_t *cr, int width, int height, cairo_filter_t filter)
     image = cairo_test_create_surface_from_png (ctx, png_filename);
     x_scale = width * 1.0 / cairo_image_surface_get_width (image);
     y_scale = height * 1.0 / cairo_image_surface_get_height (image);
-    scale = fmin(x_scale, y_scale);
+    scale = x_scale < y_scale ? x_scale : y_scale;
 
     cairo_save (cr);
     cairo_scale (cr, scale, scale);


More information about the cairo-commit mailing list