From 04195f0e89be35fcb9090119bde375c36996ed66 Mon Sep 17 00:00:00 2001 From: ragge Date: Mon, 20 Oct 1997 14:11:35 +0000 Subject: [PATCH] Fix a bunch of warnings introduced by more flags to cc. --- lib/libm/noieee_src/mathimpl.h | 7 ++++--- lib/libm/noieee_src/n_acosh.c | 4 +++- lib/libm/noieee_src/n_asincos.c | 8 +++++--- lib/libm/noieee_src/n_asinh.c | 4 +++- lib/libm/noieee_src/n_atan.c | 7 +++++-- lib/libm/noieee_src/n_atanh.c | 4 +++- lib/libm/noieee_src/n_cosh.c | 4 +++- lib/libm/noieee_src/n_erf.c | 10 ++++++---- lib/libm/noieee_src/n_exp.c | 6 ++++-- lib/libm/noieee_src/n_exp__E.c | 6 ++++-- lib/libm/noieee_src/n_expm1.c | 6 ++++-- lib/libm/noieee_src/n_floor.c | 4 +++- lib/libm/noieee_src/n_fmod.c | 5 +++-- lib/libm/noieee_src/n_gamma.c | 11 ++++++----- lib/libm/noieee_src/n_j0.c | 10 ++++++---- lib/libm/noieee_src/n_j1.c | 8 +++++--- lib/libm/noieee_src/n_jn.c | 6 ++++-- lib/libm/noieee_src/n_lgamma.c | 10 +++++----- lib/libm/noieee_src/n_log.c | 6 ++++-- lib/libm/noieee_src/n_log10.c | 4 +++- lib/libm/noieee_src/n_log1p.c | 4 +++- lib/libm/noieee_src/n_log__L.c | 4 +++- lib/libm/noieee_src/n_pow.c | 8 +++++--- lib/libm/noieee_src/n_sinh.c | 4 +++- lib/libm/noieee_src/n_tanh.c | 11 +++++++---- 25 files changed, 104 insertions(+), 57 deletions(-) diff --git a/lib/libm/noieee_src/mathimpl.h b/lib/libm/noieee_src/mathimpl.h index 30e94f03b011..7345c5e268aa 100644 --- a/lib/libm/noieee_src/mathimpl.h +++ b/lib/libm/noieee_src/mathimpl.h @@ -1,4 +1,4 @@ -/* $NetBSD: mathimpl.h,v 1.1 1995/10/10 23:36:31 ragge Exp $ */ +/* $NetBSD: mathimpl.h,v 1.2 1997/10/20 14:11:35 ragge Exp $ */ /* * Copyright (c) 1988, 1993 * The Regents of the University of California. All rights reserved. @@ -91,8 +91,9 @@ /* * Functions internal to the math package, yet not static. */ -extern double __exp__E(); -extern double __log__L(); +extern double __exp__E __P((double, double)); +extern double __log__L __P((double)); +extern int infnan __P((int)); struct Double {double a, b;}; double __exp__D __P((double, double)); diff --git a/lib/libm/noieee_src/n_acosh.c b/lib/libm/noieee_src/n_acosh.c index ce909d16ea38..8d455cdb0404 100644 --- a/lib/libm/noieee_src/n_acosh.c +++ b/lib/libm/noieee_src/n_acosh.c @@ -1,4 +1,4 @@ -/* $NetBSD: n_acosh.c,v 1.1 1995/10/10 23:36:33 ragge Exp $ */ +/* $NetBSD: n_acosh.c,v 1.2 1997/10/20 14:11:44 ragge Exp $ */ /* * Copyright (c) 1985, 1993 * The Regents of the University of California. All rights reserved. @@ -33,7 +33,9 @@ */ #ifndef lint +#if 0 static char sccsid[] = "@(#)acosh.c 8.1 (Berkeley) 6/4/93"; +#endif #endif /* not lint */ /* ACOSH(X) diff --git a/lib/libm/noieee_src/n_asincos.c b/lib/libm/noieee_src/n_asincos.c index 581e978fe59f..f007134380f8 100644 --- a/lib/libm/noieee_src/n_asincos.c +++ b/lib/libm/noieee_src/n_asincos.c @@ -1,4 +1,4 @@ -/* $NetBSD: n_asincos.c,v 1.1 1995/10/10 23:36:34 ragge Exp $ */ +/* $NetBSD: n_asincos.c,v 1.2 1997/10/20 14:11:49 ragge Exp $ */ /* * Copyright (c) 1985, 1993 * The Regents of the University of California. All rights reserved. @@ -33,7 +33,9 @@ */ #ifndef lint +#if 0 static char sccsid[] = "@(#)asincos.c 8.1 (Berkeley) 6/4/93"; +#endif #endif /* not lint */ /* ASIN(X) @@ -94,7 +96,7 @@ double asin(x) double x; { - double s,t,copysign(),atan2(),sqrt(),one=1.0; + double s,t,one=1.0; #if !defined(vax)&&!defined(tahoe) if(x!=x) return(x); /* x is NaN */ #endif /* !defined(vax)&&!defined(tahoe) */ @@ -162,7 +164,7 @@ double acos(x) double x; { - double t,copysign(),atan2(),sqrt(),one=1.0; + double t,one=1.0; #if !defined(vax)&&!defined(tahoe) if(x!=x) return(x); #endif /* !defined(vax)&&!defined(tahoe) */ diff --git a/lib/libm/noieee_src/n_asinh.c b/lib/libm/noieee_src/n_asinh.c index 05b325ed86ae..1d779d53cc81 100644 --- a/lib/libm/noieee_src/n_asinh.c +++ b/lib/libm/noieee_src/n_asinh.c @@ -1,4 +1,4 @@ -/* $NetBSD: n_asinh.c,v 1.1 1995/10/10 23:36:35 ragge Exp $ */ +/* $NetBSD: n_asinh.c,v 1.2 1997/10/20 14:11:54 ragge Exp $ */ /* * Copyright (c) 1985, 1993 * The Regents of the University of California. All rights reserved. @@ -33,7 +33,9 @@ */ #ifndef lint +#if 0 static char sccsid[] = "@(#)asinh.c 8.1 (Berkeley) 6/4/93"; +#endif #endif /* not lint */ /* ASINH(X) diff --git a/lib/libm/noieee_src/n_atan.c b/lib/libm/noieee_src/n_atan.c index 6b9c97eb42d0..c3548ecb20d6 100644 --- a/lib/libm/noieee_src/n_atan.c +++ b/lib/libm/noieee_src/n_atan.c @@ -1,4 +1,4 @@ -/* $NetBSD: n_atan.c,v 1.1 1995/10/10 23:36:36 ragge Exp $ */ +/* $NetBSD: n_atan.c,v 1.2 1997/10/20 14:11:58 ragge Exp $ */ /* * Copyright (c) 1985, 1993 * The Regents of the University of California. All rights reserved. @@ -33,7 +33,9 @@ */ #ifndef lint +#if 0 static char sccsid[] = "@(#)atan.c 8.1 (Berkeley) 6/4/93"; +#endif #endif /* not lint */ /* ATAN(X) @@ -79,10 +81,11 @@ static char sccsid[] = "@(#)atan.c 8.1 (Berkeley) 6/4/93"; * maximum observed error in ulps (units in the last place) was * 0.85 ulps. */ +#include "mathimpl.h" double atan(x) double x; { - double atan2(),one=1.0; + double one=1.0; return(atan2(x,one)); } diff --git a/lib/libm/noieee_src/n_atanh.c b/lib/libm/noieee_src/n_atanh.c index 7fce056b3a13..645e299b6b45 100644 --- a/lib/libm/noieee_src/n_atanh.c +++ b/lib/libm/noieee_src/n_atanh.c @@ -1,4 +1,4 @@ -/* $NetBSD: n_atanh.c,v 1.1 1995/10/10 23:36:38 ragge Exp $ */ +/* $NetBSD: n_atanh.c,v 1.2 1997/10/20 14:12:02 ragge Exp $ */ /* * Copyright (c) 1985, 1993 * The Regents of the University of California. All rights reserved. @@ -33,7 +33,9 @@ */ #ifndef lint +#if 0 static char sccsid[] = "@(#)atanh.c 8.1 (Berkeley) 6/4/93"; +#endif #endif /* not lint */ /* ATANH(X) diff --git a/lib/libm/noieee_src/n_cosh.c b/lib/libm/noieee_src/n_cosh.c index bba92d108975..d1cdf4fa0c82 100644 --- a/lib/libm/noieee_src/n_cosh.c +++ b/lib/libm/noieee_src/n_cosh.c @@ -1,4 +1,4 @@ -/* $NetBSD: n_cosh.c,v 1.1 1995/10/10 23:36:42 ragge Exp $ */ +/* $NetBSD: n_cosh.c,v 1.2 1997/10/20 14:12:06 ragge Exp $ */ /* * Copyright (c) 1985, 1993 * The Regents of the University of California. All rights reserved. @@ -33,7 +33,9 @@ */ #ifndef lint +#if 0 static char sccsid[] = "@(#)cosh.c 8.1 (Berkeley) 6/4/93"; +#endif #endif /* not lint */ /* COSH(X) diff --git a/lib/libm/noieee_src/n_erf.c b/lib/libm/noieee_src/n_erf.c index c0bf8273bc65..e4b2cef0ce63 100644 --- a/lib/libm/noieee_src/n_erf.c +++ b/lib/libm/noieee_src/n_erf.c @@ -1,4 +1,4 @@ -/* $NetBSD: n_erf.c,v 1.1 1995/10/10 23:36:43 ragge Exp $ */ +/* $NetBSD: n_erf.c,v 1.2 1997/10/20 14:12:10 ragge Exp $ */ /*- * Copyright (c) 1992, 1993 * The Regents of the University of California. All rights reserved. @@ -33,7 +33,9 @@ */ #ifndef lint +#if 0 static char sccsid[] = "@(#)erf.c 8.1 (Berkeley) 6/4/93"; +#endif #endif /* not lint */ #include "mathimpl.h" @@ -148,7 +150,7 @@ static char sccsid[] = "@(#)erf.c 8.1 (Berkeley) 6/4/93"; #if defined(vax) || defined(tahoe) #define _IEEE 0 -#define TRUNC(x) (double) (float) (x) +#define TRUNC(x) (double)(x) = (float)(x) #else #define _IEEE 1 #define TRUNC(x) *(((int *) &x) + 1) &= 0xf8000000 @@ -267,7 +269,7 @@ rd13 = -1.42821001129434127360582351685e+007; double erf(x) double x; { - double R,S,P,Q,ax,s,y,z,r,fabs(),exp(); + double R,S,P,Q,ax,s,y,z,r; if(!finite(x)) { /* erf(nan)=nan */ if (isnan(x)) return(x); @@ -325,7 +327,7 @@ double erf(x) double erfc(x) double x; { - double R,S,P,Q,s,ax,y,z,r,fabs(),__exp__D(); + double R,S,P,Q,s,ax,y,z,r; if (!finite(x)) { if (isnan(x)) /* erfc(NaN) = NaN */ return(x); diff --git a/lib/libm/noieee_src/n_exp.c b/lib/libm/noieee_src/n_exp.c index d242054a3295..3edffccdbc1e 100644 --- a/lib/libm/noieee_src/n_exp.c +++ b/lib/libm/noieee_src/n_exp.c @@ -1,4 +1,4 @@ -/* $NetBSD: n_exp.c,v 1.1 1995/10/10 23:36:44 ragge Exp $ */ +/* $NetBSD: n_exp.c,v 1.2 1997/10/20 14:12:17 ragge Exp $ */ /* * Copyright (c) 1985, 1993 * The Regents of the University of California. All rights reserved. @@ -33,7 +33,9 @@ */ #ifndef lint +#if 0 static char sccsid[] = "@(#)exp.c 8.1 (Berkeley) 6/4/93"; +#endif #endif /* not lint */ /* EXP(X) @@ -163,7 +165,7 @@ double x; double __exp__D(x, c) double x, c; { - double z,hi,lo, t; + double z,hi,lo; int k; #if !defined(vax)&&!defined(tahoe) diff --git a/lib/libm/noieee_src/n_exp__E.c b/lib/libm/noieee_src/n_exp__E.c index f03ed43ba335..080c91b8db8e 100644 --- a/lib/libm/noieee_src/n_exp__E.c +++ b/lib/libm/noieee_src/n_exp__E.c @@ -1,4 +1,4 @@ -/* $NetBSD: n_exp__E.c,v 1.1 1995/10/10 23:36:45 ragge Exp $ */ +/* $NetBSD: n_exp__E.c,v 1.2 1997/10/20 14:12:21 ragge Exp $ */ /* * Copyright (c) 1985, 1993 * The Regents of the University of California. All rights reserved. @@ -33,7 +33,9 @@ */ #ifndef lint +#if 0 static char sccsid[] = "@(#)exp__E.c 8.1 (Berkeley) 6/4/93"; +#endif #endif /* not lint */ /* exp__E(x,c) @@ -131,7 +133,7 @@ double x,c; /* end of |x| > small */ else { - if(x!=zero) one+small; /* raise the inexact flag */ + if(x!=zero) w=one+small; /* raise the inexact flag ??? -ragge */ return(copysign(zero,x)); } } diff --git a/lib/libm/noieee_src/n_expm1.c b/lib/libm/noieee_src/n_expm1.c index 4c95d35e3ccc..1caf47a02f13 100644 --- a/lib/libm/noieee_src/n_expm1.c +++ b/lib/libm/noieee_src/n_expm1.c @@ -1,4 +1,4 @@ -/* $NetBSD: n_expm1.c,v 1.1 1995/10/10 23:36:46 ragge Exp $ */ +/* $NetBSD: n_expm1.c,v 1.2 1997/10/20 14:12:26 ragge Exp $ */ /* * Copyright (c) 1985, 1993 * The Regents of the University of California. All rights reserved. @@ -33,7 +33,9 @@ */ #ifndef lint +#if 0 static char sccsid[] = "@(#)expm1.c 8.1 (Berkeley) 6/4/93"; +#endif #endif /* not lint */ /* EXPM1(X) @@ -155,7 +157,7 @@ double x; else /* expm1(-big#) rounded to -1 (inexact) */ if(finite(x)) - { ln2hi+ln2lo; return(-one);} + { c=ln2hi+ln2lo; return(-one);} /* ??? -ragge */ /* expm1(-INF) is -1 */ else return(-one); diff --git a/lib/libm/noieee_src/n_floor.c b/lib/libm/noieee_src/n_floor.c index 48786df85272..4cc58cf4a660 100644 --- a/lib/libm/noieee_src/n_floor.c +++ b/lib/libm/noieee_src/n_floor.c @@ -1,4 +1,4 @@ -/* $NetBSD: n_floor.c,v 1.1 1995/10/10 23:36:48 ragge Exp $ */ +/* $NetBSD: n_floor.c,v 1.2 1997/10/20 14:12:30 ragge Exp $ */ /* * Copyright (c) 1985, 1993 * The Regents of the University of California. All rights reserved. @@ -33,7 +33,9 @@ */ #ifndef lint +#if 0 static char sccsid[] = "@(#)floor.c 8.1 (Berkeley) 6/4/93"; +#endif #endif /* not lint */ #include "mathimpl.h" diff --git a/lib/libm/noieee_src/n_fmod.c b/lib/libm/noieee_src/n_fmod.c index 99cdf9ca5cd2..d43cd449b12c 100644 --- a/lib/libm/noieee_src/n_fmod.c +++ b/lib/libm/noieee_src/n_fmod.c @@ -1,4 +1,4 @@ -/* $NetBSD: n_fmod.c,v 1.1 1995/10/10 23:36:49 ragge Exp $ */ +/* $NetBSD: n_fmod.c,v 1.2 1997/10/20 14:12:34 ragge Exp $ */ /* * Copyright (c) 1989, 1993 * The Regents of the University of California. All rights reserved. @@ -33,7 +33,9 @@ */ #ifndef lint +#if 0 static char sccsid[] = "@(#)fmod.c 8.1 (Berkeley) 6/4/93"; +#endif #endif /* not lint */ #include "mathimpl.h" @@ -67,7 +69,6 @@ static char sccsid[] = "@(#)fmod.c 8.1 (Berkeley) 6/4/93"; #if !defined(vax) && !defined(tahoe) extern int isnan(),finite(); #endif /* !defined(vax) && !defined(tahoe) */ -extern double frexp(),ldexp(),fabs(); #ifdef TEST_FMOD static double diff --git a/lib/libm/noieee_src/n_gamma.c b/lib/libm/noieee_src/n_gamma.c index a5d5e9498986..2e2cc6ca634e 100644 --- a/lib/libm/noieee_src/n_gamma.c +++ b/lib/libm/noieee_src/n_gamma.c @@ -1,4 +1,4 @@ -/* $NetBSD: n_gamma.c,v 1.1 1995/10/10 23:36:50 ragge Exp $ */ +/* $NetBSD: n_gamma.c,v 1.2 1997/10/20 14:12:39 ragge Exp $ */ /*- * Copyright (c) 1992, 1993 * The Regents of the University of California. All rights reserved. @@ -33,7 +33,9 @@ */ #ifndef lint +#if 0 static char sccsid[] = "@(#)gamma.c 8.1 (Berkeley) 6/4/93"; +#endif #endif /* not lint */ /* @@ -140,6 +142,7 @@ double gamma(x) double x; { + double b; struct Double u; endian = (*(int *) &one) ? 1 : 0; @@ -156,7 +159,7 @@ gamma(x) if (x == 0.0) if (!_IEEE) return (infnan(ERANGE)); else return (one/x); - one+1e-20; /* Raise inexact flag. */ + b =one+1e-20; /* Raise inexact flag. ??? -ragge */ return (one/x); } else if (!finite(x)) { if (_IEEE) /* x = NaN, -Inf */ @@ -174,7 +177,6 @@ large_gam(x) double x; { double z, p; - int i; struct Double t, u, v; z = one/(x*x); @@ -203,7 +205,7 @@ static double small_gam(x) double x; { - double y, ym1, t, x1; + double y, ym1, t; struct Double yy, r; y = x - one; ym1 = y - one; @@ -266,7 +268,6 @@ static struct Double ratfun_gam(z, c) double z, c; { - int i; double p, q; struct Double r, t; diff --git a/lib/libm/noieee_src/n_j0.c b/lib/libm/noieee_src/n_j0.c index 3148fb18e321..ed69b20243bb 100644 --- a/lib/libm/noieee_src/n_j0.c +++ b/lib/libm/noieee_src/n_j0.c @@ -1,4 +1,4 @@ -/* $NetBSD: n_j0.c,v 1.1 1995/10/10 23:36:52 ragge Exp $ */ +/* $NetBSD: n_j0.c,v 1.2 1997/10/20 14:12:44 ragge Exp $ */ /*- * Copyright (c) 1992, 1993 * The Regents of the University of California. All rights reserved. @@ -33,7 +33,9 @@ */ #ifndef lint +#if 0 static char sccsid[] = "@(#)j0.c 8.2 (Berkeley) 11/30/93"; +#endif #endif /* not lint */ /* @@ -111,7 +113,7 @@ static char sccsid[] = "@(#)j0.c 8.2 (Berkeley) 11/30/93"; * 3. Special cases: y0(0)=-inf, y0(x<0)=NaN, y0(inf)=0. */ -#include +#include "mathimpl.h" #include #include @@ -342,7 +344,7 @@ static double pzero(x) if (x >= 8.00) {p = pr8; q= ps8;} else if (x >= 4.54545211791992188) {p = pr5; q= ps5;} else if (x >= 2.85714149475097656) {p = pr3; q= ps3;} - else if (x >= 2.00) {p = pr2; q= ps2;} + else /* if (x >= 2.00) */ {p = pr2; q= ps2;} z = one/(x*x); r = p[0]+z*(p[1]+z*(p[2]+z*(p[3]+z*(p[4]+z*p[5])))); s = one+z*(q[0]+z*(q[1]+z*(q[2]+z*(q[3]+z*q[4])))); @@ -434,7 +436,7 @@ static double qzero(x) if (x >= 8.00) {p = qr8; q= qs8;} else if (x >= 4.54545211791992188) {p = qr5; q= qs5;} else if (x >= 2.85714149475097656) {p = qr3; q= qs3;} - else if (x >= 2.00) {p = qr2; q= qs2;} + else /* if (x >= 2.00) */ {p = qr2; q= qs2;} z = one/(x*x); r = p[0]+z*(p[1]+z*(p[2]+z*(p[3]+z*(p[4]+z*p[5])))); s = one+z*(q[0]+z*(q[1]+z*(q[2]+z*(q[3]+z*(q[4]+z*q[5]))))); diff --git a/lib/libm/noieee_src/n_j1.c b/lib/libm/noieee_src/n_j1.c index 2de8182fb6fe..6dbcf7264844 100644 --- a/lib/libm/noieee_src/n_j1.c +++ b/lib/libm/noieee_src/n_j1.c @@ -1,4 +1,4 @@ -/* $NetBSD: n_j1.c,v 1.1 1995/10/10 23:36:53 ragge Exp $ */ +/* $NetBSD: n_j1.c,v 1.2 1997/10/20 14:12:50 ragge Exp $ */ /*- * Copyright (c) 1992, 1993 * The Regents of the University of California. All rights reserved. @@ -33,7 +33,9 @@ */ #ifndef lint +#if 0 static char sccsid[] = "@(#)j1.c 8.2 (Berkeley) 11/30/93"; +#endif #endif /* not lint */ /* @@ -111,7 +113,7 @@ static char sccsid[] = "@(#)j1.c 8.2 (Berkeley) 11/30/93"; * by method mentioned above. */ -#include +#include "mathimpl.h" #include #include @@ -122,7 +124,7 @@ static char sccsid[] = "@(#)j1.c 8.2 (Berkeley) 11/30/93"; #define infnan(x) (0.0) #endif -static double pone(), qone(); +static double pone __P((double)), qone __P((double)); static double huge = 1e300, diff --git a/lib/libm/noieee_src/n_jn.c b/lib/libm/noieee_src/n_jn.c index 31eef767a1b5..9fb5dc8fd6cb 100644 --- a/lib/libm/noieee_src/n_jn.c +++ b/lib/libm/noieee_src/n_jn.c @@ -1,4 +1,4 @@ -/* $NetBSD: n_jn.c,v 1.1 1995/10/10 23:36:54 ragge Exp $ */ +/* $NetBSD: n_jn.c,v 1.2 1997/10/20 14:12:54 ragge Exp $ */ /*- * Copyright (c) 1992, 1993 * The Regents of the University of California. All rights reserved. @@ -33,7 +33,9 @@ */ #ifndef lint +#if 0 static char sccsid[] = "@(#)jn.c 8.2 (Berkeley) 11/30/93"; +#endif #endif /* not lint */ /* @@ -92,7 +94,7 @@ static char sccsid[] = "@(#)jn.c 8.2 (Berkeley) 11/30/93"; * */ -#include +#include "mathimpl.h" #include #include diff --git a/lib/libm/noieee_src/n_lgamma.c b/lib/libm/noieee_src/n_lgamma.c index 1833e956fadf..9118480bc97d 100644 --- a/lib/libm/noieee_src/n_lgamma.c +++ b/lib/libm/noieee_src/n_lgamma.c @@ -1,4 +1,4 @@ -/* $NetBSD: n_lgamma.c,v 1.1 1995/10/10 23:36:56 ragge Exp $ */ +/* $NetBSD: n_lgamma.c,v 1.2 1997/10/20 14:12:59 ragge Exp $ */ /*- * Copyright (c) 1992, 1993 * The Regents of the University of California. All rights reserved. @@ -33,7 +33,9 @@ */ #ifndef lint +#if 0 static char sccsid[] = "@(#)lgamma.c 8.2 (Berkeley) 11/30/93"; +#endif #endif /* not lint */ /* @@ -84,7 +86,7 @@ static int endian; static double small_lgam(double); static double large_lgam(double); static double neg_lgam(double); -static double zero = 0.0, one = 1.0; +static double one = 1.0; int signgam; #define UNDERFL (1e-1020 * 1e-1020) @@ -92,7 +94,7 @@ int signgam; #define LEFT (1.0 - (x0 + .25)) #define RIGHT (x0 - .218) /* -/* Constants for approximation in [1.244,1.712] + * Constants for approximation in [1.244,1.712] */ #define x0 0.461632144968362356785 #define x0_lo -.000000000000000015522348162858676890521 @@ -169,7 +171,6 @@ static double large_lgam(double x) { double z, p, x1; - int i; struct Double t, u, v; u = __log__D(x); u.a -= 1.0; @@ -271,7 +272,6 @@ neg_lgam(double x) { int xi; double y, z, one = 1.0, zero = 0.0; - extern double gamma(); /* avoid destructive cancellation as much as possible */ if (x > -170) { diff --git a/lib/libm/noieee_src/n_log.c b/lib/libm/noieee_src/n_log.c index 80f17aa364be..1f2206c5b6d3 100644 --- a/lib/libm/noieee_src/n_log.c +++ b/lib/libm/noieee_src/n_log.c @@ -1,4 +1,4 @@ -/* $NetBSD: n_log.c,v 1.1 1995/10/10 23:36:57 ragge Exp $ */ +/* $NetBSD: n_log.c,v 1.2 1997/10/20 14:13:05 ragge Exp $ */ /* * Copyright (c) 1992, 1993 * The Regents of the University of California. All rights reserved. @@ -33,7 +33,9 @@ */ #ifndef lint +#if 0 static char sccsid[] = "@(#)log.c 8.2 (Berkeley) 11/30/93"; +#endif #endif /* not lint */ #include @@ -449,7 +451,7 @@ __log__D(x) double x; #endif { int m, j; - double F, f, g, q, u, v, u2, one = 1.0; + double F, f, g, q, u, v, u2; volatile double u1; struct Double r; diff --git a/lib/libm/noieee_src/n_log10.c b/lib/libm/noieee_src/n_log10.c index e2d626d20fe0..bd6c2869a8bf 100644 --- a/lib/libm/noieee_src/n_log10.c +++ b/lib/libm/noieee_src/n_log10.c @@ -1,4 +1,4 @@ -/* $NetBSD: n_log10.c,v 1.1 1995/10/10 23:36:58 ragge Exp $ */ +/* $NetBSD: n_log10.c,v 1.2 1997/10/20 14:13:10 ragge Exp $ */ /* * Copyright (c) 1985, 1993 * The Regents of the University of California. All rights reserved. @@ -33,7 +33,9 @@ */ #ifndef lint +#if 0 static char sccsid[] = "@(#)log10.c 8.1 (Berkeley) 6/4/93"; +#endif #endif /* not lint */ /* LOG10(X) diff --git a/lib/libm/noieee_src/n_log1p.c b/lib/libm/noieee_src/n_log1p.c index 84269043f0c6..9ad356b000c3 100644 --- a/lib/libm/noieee_src/n_log1p.c +++ b/lib/libm/noieee_src/n_log1p.c @@ -1,4 +1,4 @@ -/* $NetBSD: n_log1p.c,v 1.1 1995/10/10 23:37:00 ragge Exp $ */ +/* $NetBSD: n_log1p.c,v 1.2 1997/10/20 14:13:15 ragge Exp $ */ /* * Copyright (c) 1985, 1993 * The Regents of the University of California. All rights reserved. @@ -33,7 +33,9 @@ */ #ifndef lint +#if 0 static char sccsid[] = "@(#)log1p.c 8.1 (Berkeley) 6/4/93"; +#endif #endif /* not lint */ /* LOG1P(x) diff --git a/lib/libm/noieee_src/n_log__L.c b/lib/libm/noieee_src/n_log__L.c index 977c82d1ba24..bb3f3e053d94 100644 --- a/lib/libm/noieee_src/n_log__L.c +++ b/lib/libm/noieee_src/n_log__L.c @@ -1,4 +1,4 @@ -/* $NetBSD: n_log__L.c,v 1.1 1995/10/10 23:37:01 ragge Exp $ */ +/* $NetBSD: n_log__L.c,v 1.2 1997/10/20 14:13:19 ragge Exp $ */ /* * Copyright (c) 1985, 1993 * The Regents of the University of California. All rights reserved. @@ -33,7 +33,9 @@ */ #ifndef lint +#if 0 static char sccsid[] = "@(#)log__L.c 8.1 (Berkeley) 6/4/93"; +#endif #endif /* not lint */ /* log__L(Z) diff --git a/lib/libm/noieee_src/n_pow.c b/lib/libm/noieee_src/n_pow.c index ed8b5384a582..ae1660c219b8 100644 --- a/lib/libm/noieee_src/n_pow.c +++ b/lib/libm/noieee_src/n_pow.c @@ -1,4 +1,4 @@ -/* $NetBSD: n_pow.c,v 1.1 1995/10/10 23:37:02 ragge Exp $ */ +/* $NetBSD: n_pow.c,v 1.2 1997/10/20 14:13:23 ragge Exp $ */ /* * Copyright (c) 1985, 1993 * The Regents of the University of California. All rights reserved. @@ -33,7 +33,9 @@ */ #ifndef lint +#if 0 static char sccsid[] = "@(#)pow.c 8.1 (Berkeley) 6/4/93"; +#endif #endif /* not lint */ /* POW(X,Y) @@ -174,8 +176,8 @@ pow_P(double x, double y) pow_P(x, y) double x, y; #endif { - struct Double s, t, __log__D(); - double __exp__D(), huge = 1e300, tiny = 1e-300; + struct Double s, t; + double huge = 1e300, tiny = 1e-300; if (x == zero) if (y > zero) diff --git a/lib/libm/noieee_src/n_sinh.c b/lib/libm/noieee_src/n_sinh.c index d97f90598cf3..baff428f1437 100644 --- a/lib/libm/noieee_src/n_sinh.c +++ b/lib/libm/noieee_src/n_sinh.c @@ -1,4 +1,4 @@ -/* $NetBSD: n_sinh.c,v 1.1 1995/10/10 23:37:05 ragge Exp $ */ +/* $NetBSD: n_sinh.c,v 1.2 1997/10/20 14:13:27 ragge Exp $ */ /* * Copyright (c) 1985, 1993 * The Regents of the University of California. All rights reserved. @@ -33,7 +33,9 @@ */ #ifndef lint +#if 0 static char sccsid[] = "@(#)sinh.c 8.1 (Berkeley) 6/4/93"; +#endif #endif /* not lint */ /* SINH(X) diff --git a/lib/libm/noieee_src/n_tanh.c b/lib/libm/noieee_src/n_tanh.c index 81145978c960..8d21b2c9c0c7 100644 --- a/lib/libm/noieee_src/n_tanh.c +++ b/lib/libm/noieee_src/n_tanh.c @@ -1,4 +1,4 @@ -/* $NetBSD: n_tanh.c,v 1.1 1995/10/10 23:37:08 ragge Exp $ */ +/* $NetBSD: n_tanh.c,v 1.2 1997/10/20 14:13:32 ragge Exp $ */ /* * Copyright (c) 1985, 1993 * The Regents of the University of California. All rights reserved. @@ -33,7 +33,9 @@ */ #ifndef lint +#if 0 static char sccsid[] = "@(#)tanh.c 8.1 (Berkeley) 6/4/93"; +#endif #endif /* not lint */ /* TANH(X) @@ -73,12 +75,13 @@ static char sccsid[] = "@(#)tanh.c 8.1 (Berkeley) 6/4/93"; * observed error was 2.22 ulps (units in the last place). */ +#include "mathimpl.h" + double tanh(x) double x; { static double one=1.0, two=2.0, small = 1.0e-10, big = 1.0e10; - double expm1(), t, copysign(), sign; - int finite(); + double t, sign; #if !defined(vax)&&!defined(tahoe) if(x!=x) return(x); /* x is NaN */ @@ -92,7 +95,7 @@ double x; else if ( x > small ) {t= -expm1(-(x+x)); return(copysign(t/(two-t),sign));} else /* raise the INEXACT flag for non-zero x */ - {big+x; return(copysign(x,sign));} + { t = big+x; return(copysign(x,sign));} /* ??? -ragge */ else if(finite(x)) return (sign+1.0E-37); /* raise the INEXACT flag */ else