[cairo-commit] 2 commits - src/cairo-compiler-private.h src/cairo-matrix.c

Andrea Canciani ranma42 at kemper.freedesktop.org
Sat Mar 19 07:29:34 PDT 2011


 src/cairo-compiler-private.h |   14 --------------
 src/cairo-matrix.c           |    4 ++--
 2 files changed, 2 insertions(+), 16 deletions(-)

New commits:
commit cec4c9c91ae1848c095e9c7ecd8ddcc60cf2810a
Author: Andrea Canciani <ranma42 at gmail.com>
Date:   Sat Mar 19 11:05:21 2011 +0100

    Revert "Add an implementation of fmax for use with MSVC"
    
    This reverts commit de2c5bfa19ce6b3fda50bca3445aabc040947bc9.
    
    fmax() is not used anymore and should not be used in future.

diff --git a/src/cairo-compiler-private.h b/src/cairo-compiler-private.h
index 4349b87..e25ee1f 100644
--- a/src/cairo-compiler-private.h
+++ b/src/cairo-compiler-private.h
@@ -227,20 +227,6 @@ ffs (int x)
     return 0;
 }
 
-#define _USE_MATH_DEFINES
-
-#include <float.h>
-
-static inline double
-fmax (double a, double b)
-{
-    if (_isnan(a))
-        return b;
-    if (_isnan(b))
-        return a;
-    return a > b ? a : b;
-}
-
 #endif
 
 #if defined(_MSC_VER) && defined(_M_IX86)
commit 5339533737f0c3cb02ced551960a34574b7a4e58
Author: Andrea Canciani <ranma42 at gmail.com>
Date:   Sat Mar 19 11:04:08 2011 +0100

    Do not use fmax()
    
    fmin() and fmax() are not available on all the supported
    architectures. MIN() and MAX() should be used in their place.

diff --git a/src/cairo-matrix.c b/src/cairo-matrix.c
index 1a4fe81..195438c 100644
--- a/src/cairo-matrix.c
+++ b/src/cairo-matrix.c
@@ -1132,7 +1132,7 @@ _cairo_matrix_to_pixman_matrix_offset (const cairo_matrix_t	*matrix,
 	     */
 	    tx = m.x0;
 	    ty = m.y0;
-	    norm = fmax (fabs (tx), fabs (ty));
+	    norm = MAX (fabs (tx), fabs (ty));
 
 	    for (i = -1; i < 2; i+=2) {
 		for (j = -1; j < 2; j+=2) {
@@ -1149,7 +1149,7 @@ _cairo_matrix_to_pixman_matrix_offset (const cairo_matrix_t	*matrix,
 		    x *= den;
 		    y *= den;
 
-		    new_norm = fmax (fabs (x), fabs (y));
+		    new_norm = MAX (fabs (x), fabs (y));
 		    if (norm > new_norm) {
 			norm = new_norm;
 			tx = x;


More information about the cairo-commit mailing list