summaryrefslogtreecommitdiffstats
path: root/lib/libm/src
diff options
context:
space:
mode:
authormiod <miod@openbsd.org>2015-01-22 21:18:56 +0000
committermiod <miod@openbsd.org>2015-01-22 21:18:56 +0000
commitd9116cffd3a4534d1a40ab1247a38f4ae56d5939 (patch)
tree2ce600302153f9411a53993b4f7aa5686515b4a8 /lib/libm/src
parentPossibly uninitialized variable. From Clang via dhill. (diff)
downloadwireguard-openbsd-d9116cffd3a4534d1a40ab1247a38f4ae56d5939.tar.xz
wireguard-openbsd-d9116cffd3a4534d1a40ab1247a38f4ae56d5939.zip
Fix logic botch causing warnings with Clang. Reported by dhill, matches
similar changes in FreeBSD a few years ago.
Diffstat (limited to 'lib/libm/src')
-rw-r--r--lib/libm/src/e_asin.c12
-rw-r--r--lib/libm/src/e_asinf.c12
2 files changed, 12 insertions, 12 deletions
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);