From: miod Date: Thu, 22 Jan 2015 21:18:56 +0000 (+0000) Subject: Fix logic botch causing warnings with Clang. Reported by dhill, matches X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=d9116cffd3a4534d1a40ab1247a38f4ae56d5939;p=openbsd Fix logic botch causing warnings with Clang. Reported by dhill, matches similar changes in FreeBSD a few years ago. --- diff --git a/lib/libm/src/e_asin.c b/lib/libm/src/e_asin.c index db114c2c919..226addc9749 100644 --- a/lib/libm/src/e_asin.c +++ b/lib/libm/src/e_asin.c @@ -80,12 +80,12 @@ asin(double x) } else if (ix<0x3fe00000) { /* |x|<0.5 */ if(ix<0x3e400000) { /* if |x| < 2**-27 */ if(huge+x>one) return x;/* return x with inexact if x!=0*/ - } else - t = x*x; - p = t*(pS0+t*(pS1+t*(pS2+t*(pS3+t*(pS4+t*pS5))))); - q = one+t*(qS1+t*(qS2+t*(qS3+t*qS4))); - w = p/q; - return x+x*w; + } + t = x*x; + p = t*(pS0+t*(pS1+t*(pS2+t*(pS3+t*(pS4+t*pS5))))); + q = one+t*(qS1+t*(qS2+t*(qS3+t*qS4))); + w = p/q; + return x+x*w; } /* 1> |x|>= 0.5 */ w = one-fabs(x); diff --git a/lib/libm/src/e_asinf.c b/lib/libm/src/e_asinf.c index 5df02a8a672..05b32927183 100644 --- a/lib/libm/src/e_asinf.c +++ b/lib/libm/src/e_asinf.c @@ -49,12 +49,12 @@ asinf(float x) } else if (ix<0x3f000000) { /* |x|<0.5 */ if(ix<0x32000000) { /* if |x| < 2**-27 */ if(huge+x>one) return x;/* return x with inexact if x!=0*/ - } else - t = x*x; - p = t*(pS0+t*(pS1+t*(pS2+t*(pS3+t*(pS4+t*pS5))))); - q = one+t*(qS1+t*(qS2+t*(qS3+t*qS4))); - w = p/q; - return x+x*w; + } + t = x*x; + p = t*(pS0+t*(pS1+t*(pS2+t*(pS3+t*(pS4+t*pS5))))); + q = one+t*(qS1+t*(qS2+t*(qS3+t*qS4))); + w = p/q; + return x+x*w; } /* 1> |x|>= 0.5 */ w = one-fabsf(x);