summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2015-09-10 11:11:05 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2015-09-10 11:11:05 +0000
commitd0809154e77b015d3295608629f3bba3b9847028 (patch)
treedddf49c4ef64cca1b82b6cd362e7c08dfca14b8c
parent9eaa04b41a0d6eae92712b72760a0be533d8d31a (diff)
hide __dtoa_locks as a static in the single use case; ok guenther
-rw-r--r--lib/libc/Symbols.list1
-rw-r--r--lib/libc/gdtoa/Makefile.inc4
-rw-r--r--lib/libc/gdtoa/gdtoaimp.h1
-rw-r--r--lib/libc/gdtoa/locks.c7
-rw-r--r--lib/libc/gdtoa/misc.c4
5 files changed, 6 insertions, 11 deletions
diff --git a/lib/libc/Symbols.list b/lib/libc/Symbols.list
index c1ffe5c2375..38408f511eb 100644
--- a/lib/libc/Symbols.list
+++ b/lib/libc/Symbols.list
@@ -843,7 +843,6 @@ crypt_newhash
/* gdtoa */
__dtoa
-__dtoa_locks
__freedtoa
__gdtoa
__hdtoa
diff --git a/lib/libc/gdtoa/Makefile.inc b/lib/libc/gdtoa/Makefile.inc
index 84c95ccd2db..25545b85ab9 100644
--- a/lib/libc/gdtoa/Makefile.inc
+++ b/lib/libc/gdtoa/Makefile.inc
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile.inc,v 1.3 2010/02/03 20:49:00 miod Exp $
+# $OpenBSD: Makefile.inc,v 1.4 2015/09/10 11:11:04 deraadt Exp $
# gdtoa sources
.PATH: ${LIBCSRCDIR}/arch/${MACHINE_CPU}/gdtoa ${LIBCSRCDIR}/gdtoa
@@ -12,7 +12,7 @@ CFLAGS+= -DNO_FENV_H
CFLAGS+= -DUSE_LOCALE
SRCS+= dmisc.c dtoa.c gdtoa.c gethex.c gmisc.c hd_init.c hdtoa.c \
- hexnan.c ldtoa.c locks.c misc.c smisc.c strtod.c strtodg.c \
+ hexnan.c ldtoa.c misc.c smisc.c strtod.c strtodg.c \
strtof.c strtold.c sum.c ulp.c
.include "${LIBCSRCDIR}/arch/${MACHINE_CPU}/gdtoa/Makefile.inc"
diff --git a/lib/libc/gdtoa/gdtoaimp.h b/lib/libc/gdtoa/gdtoaimp.h
index 0f3de128584..8823aa8f197 100644
--- a/lib/libc/gdtoa/gdtoaimp.h
+++ b/lib/libc/gdtoa/gdtoaimp.h
@@ -463,7 +463,6 @@ extern double rnd_prod(double, double), rnd_quot(double, double);
#define FREE_DTOA_LOCK(n) /*nothing*/
#else
#include "thread_private.h"
-extern void *__dtoa_locks[];
#define ACQUIRE_DTOA_LOCK(n) _MUTEX_LOCK(&__dtoa_locks[n])
#define FREE_DTOA_LOCK(n) _MUTEX_UNLOCK(&__dtoa_locks[n])
#endif
diff --git a/lib/libc/gdtoa/locks.c b/lib/libc/gdtoa/locks.c
deleted file mode 100644
index 75df2cb750d..00000000000
--- a/lib/libc/gdtoa/locks.c
+++ /dev/null
@@ -1,7 +0,0 @@
-/* $OpenBSD: locks.c,v 1.1 2008/09/07 20:36:08 martynas Exp $ */
-
-/* Written by Martynas Venckus. Public Domain. */
-
-#include <stdio.h>
-
-void *__dtoa_locks[] = { NULL, NULL };
diff --git a/lib/libc/gdtoa/misc.c b/lib/libc/gdtoa/misc.c
index 711d36c097d..64e19701116 100644
--- a/lib/libc/gdtoa/misc.c
+++ b/lib/libc/gdtoa/misc.c
@@ -40,6 +40,10 @@ THIS SOFTWARE.
static double private_mem[PRIVATE_mem], *pmem_next = private_mem;
#endif
+#ifdef MULTIPLE_THREADS
+static void *__dtoa_locks[] = { NULL, NULL };
+#endif
+
Bigint *
Balloc
#ifdef KR_headers