address compiler warnings in #3

This commit is contained in:
Keno Fischer 2012-05-24 23:45:05 -04:00
parent f0862df1db
commit 04e12006e5
18 changed files with 29 additions and 57 deletions

View file

@ -71,7 +71,7 @@ __ieee754_atan2(double y, double x)
if(((ix|((lx|-lx)>>31))>0x7ff00000)|| if(((ix|((lx|-lx)>>31))>0x7ff00000)||
((iy|((ly|-ly)>>31))>0x7ff00000)) /* x or y is NaN */ ((iy|((ly|-ly)>>31))>0x7ff00000)) /* x or y is NaN */
return x+y; return x+y;
if((hx-0x3ff00000|lx)==0) return atan(y); /* x=1.0 */ if(((hx-0x3ff00000)|lx)==0) return atan(y); /* x=1.0 */
m = ((hy>>31)&1)|((hx>>30)&2); /* 2*sign(x)+sign(y) */ m = ((hy>>31)&1)|((hx>>30)&2); /* 2*sign(x)+sign(y) */
/* when y = 0 */ /* when y = 0 */

View file

@ -13,10 +13,6 @@
* ==================================================== * ====================================================
*/ */
#ifndef lint
static char rcsid[] = "$FreeBSD: src/lib/msun/src/e_sqrtf.c,v 1.7 2002/05/28 18:15:04 alfred Exp $";
#endif
#include "openlibm.h" #include "openlibm.h"
#include "math_private.h" #include "math_private.h"

View file

@ -65,7 +65,9 @@ dec(long double x)
return (u.e); return (u.e);
} }
#ifndef __GNUC__
#pragma STDC FENV_ACCESS ON #pragma STDC FENV_ACCESS ON
#endif
/* /*
* This is slow, but simple and portable. You should use hardware sqrt * This is slow, but simple and portable. You should use hardware sqrt

View file

@ -40,7 +40,9 @@
* gcc generates is acceptable, since the special cases have already been * gcc generates is acceptable, since the special cases have already been
* handled. * handled.
*/ */
#ifndef __GNUC__
#pragma STDC CX_LIMITED_RANGE ON #pragma STDC CX_LIMITED_RANGE ON
#endif
/* We risk spurious overflow for components >= DBL_MAX / (1 + sqrt(2)). */ /* We risk spurious overflow for components >= DBL_MAX / (1 + sqrt(2)). */
#define THRESH 0x1.a827999fcef32p+1022 #define THRESH 0x1.a827999fcef32p+1022

View file

@ -39,7 +39,9 @@
* gcc generates is acceptable, since the special cases have already been * gcc generates is acceptable, since the special cases have already been
* handled. * handled.
*/ */
#ifndef __GNUC__
#pragma STDC CX_LIMITED_RANGE ON #pragma STDC CX_LIMITED_RANGE ON
#endif
float complex float complex
csqrtf(float complex z) csqrtf(float complex z)

View file

@ -25,7 +25,6 @@
*/ */
#include "cdefs-compat.h" #include "cdefs-compat.h"
//__FBSDID("$FreeBSD: src/lib/msun/src/s_csqrtl.c,v 1.2 2008/08/08 00:15:16 das Exp $");
#include <complex.h> #include <complex.h>
#include <float.h> #include <float.h>
@ -40,7 +39,9 @@
* gcc generates is acceptable, since the special cases have already been * gcc generates is acceptable, since the special cases have already been
* handled. * handled.
*/ */
#ifndef __GNUC__
#pragma STDC CX_LIMITED_RANGE ON #pragma STDC CX_LIMITED_RANGE ON
#endif
/* We risk spurious overflow for components >= LDBL_MAX / (1 + sqrt(2)). */ /* We risk spurious overflow for components >= LDBL_MAX / (1 + sqrt(2)). */
#define THRESH (LDBL_MAX / 2.414213562373095048801688724209698L) #define THRESH (LDBL_MAX / 2.414213562373095048801688724209698L)

View file

@ -10,10 +10,6 @@
* ==================================================== * ====================================================
*/ */
#ifndef lint
static char rcsid[] = "$FreeBSD: src/lib/msun/src/s_fabs.c,v 1.7 2002/05/28 18:15:04 alfred Exp $";
#endif
/* /*
* fabs(x) returns the absolute value of x. * fabs(x) returns the absolute value of x.
*/ */

View file

@ -117,7 +117,7 @@ add_and_denormalize(double a, double b, int scale)
if (sum.lo != 0) { if (sum.lo != 0) {
EXTRACT_WORD64(hibits, sum.hi); EXTRACT_WORD64(hibits, sum.hi);
bits_lost = -((int)(hibits >> 52) & 0x7ff) - scale + 1; bits_lost = -((int)(hibits >> 52) & 0x7ff) - scale + 1;
if (bits_lost != 1 ^ (int)(hibits & 1)) { if ((bits_lost != 1) ^ (int)(hibits & 1)) {
/* hibits += (int)copysign(1.0, sum.hi * sum.lo) */ /* hibits += (int)copysign(1.0, sum.hi * sum.lo) */
EXTRACT_WORD64(lobits, sum.lo); EXTRACT_WORD64(lobits, sum.lo);
hibits += 1 - (((hibits ^ lobits) >> 62) & 2); hibits += 1 - (((hibits ^ lobits) >> 62) & 2);
@ -216,17 +216,17 @@ fma(double x, double y, double z)
case FE_TONEAREST: case FE_TONEAREST:
return (z); return (z);
case FE_TOWARDZERO: case FE_TOWARDZERO:
if (x > 0.0 ^ y < 0.0 ^ z < 0.0) if ((x > 0.0) ^ (y < 0.0) ^ (z < 0.0))
return (z); return (z);
else else
return (nextafter(z, 0)); return (nextafter(z, 0));
case FE_DOWNWARD: case FE_DOWNWARD:
if (x > 0.0 ^ y < 0.0) if ((x > 0.0) ^ (y < 0.0))
return (z); return (z);
else else
return (nextafter(z, -INFINITY)); return (nextafter(z, -INFINITY));
default: /* FE_UPWARD */ default: /* FE_UPWARD */
if (x > 0.0 ^ y < 0.0) if ((x > 0.0) ^ (y < 0.0))
return (nextafter(z, INFINITY)); return (nextafter(z, INFINITY));
else else
return (z); return (z);

View file

@ -113,7 +113,7 @@ add_and_denormalize(long double a, long double b, int scale)
if (sum.lo != 0) { if (sum.lo != 0) {
u.e = sum.hi; u.e = sum.hi;
bits_lost = -u.bits.exp - scale + 1; bits_lost = -u.bits.exp - scale + 1;
if (bits_lost != 1 ^ (int)(u.bits.manl & 1)) if ((bits_lost != 1) ^ (int)(u.bits.manl & 1))
sum.hi = nextafterl(sum.hi, INFINITY * sum.lo); sum.hi = nextafterl(sum.hi, INFINITY * sum.lo);
} }
return (ldexp(sum.hi, scale)); return (ldexp(sum.hi, scale));
@ -204,17 +204,17 @@ fmal(long double x, long double y, long double z)
case FE_TONEAREST: case FE_TONEAREST:
return (z); return (z);
case FE_TOWARDZERO: case FE_TOWARDZERO:
if (x > 0.0 ^ y < 0.0 ^ z < 0.0) if ((x > 0.0) ^ (y < 0.0) ^ (z < 0.0))
return (z); return (z);
else else
return (nextafterl(z, 0)); return (nextafterl(z, 0));
case FE_DOWNWARD: case FE_DOWNWARD:
if (x > 0.0 ^ y < 0.0) if ((x > 0.0) ^ (y < 0.0))
return (z); return (z);
else else
return (nextafterl(z, -INFINITY)); return (nextafterl(z, -INFINITY));
default: /* FE_UPWARD */ default: /* FE_UPWARD */
if (x > 0.0 ^ y < 0.0) if ((x > 0.0) ^ (y < 0.0))
return (nextafterl(z, INFINITY)); return (nextafterl(z, INFINITY));
else else
return (z); return (z);

View file

@ -29,17 +29,6 @@
#include "fpmath.h" #include "fpmath.h"
//#define FP_INFINITE 0x01
//#define FP_NAN 0x02
//#define FP_NORMAL 0x04
//#define FP_SUBNORMAL 0x08
//#define FP_ZERO 0x10
//#define fpclassify(x) \
// ((sizeof (x) == sizeof (float)) ? __fpclassifyf(x) \
// : (sizeof (x) == sizeof (double)) ? __fpclassifyd(x) \
// : __fpclassifyl(x))
//
int int
__fpclassifyd(double d) __fpclassifyd(double d)
{ {

View file

@ -10,10 +10,6 @@
* ==================================================== * ====================================================
*/ */
#ifndef lint
static char rcsid[] = "$FreeBSD: src/lib/msun/src/s_logbl.c,v 1.1 2007/12/17 03:53:38 das Exp $";
#endif
#include <float.h> #include <float.h>
#include <limits.h> #include <limits.h>
#include <openlibm.h> #include <openlibm.h>

View file

@ -10,10 +10,6 @@
* ==================================================== * ====================================================
*/ */
#ifndef lint
static char rcsid[] = "$FreeBSD: src/lib/msun/src/s_modf.c,v 1.8 2007/01/06 21:22:38 das Exp $";
#endif
/* /*
* modf(double x, double *iptr) * modf(double x, double *iptr)
* return fraction part of x, and return x's integral part in *iptr. * return fraction part of x, and return x's integral part in *iptr.

View file

@ -52,7 +52,7 @@ nextafterl(long double x, long double y)
t = ux.e*ux.e; t = ux.e*ux.e;
if(t==ux.e) return t; else return ux.e; /* raise underflow flag */ if(t==ux.e) return t; else return ux.e; /* raise underflow flag */
} }
if(x>0.0 ^ x<y) { /* x -= ulp */ if((x>0.0) ^ (x<y)) { /* x -= ulp */
if(ux.bits.manl==0) { if(ux.bits.manl==0) {
if ((ux.bits.manh&~LDBL_NBIT)==0) if ((ux.bits.manh&~LDBL_NBIT)==0)
ux.bits.exp -= 1; ux.bits.exp -= 1;

View file

@ -51,7 +51,7 @@ nexttoward(double x, long double y)
t = x*x; t = x*x;
if(t==x) return t; else return x; /* raise underflow flag */ if(t==x) return t; else return x; /* raise underflow flag */
} }
if(hx>0.0 ^ x < y) { /* x -= ulp */ if((hx>0.0) ^ (x < y)) { /* x -= ulp */
if(lx==0) hx -= 1; if(lx==0) hx -= 1;
lx -= 1; lx -= 1;
} else { /* x += ulp */ } else { /* x += ulp */

View file

@ -41,7 +41,7 @@ nexttowardf(float x, long double y)
t = x*x; t = x*x;
if(t==x) return t; else return x; /* raise underflow flag */ if(t==x) return t; else return x; /* raise underflow flag */
} }
if(hx>=0 ^ x < y) /* x -= ulp */ if((hx>=0) ^ (x < y)) /* x -= ulp */
hx -= 1; hx -= 1;
else /* x += ulp */ else /* x += ulp */
hx += 1; hx += 1;

View file

@ -10,10 +10,6 @@
* ==================================================== * ====================================================
*/ */
#ifndef lint
static char rcsid[] = "$FreeBSD: src/lib/msun/src/s_scalbn.c,v 1.11 2005/03/07 21:27:37 das Exp $";
#endif
/* /*
* scalbn (double x, int n) * scalbn (double x, int n)
* scalbn(x,n) returns x* 2**n computed by exponent * scalbn(x,n) returns x* 2**n computed by exponent
@ -51,11 +47,12 @@ scalbn (double x, int n)
if (k > 0x7fe) return huge*copysign(huge,x); /* overflow */ if (k > 0x7fe) return huge*copysign(huge,x); /* overflow */
if (k > 0) /* normal result */ if (k > 0) /* normal result */
{SET_HIGH_WORD(x,(hx&0x800fffff)|(k<<20)); return x;} {SET_HIGH_WORD(x,(hx&0x800fffff)|(k<<20)); return x;}
if (k <= -54) if (k <= -54) {
if (n > 50000) /* in case integer overflow in n+k */ if (n > 50000) /* in case integer overflow in n+k */
return huge*copysign(huge,x); /*overflow*/ return huge*copysign(huge,x); /*overflow*/
else return tiny*copysign(tiny,x); /*underflow*/ else return tiny*copysign(tiny,x); /*underflow*/
k += 54; /* subnormal result */ }
k += 54; /* subnormal result */
SET_HIGH_WORD(x,(hx&0x800fffff)|(k<<20)); SET_HIGH_WORD(x,(hx&0x800fffff)|(k<<20));
return x*twom54; return x*twom54;
} }

View file

@ -13,9 +13,6 @@
* ==================================================== * ====================================================
*/ */
#ifndef lint
static char rcsid[] = "$FreeBSD: src/lib/msun/src/s_scalbnf.c,v 1.8 2005/03/07 04:52:43 das Exp $";
#endif
#include "cdefs-compat.h" #include "cdefs-compat.h"
@ -46,11 +43,12 @@ scalbnf (float x, int n)
if (k > 0xfe) return huge*copysignf(huge,x); /* overflow */ if (k > 0xfe) return huge*copysignf(huge,x); /* overflow */
if (k > 0) /* normal result */ if (k > 0) /* normal result */
{SET_FLOAT_WORD(x,(ix&0x807fffff)|(k<<23)); return x;} {SET_FLOAT_WORD(x,(ix&0x807fffff)|(k<<23)); return x;}
if (k <= -25) if (k <= -25) {
if (n > 50000) /* in case integer overflow in n+k */ if (n > 50000) /* in case integer overflow in n+k */
return huge*copysignf(huge,x); /*overflow*/ return huge*copysignf(huge,x); /*overflow*/
else return tiny*copysignf(tiny,x); /*underflow*/ else return tiny*copysignf(tiny,x); /*underflow*/
k += 25; /* subnormal result */ }
k += 25; /* subnormal result */
SET_FLOAT_WORD(x,(ix&0x807fffff)|(k<<23)); SET_FLOAT_WORD(x,(ix&0x807fffff)|(k<<23));
return x*twom25; return x*twom25;
} }

View file

@ -10,10 +10,6 @@
* ==================================================== * ====================================================
*/ */
#ifndef lint
static char rcsid[] = "$FreeBSD: src/lib/msun/src/s_scalbnl.c,v 1.1 2005/03/07 04:52:58 das Exp $";
#endif
/* /*
* scalbnl (long double x, int n) * scalbnl (long double x, int n)
* scalbnl(x,n) returns x* 2**n computed by exponent * scalbnl(x,n) returns x* 2**n computed by exponent
@ -59,11 +55,12 @@ scalbnl (long double x, int n)
if (k >= 0x7fff) return huge*copysignl(huge,x); /* overflow */ if (k >= 0x7fff) return huge*copysignl(huge,x); /* overflow */
if (k > 0) /* normal result */ if (k > 0) /* normal result */
{u.bits.exp = k; return u.e;} {u.bits.exp = k; return u.e;}
if (k <= -128) if (k <= -128) {
if (n > 50000) /* in case integer overflow in n+k */ if (n > 50000) /* in case integer overflow in n+k */
return huge*copysign(huge,x); /*overflow*/ return huge*copysign(huge,x); /*overflow*/
else return tiny*copysign(tiny,x); /*underflow*/ else return tiny*copysign(tiny,x); /*underflow*/
k += 128; /* subnormal result */ }
k += 128; /* subnormal result */
u.bits.exp = k; u.bits.exp = k;
return u.e*0x1p-128; return u.e*0x1p-128;
} }