From 8858b239f225cb4f40240074cd7afe0589601e87 Mon Sep 17 00:00:00 2001 From: guenther <> Date: Thu, 27 Aug 2015 04:33:31 +0000 Subject: [PATCH] Move the __rand48_* declarations into rand48.h, and then hide both them and __dorand48() and __rand48_deterministic ok deraadt@ --- src/lib/libc/stdlib/drand48.c | 4 +--- src/lib/libc/stdlib/lcong48.c | 6 +----- src/lib/libc/stdlib/lrand48.c | 4 +--- src/lib/libc/stdlib/mrand48.c | 4 +--- src/lib/libc/stdlib/rand48.h | 8 +++++++- src/lib/libc/stdlib/seed48.c | 6 +----- src/lib/libc/stdlib/srand48.c | 6 +----- 7 files changed, 13 insertions(+), 25 deletions(-) diff --git a/src/lib/libc/stdlib/drand48.c b/src/lib/libc/stdlib/drand48.c index e7cb3cb7..2be23d4c 100644 --- a/src/lib/libc/stdlib/drand48.c +++ b/src/lib/libc/stdlib/drand48.c @@ -1,4 +1,4 @@ -/* $OpenBSD: drand48.c,v 1.5 2014/12/09 19:50:26 deraadt Exp $ */ +/* $OpenBSD: drand48.c,v 1.6 2015/08/27 04:33:31 guenther Exp $ */ /* * Copyright (c) 1993 Martin Birgmeier * All rights reserved. @@ -14,8 +14,6 @@ #include "rand48.h" -extern unsigned short __rand48_seed[3]; - double drand48(void) { diff --git a/src/lib/libc/stdlib/lcong48.c b/src/lib/libc/stdlib/lcong48.c index 09726efb..5b297ddb 100644 --- a/src/lib/libc/stdlib/lcong48.c +++ b/src/lib/libc/stdlib/lcong48.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lcong48.c,v 1.4 2014/12/08 21:45:20 deraadt Exp $ */ +/* $OpenBSD: lcong48.c,v 1.5 2015/08/27 04:33:31 guenther Exp $ */ /* * Copyright (c) 1993 Martin Birgmeier * All rights reserved. @@ -14,10 +14,6 @@ #include "rand48.h" -extern unsigned short __rand48_seed[3]; -extern unsigned short __rand48_mult[3]; -extern unsigned short __rand48_add; - void lcong48(unsigned short p[7]) { diff --git a/src/lib/libc/stdlib/lrand48.c b/src/lib/libc/stdlib/lrand48.c index 22508594..142cca7f 100644 --- a/src/lib/libc/stdlib/lrand48.c +++ b/src/lib/libc/stdlib/lrand48.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lrand48.c,v 1.4 2014/12/08 21:45:20 deraadt Exp $ */ +/* $OpenBSD: lrand48.c,v 1.5 2015/08/27 04:33:31 guenther Exp $ */ /* * Copyright (c) 1993 Martin Birgmeier * All rights reserved. @@ -14,8 +14,6 @@ #include "rand48.h" -extern unsigned short __rand48_seed[3]; - long lrand48(void) { diff --git a/src/lib/libc/stdlib/mrand48.c b/src/lib/libc/stdlib/mrand48.c index 0568a7ff..3334e2ad 100644 --- a/src/lib/libc/stdlib/mrand48.c +++ b/src/lib/libc/stdlib/mrand48.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mrand48.c,v 1.5 2014/12/09 00:02:18 tedu Exp $ */ +/* $OpenBSD: mrand48.c,v 1.6 2015/08/27 04:33:31 guenther Exp $ */ /* * Copyright (c) 1993 Martin Birgmeier * All rights reserved. @@ -14,8 +14,6 @@ #include "rand48.h" -extern unsigned short __rand48_seed[3]; - long mrand48(void) { diff --git a/src/lib/libc/stdlib/rand48.h b/src/lib/libc/stdlib/rand48.h index ee701747..fff28992 100644 --- a/src/lib/libc/stdlib/rand48.h +++ b/src/lib/libc/stdlib/rand48.h @@ -10,7 +10,7 @@ * of any kind. I shall in no event be liable for anything that happens * to anyone/anything when using this software. * - * $OpenBSD: rand48.h,v 1.4 2014/12/08 21:45:20 deraadt Exp $ + * $OpenBSD: rand48.h,v 1.5 2015/08/27 04:33:31 guenther Exp $ */ #ifndef _RAND48_H_ @@ -19,8 +19,14 @@ #include #include +__BEGIN_HIDDEN_DECLS +extern unsigned short __rand48_seed[3]; +extern unsigned short __rand48_mult[3]; +extern unsigned short __rand48_add; + void __dorand48(unsigned short[3]); extern int __rand48_deterministic; +__END_HIDDEN_DECLS #define RAND48_SEED_0 (0x330e) #define RAND48_SEED_1 (0xabcd) diff --git a/src/lib/libc/stdlib/seed48.c b/src/lib/libc/stdlib/seed48.c index 7acb4e6d..0485ed6a 100644 --- a/src/lib/libc/stdlib/seed48.c +++ b/src/lib/libc/stdlib/seed48.c @@ -1,4 +1,4 @@ -/* $OpenBSD: seed48.c,v 1.4 2014/12/08 21:45:20 deraadt Exp $ */ +/* $OpenBSD: seed48.c,v 1.5 2015/08/27 04:33:31 guenther Exp $ */ /* * Copyright (c) 1993 Martin Birgmeier * All rights reserved. @@ -14,10 +14,6 @@ #include "rand48.h" -extern unsigned short __rand48_seed[3]; -extern unsigned short __rand48_mult[3]; -extern unsigned short __rand48_add; - unsigned short * seed48(unsigned short xseed[3]) { diff --git a/src/lib/libc/stdlib/srand48.c b/src/lib/libc/stdlib/srand48.c index 115b9e82..ce4b4522 100644 --- a/src/lib/libc/stdlib/srand48.c +++ b/src/lib/libc/stdlib/srand48.c @@ -1,4 +1,4 @@ -/* $OpenBSD: srand48.c,v 1.4 2014/12/08 21:45:20 deraadt Exp $ */ +/* $OpenBSD: srand48.c,v 1.5 2015/08/27 04:33:31 guenther Exp $ */ /* * Copyright (c) 1993 Martin Birgmeier * All rights reserved. @@ -14,10 +14,6 @@ #include "rand48.h" -extern unsigned short __rand48_seed[3]; -extern unsigned short __rand48_mult[3]; -extern unsigned short __rand48_add; - int __rand48_deterministic; void