summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortsi <tsi>2003-05-29 15:20:57 +0000
committertsi <tsi>2003-05-29 15:20:57 +0000
commited736a592a8b0eaed59df60b6e44ab6240b5f1ce (patch)
tree5be78e192ed2a642082157e81e6c56f2fc1a55d1
parent02ee7abc6dfc05b3cf76313ad6d881532a6a2a5e (diff)
Additional libm cleanup
-rw-r--r--programs/xlogo/Imakefile4
-rw-r--r--programs/xlogo/RenderLogo.c15
2 files changed, 9 insertions, 10 deletions
diff --git a/programs/xlogo/Imakefile b/programs/xlogo/Imakefile
index beb6e8ced..55d1a761b 100644
--- a/programs/xlogo/Imakefile
+++ b/programs/xlogo/Imakefile
@@ -2,7 +2,7 @@ XCOMM $Xorg: Imakefile,v 1.3 2000/08/17 19:54:52 cpqbld Exp $
-XCOMM $XFree86$
+XCOMM $XFree86: xc/programs/xlogo/Imakefile,v 1.3tsi Exp $
#ifndef XLogoUseRender
#define XLogoUseRender BuildRenderLibrary
@@ -11,7 +11,7 @@ XCOMM $XFree86$
#if XLogoUseRender
XRENDERDEFS = -DXRENDER
XRENDERDEPS = XftClientDepLibs $(DEPXFTLIB) $(DEPXRENDERLIB)
- XRENDERLIBS = XftClientLibs $(XRENDERLIB) -lm
+ XRENDERLIBS = XftClientLibs $(XRENDERLIB)
XRENDERINCS = $(XFTINCLUDES) $(XRENDERINCLUDES)
#endif
diff --git a/programs/xlogo/RenderLogo.c b/programs/xlogo/RenderLogo.c
index 4dd70751b..2075f8581 100644
--- a/programs/xlogo/RenderLogo.c
+++ b/programs/xlogo/RenderLogo.c
@@ -25,10 +25,9 @@ used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group.
*/
-/* $XFree86: xc/programs/xlogo/RenderLogo.c,v 1.2 2002/10/19 19:15:32 herrb Exp $ */
+/* $XFree86: xc/programs/xlogo/RenderLogo.c,v 1.3tsi Exp $ */
#include <stdio.h>
-#include <math.h>
#include <X11/Xlib.h>
#include <X11/extensions/Xrender.h>
@@ -152,12 +151,12 @@ intersect(XLineDouble *l1, XLineDouble *l2, XPointDouble *intersection)
intersection->x = m1 * intersection->y + b1;
check = m2 * intersection->y + b2;
- if (fabs(check - intersection->x) > (1/(double)(1<<16))) {
-#ifdef __GNUC__
- fprintf(stderr, "%s: intersection is off by: %f\n", __FUNCTION__, fabs(check - intersection->x));
-#else
- fprintf(stderr, "intersect: intersection is off by %f\n", fabs(check - intersection->x));
-#endif
+ if (check >= intersection->x)
+ check -= intersection->x;
+ else
+ check = intersection->x - check;
+ if (check > (1/(double)(1<<16))) {
+ fprintf(stderr, "intersect: intersection is off by %f\n", check);
}
}