libm: fix some unused variable (rcsid) and dangling else warnings
s_{fabs,fmax,logb,scalb}{,f,l}.c may be built elsewhere with a higher WARNS setting. Reviewed by: ed Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D8061
This commit is contained in:
parent
3af5cc2e50
commit
dcdfa506cc
@ -10,9 +10,8 @@
|
||||
* ====================================================
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
static char rcsid[] = "$FreeBSD$";
|
||||
#endif
|
||||
#include <sys/cdefs.h>
|
||||
__FBSDID("$FreeBSD$");
|
||||
|
||||
/*
|
||||
* fabs(x) returns the absolute value of x.
|
||||
|
@ -10,9 +10,8 @@
|
||||
* ====================================================
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
static char rcsid[] = "$FreeBSD$";
|
||||
#endif
|
||||
#include <sys/cdefs.h>
|
||||
__FBSDID("$FreeBSD$");
|
||||
|
||||
#include <float.h>
|
||||
#include <limits.h>
|
||||
|
@ -10,9 +10,8 @@
|
||||
* ====================================================
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
static char rcsid[] = "$FreeBSD$";
|
||||
#endif
|
||||
#include <sys/cdefs.h>
|
||||
__FBSDID("$FreeBSD$");
|
||||
|
||||
/*
|
||||
* scalbn (double x, int n)
|
||||
@ -21,7 +20,6 @@ static char rcsid[] = "$FreeBSD$";
|
||||
* exponentiation or a multiplication.
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
#include <float.h>
|
||||
|
||||
#include "math.h"
|
||||
@ -51,10 +49,12 @@ scalbn (double x, int n)
|
||||
if (k > 0x7fe) return huge*copysign(huge,x); /* overflow */
|
||||
if (k > 0) /* normal result */
|
||||
{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 */
|
||||
return huge*copysign(huge,x); /*overflow*/
|
||||
else return tiny*copysign(tiny,x); /*underflow*/
|
||||
else
|
||||
return tiny*copysign(tiny,x); /*underflow*/
|
||||
}
|
||||
k += 54; /* subnormal result */
|
||||
SET_HIGH_WORD(x,(hx&0x800fffff)|(k<<20));
|
||||
return x*twom54;
|
||||
|
@ -13,11 +13,8 @@
|
||||
* ====================================================
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
static char rcsid[] = "$FreeBSD$";
|
||||
#endif
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__FBSDID("$FreeBSD$");
|
||||
|
||||
#include "math.h"
|
||||
#include "math_private.h"
|
||||
@ -46,10 +43,12 @@ scalbnf (float x, int n)
|
||||
if (k > 0xfe) return huge*copysignf(huge,x); /* overflow */
|
||||
if (k > 0) /* normal result */
|
||||
{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 */
|
||||
return huge*copysignf(huge,x); /*overflow*/
|
||||
else return tiny*copysignf(tiny,x); /*underflow*/
|
||||
else
|
||||
return tiny*copysignf(tiny,x); /*underflow*/
|
||||
}
|
||||
k += 25; /* subnormal result */
|
||||
SET_FLOAT_WORD(x,(ix&0x807fffff)|(k<<23));
|
||||
return x*twom25;
|
||||
|
@ -10,9 +10,8 @@
|
||||
* ====================================================
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
static char rcsid[] = "$FreeBSD$";
|
||||
#endif
|
||||
#include <sys/cdefs.h>
|
||||
__FBSDID("$FreeBSD$");
|
||||
|
||||
/*
|
||||
* scalbnl (long double x, int n)
|
||||
@ -27,7 +26,6 @@ static char rcsid[] = "$FreeBSD$";
|
||||
* for scalbn(), so we don't use this routine.
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
#include <float.h>
|
||||
#include <math.h>
|
||||
|
||||
@ -59,10 +57,12 @@ scalbnl (long double x, int n)
|
||||
if (k >= 0x7fff) return huge*copysignl(huge,x); /* overflow */
|
||||
if (k > 0) /* normal result */
|
||||
{u.bits.exp = k; return u.e;}
|
||||
if (k <= -128)
|
||||
if (k <= -128) {
|
||||
if (n > 50000) /* in case integer overflow in n+k */
|
||||
return huge*copysign(huge,x); /*overflow*/
|
||||
else return tiny*copysign(tiny,x); /*underflow*/
|
||||
else
|
||||
return tiny*copysign(tiny,x); /*underflow*/
|
||||
}
|
||||
k += 128; /* subnormal result */
|
||||
u.bits.exp = k;
|
||||
return u.e*0x1p-128;
|
||||
|
Loading…
x
Reference in New Issue
Block a user