summaryrefslogtreecommitdiffstats
path: root/lib/libm/src
diff options
context:
space:
mode:
authormartynas <martynas@openbsd.org>2013-11-12 20:35:09 +0000
committermartynas <martynas@openbsd.org>2013-11-12 20:35:09 +0000
commit121297559c3b15aebdd7e70408879df3901d42a0 (patch)
treea009919ad4273962c2b28556146692bffe065bc3 /lib/libm/src
parentput the _readdir_unlocked() prototype in an obvious place (diff)
downloadwireguard-openbsd-121297559c3b15aebdd7e70408879df3901d42a0.tar.xz
wireguard-openbsd-121297559c3b15aebdd7e70408879df3901d42a0.zip
Declare __p1evll and __polevll protos in math_private.h instead of
redeclaring each time in ld{80,128}. Pointed out by theo.
Diffstat (limited to 'lib/libm/src')
-rw-r--r--lib/libm/src/ld128/e_expl.c6
-rw-r--r--lib/libm/src/ld80/e_expl.c6
-rw-r--r--lib/libm/src/ld80/e_log10l.c7
-rw-r--r--lib/libm/src/ld80/e_log2l.c6
-rw-r--r--lib/libm/src/ld80/e_logl.c7
-rw-r--r--lib/libm/src/ld80/e_powl.c6
-rw-r--r--lib/libm/src/ld80/e_tgammal.c5
-rw-r--r--lib/libm/src/ld80/s_log1pl.c6
-rw-r--r--lib/libm/src/math_private.h4
-rw-r--r--lib/libm/src/polevll.c4
10 files changed, 30 insertions, 27 deletions
diff --git a/lib/libm/src/ld128/e_expl.c b/lib/libm/src/ld128/e_expl.c
index 3fe3ccd3d39..0118d4fca04 100644
--- a/lib/libm/src/ld128/e_expl.c
+++ b/lib/libm/src/ld128/e_expl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: e_expl.c,v 1.2 2011/07/20 21:02:51 martynas Exp $ */
+/* $OpenBSD: e_expl.c,v 1.3 2013/11/12 20:35:18 martynas Exp $ */
/*
* Copyright (c) 2008 Stephen L. Moshier <steve@moshier.net>
@@ -75,6 +75,8 @@
#include <float.h>
#include <math.h>
+#include "math_private.h"
+
/* Pade' coefficients for exp(x) - 1
Theoretical peak relative error = 2.2e-37,
relative peak error spread = 9.2e-38
@@ -108,8 +110,6 @@ static const long double twom10000 = 0x1p-10000L;
static volatile long double twom10000 = 0x1p-10000L;
#endif
-extern long double __polevll(long double, void *, int);
-
long double
expl(long double x)
{
diff --git a/lib/libm/src/ld80/e_expl.c b/lib/libm/src/ld80/e_expl.c
index a5b8a5a6738..2e1008a7e36 100644
--- a/lib/libm/src/ld80/e_expl.c
+++ b/lib/libm/src/ld80/e_expl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: e_expl.c,v 1.2 2011/07/20 21:02:51 martynas Exp $ */
+/* $OpenBSD: e_expl.c,v 1.3 2013/11/12 20:35:19 martynas Exp $ */
/*
* Copyright (c) 2008 Stephen L. Moshier <steve@moshier.net>
@@ -74,6 +74,8 @@
#include <math.h>
+#include "math_private.h"
+
static long double P[3] = {
1.2617719307481059087798E-4L,
3.0299440770744196129956E-2L,
@@ -91,8 +93,6 @@ static const long double MAXLOGL = 1.1356523406294143949492E4L;
static const long double MINLOGL = -1.13994985314888605586758E4L;
static const long double LOG2EL = 1.4426950408889634073599E0L;
-extern long double __polevll(long double, void *, int);
-
long double
expl(long double x)
{
diff --git a/lib/libm/src/ld80/e_log10l.c b/lib/libm/src/ld80/e_log10l.c
index 906c464c9ba..f314fd179db 100644
--- a/lib/libm/src/ld80/e_log10l.c
+++ b/lib/libm/src/ld80/e_log10l.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: e_log10l.c,v 1.1 2011/07/06 00:02:42 martynas Exp $ */
+/* $OpenBSD: e_log10l.c,v 1.2 2013/11/12 20:35:19 martynas Exp $ */
/*
* Copyright (c) 2008 Stephen L. Moshier <steve@moshier.net>
@@ -65,6 +65,8 @@
#include <math.h>
+#include "math_private.h"
+
/* Coefficients for log(1+x) = x - x**2/2 + x**3 P(x)/Q(x)
* 1/sqrt(2) <= x < sqrt(2)
* Theoretical peak relative error = 6.2e-22
@@ -116,9 +118,6 @@ static long double S[4] = {
#define SQRTH 0.70710678118654752440L
-extern long double __polevll(long double, void *, int);
-extern long double __p1evll(long double, void *, int);
-
long double
log10l(long double x)
{
diff --git a/lib/libm/src/ld80/e_log2l.c b/lib/libm/src/ld80/e_log2l.c
index d25b5dd2459..e02a34e12ea 100644
--- a/lib/libm/src/ld80/e_log2l.c
+++ b/lib/libm/src/ld80/e_log2l.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: e_log2l.c,v 1.1 2011/07/06 00:02:42 martynas Exp $ */
+/* $OpenBSD: e_log2l.c,v 1.2 2013/11/12 20:35:19 martynas Exp $ */
/*
* Copyright (c) 2008 Stephen L. Moshier <steve@moshier.net>
@@ -65,6 +65,8 @@
#include <math.h>
+#include "math_private.h"
+
/* Coefficients for ln(1+x) = x - x**2/2 + x**3 P(x)/Q(x)
* 1/sqrt(2) <= x < sqrt(2)
* Theoretical peak relative error = 6.2e-22
@@ -110,8 +112,6 @@ static long double S[4] = {
#define LOG2EA 4.4269504088896340735992e-1L
#define SQRTH 0.70710678118654752440L
-extern long double __polevll(long double, void *, int);
-extern long double __p1evll(long double, void *, int);
long double
log2l(long double x)
diff --git a/lib/libm/src/ld80/e_logl.c b/lib/libm/src/ld80/e_logl.c
index 5ff92e667b3..7c1b854dfcf 100644
--- a/lib/libm/src/ld80/e_logl.c
+++ b/lib/libm/src/ld80/e_logl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: e_logl.c,v 1.2 2011/07/20 21:02:51 martynas Exp $ */
+/* $OpenBSD: e_logl.c,v 1.3 2013/11/12 20:35:19 martynas Exp $ */
/*
* Copyright (c) 2008 Stephen L. Moshier <steve@moshier.net>
@@ -65,6 +65,8 @@
#include <math.h>
+#include "math_private.h"
+
/* Coefficients for log(1+x) = x - x**2/2 + x**3 P(x)/Q(x)
* 1/sqrt(2) <= x < sqrt(2)
* Theoretical peak relative error = 2.32e-20
@@ -111,9 +113,6 @@ static const long double C2 = 1.4286068203094172321215E-6L;
#define SQRTH 0.70710678118654752440L
-extern long double __polevll(long double, void *, int);
-extern long double __p1evll(long double, void *, int);
-
long double
logl(long double x)
{
diff --git a/lib/libm/src/ld80/e_powl.c b/lib/libm/src/ld80/e_powl.c
index f72dd8d68b8..95811510904 100644
--- a/lib/libm/src/ld80/e_powl.c
+++ b/lib/libm/src/ld80/e_powl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: e_powl.c,v 1.4 2013/08/02 20:23:28 kettenis Exp $ */
+/* $OpenBSD: e_powl.c,v 1.5 2013/11/12 20:35:19 martynas Exp $ */
/*
* Copyright (c) 2008 Stephen L. Moshier <steve@moshier.net>
@@ -75,6 +75,8 @@
#include <float.h>
#include <math.h>
+#include "math_private.h"
+
/* Table size */
#define NXT 32
/* log2(Table size) */
@@ -196,8 +198,6 @@ static const long double twom10000 = 0x1p-10000L;
static volatile long double twom10000 = 0x1p-10000L;
#endif
-extern long double __polevll(long double, void *, int);
-extern long double __p1evll(long double, void *, int);
static long double reducl( long double );
static long double powil ( long double, int );
diff --git a/lib/libm/src/ld80/e_tgammal.c b/lib/libm/src/ld80/e_tgammal.c
index fc710bf6957..e7b95059484 100644
--- a/lib/libm/src/ld80/e_tgammal.c
+++ b/lib/libm/src/ld80/e_tgammal.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: e_tgammal.c,v 1.3 2013/08/05 18:13:19 kettenis Exp $ */
+/* $OpenBSD: e_tgammal.c,v 1.4 2013/11/12 20:35:19 martynas Exp $ */
/*
* Copyright (c) 2008 Stephen L. Moshier <steve@moshier.net>
@@ -60,6 +60,8 @@
#include <float.h>
#include <math.h>
+#include "math_private.h"
+
/*
tgamma(x+2) = tgamma(x+2) P(x)/Q(x)
0 <= x <= 1
@@ -181,7 +183,6 @@ static long double SN[9] = {
static const long double PIL = 3.1415926535897932384626L;
-extern long double __polevll(long double, void *, int);
static long double stirf ( long double );
/* Gamma function computed by Stirling's formula.
diff --git a/lib/libm/src/ld80/s_log1pl.c b/lib/libm/src/ld80/s_log1pl.c
index c168dad3aca..2fbac5a815f 100644
--- a/lib/libm/src/ld80/s_log1pl.c
+++ b/lib/libm/src/ld80/s_log1pl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: s_log1pl.c,v 1.2 2011/07/20 21:02:51 martynas Exp $ */
+/* $OpenBSD: s_log1pl.c,v 1.3 2013/11/12 20:35:19 martynas Exp $ */
/*
* Copyright (c) 2008 Stephen L. Moshier <steve@moshier.net>
@@ -61,6 +61,8 @@
#include <math.h>
+#include "math_private.h"
+
/* Coefficients for log(1+x) = x - x^2 / 2 + x^3 P(x)/Q(x)
* 1/sqrt(2) <= x < sqrt(2)
* Theoretical peak relative error = 2.32e-20
@@ -107,8 +109,6 @@ static const long double C1 = 6.9314575195312500000000E-1L;
static const long double C2 = 1.4286068203094172321215E-6L;
#define SQRTH 0.70710678118654752440L
-extern long double __polevll(long double, void *, int);
-extern long double __p1evll(long double, void *, int);
long double
log1pl(long double xm1)
diff --git a/lib/libm/src/math_private.h b/lib/libm/src/math_private.h
index 522d56c6f7b..4c3220d2b51 100644
--- a/lib/libm/src/math_private.h
+++ b/lib/libm/src/math_private.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: math_private.h,v 1.15 2011/07/26 11:43:01 martynas Exp $ */
+/* $OpenBSD: math_private.h,v 1.16 2013/11/12 20:35:09 martynas Exp $ */
/*
* ====================================================
* Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
@@ -411,5 +411,7 @@ struct Double {
*/
double __exp__D(double, double);
struct Double __log__D(double);
+long double __p1evll(long double, void *, int);
+long double __polevll(long double, void *, int);
#endif /* _MATH_PRIVATE_H_ */
diff --git a/lib/libm/src/polevll.c b/lib/libm/src/polevll.c
index 31964a91630..23144b6c1da 100644
--- a/lib/libm/src/polevll.c
+++ b/lib/libm/src/polevll.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: polevll.c,v 1.1 2011/07/06 00:02:42 martynas Exp $ */
+/* $OpenBSD: polevll.c,v 1.2 2013/11/12 20:35:09 martynas Exp $ */
/*
* Copyright (c) 2008 Stephen L. Moshier <steve@moshier.net>
@@ -62,6 +62,8 @@
#include <math.h>
+#include "math_private.h"
+
/*
* Polynomial evaluator:
* P[0] x^n + P[1] x^(n-1) + ... + P[n]