diff options
author | Matt Turner <mattst88@gmail.com> | 2011-04-27 18:25:27 -0400 |
---|---|---|
committer | Matt Turner <mattst88@gmail.com> | 2011-09-21 17:12:04 -0400 |
commit | 9eab5b3443a1926a29385948acc6c5e0843465ea (patch) | |
tree | 893095ecd7e714f75b8b6fe146f8cfe0ce84ebe9 | |
parent | 40a47bd628f525d2d8bd3ca76554089a6e9d2a1d (diff) |
Replace Fabs() macro with fabs() function
gcc generates better code with fabs() anyway.
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
Tested-by: Jeremy Huddleston <jeremyhu@apple.com>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Signed-off-by: Matt Turner <mattst88@gmail.com>
-rw-r--r-- | include/misc.h | 3 | ||||
-rw-r--r-- | mi/miarc.c | 2 | ||||
-rw-r--r-- | mi/mifpoly.h | 6 | ||||
-rw-r--r-- | mi/miwideline.c | 2 |
4 files changed, 5 insertions, 8 deletions
diff --git a/include/misc.h b/include/misc.h index bdcc8cc1e..48492573e 100644 --- a/include/misc.h +++ b/include/misc.h @@ -139,9 +139,6 @@ typedef struct _xReq *xReqPtr; * it in case we haven't done that yet. */ #include <stdlib.h> -#ifndef Fabs -#define Fabs(a) ((a) > 0.0 ? (a) : -(a)) /* floating absolute value */ -#endif #define sign(x) ((x) < 0 ? -1 : ((x) > 0 ? 1 : 0)) /* this assumes b > 0 */ #define modulus(a, b, d) if (((d) = (a) % (b)) < 0) (d) += (b) diff --git a/mi/miarc.c b/mi/miarc.c index 881e0db03..cd870fa39 100644 --- a/mi/miarc.c +++ b/mi/miarc.c @@ -1487,7 +1487,7 @@ miDatan2 (double dy, double dx) if (dy > 0) return 90.0; return -90.0; - } else if (Fabs (dy) == Fabs (dx)) { + } else if (fabs (dy) == fabs (dx)) { if (dy > 0) { if (dx > 0) return 45.0; diff --git a/mi/mifpoly.h b/mi/mifpoly.h index ffd19a341..cc779c946 100644 --- a/mi/mifpoly.h +++ b/mi/mifpoly.h @@ -51,12 +51,12 @@ SOFTWARE. #include <X11/Xfuncproto.h> #define EPSILON 0.000001 -#define ISEQUAL(a,b) (Fabs((a) - (b)) <= EPSILON) -#define UNEQUAL(a,b) (Fabs((a) - (b)) > EPSILON) +#define ISEQUAL(a,b) (fabs((a) - (b)) <= EPSILON) +#define UNEQUAL(a,b) (fabs((a) - (b)) > EPSILON) #define WITHINHALF(a, b) (((a) - (b) > 0.0) ? (a) - (b) < 0.5 : \ (b) - (a) <= 0.5) #define ROUNDTOINT(x) ((int) (((x) > 0.0) ? ((x) + 0.5) : ((x) - 0.5))) -#define ISZERO(x) (Fabs((x)) <= EPSILON) +#define ISZERO(x) (fabs((x)) <= EPSILON) #define PTISEQUAL(a,b) (ISEQUAL(a.x,b.x) && ISEQUAL(a.y,b.y)) #define PTUNEQUAL(a,b) (UNEQUAL(a.x,b.x) || UNEQUAL(a.y,b.y)) #define PtEqual(a, b) (((a).x == (b).x) && ((a).y == (b).y)) diff --git a/mi/miwideline.c b/mi/miwideline.c index bc5ee74c2..057339dbe 100644 --- a/mi/miwideline.c +++ b/mi/miwideline.c @@ -322,7 +322,7 @@ miPolyBuildEdge ( { double realk, kerror; realk = x0 * dy - y0 * dx; - kerror = Fabs (realk - k); + kerror = fabs (realk - k); if (kerror > .1) printf ("realk: %g k: %g\n", realk, k); } |