From 6f22e2e2a56761d4c42e81bc939c808486ab78f1 Mon Sep 17 00:00:00 2001 From: John Ellson Date: Fri, 15 Nov 2013 13:03:48 -0500 Subject: [PATCH] eliminate need for unsafe zdiv function --- lib/common/taper.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/lib/common/taper.c b/lib/common/taper.c index 01dff4ddc..af7e11ccf 100644 --- a/lib/common/taper.c +++ b/lib/common/taper.c @@ -113,15 +113,6 @@ static double mymod (double original, double modulus) return original; } -/* - * allow division by zero - */ -static double zdiv (double num, double denom) -{ - if (denom == 0) return 0; - else return (num/denom); -} - typedef struct { double x; double y; @@ -352,7 +343,7 @@ stroke_t* taper (bezier* bez, radfunc_t radfunc, double initwid, int linejoin, i } /* direction to junction point */ direction = ndir+D2R(90)+phi; - if ((0 != linejoin) || (zdiv(lineout,linerad) > currentmiterlimit)) { + if ((0 != linejoin) || (lineout > currentmiterlimit * linrad)) { bevel = TRUE; lineout = linerad; direction = mymod(ldir-D2R(90),D2R(360)); -- 2.40.0