add and use internal header for *rand48 lcg
authorRich Felker <dalias@aerifal.cx>
Sat, 8 Sep 2018 03:02:40 +0000 (23:02 -0400)
committerRich Felker <dalias@aerifal.cx>
Wed, 12 Sep 2018 18:34:30 +0000 (14:34 -0400)
src/prng/__rand48_step.c
src/prng/__seed48.c
src/prng/drand48.c
src/prng/lcong48.c
src/prng/lrand48.c
src/prng/mrand48.c
src/prng/rand48.h [new file with mode: 0644]
src/prng/seed48.c

index 961d30fc9161e48dde6fc64a9c8aa10f19f5eee5..94703d0738d2408326d85b39b3fda14998c035ed 100644 (file)
@@ -1,4 +1,5 @@
 #include <stdint.h>
+#include "rand48.h"
 
 uint64_t __rand48_step(unsigned short *xi, unsigned short *lc)
 {
index 05a4539e4ee3133af9eb01166c9ff2efb3fb1282..e436b4d302bfec6b2d2d1699262968fac265c14a 100644 (file)
@@ -1 +1,3 @@
+#include "rand48.h"
+
 unsigned short __seed48[7] = { 0, 0, 0, 0xe66d, 0xdeec, 0x5, 0xb };
index d808353c9872ebd1ae7dedd8dadff14c41b3a8ba..08283e240b14fad45921469bc7aea39eadda3670 100644 (file)
@@ -1,8 +1,6 @@
 #include <stdlib.h>
 #include <inttypes.h>
-
-uint64_t __rand48_step(unsigned short *xi, unsigned short *lc);
-extern unsigned short __seed48[7];
+#include "rand48.h"
 
 double erand48(unsigned short s[3])
 {
index 32b27d423aa1dd0b6341176479bef6596287d3da..030e51484463bfb539aff0a7cacb65119c5b3893 100644 (file)
@@ -1,7 +1,6 @@
 #include <stdlib.h>
 #include <string.h>
-
-extern unsigned short __seed48[7];
+#include "rand48.h"
 
 void lcong48(unsigned short p[7])
 {
index a3c4e4e2b2bb09e69627a7bbd0ff655c1f4eec8a..07e2b78440f13c6ec5095e82e23cbfded091772e 100644 (file)
@@ -1,8 +1,6 @@
 #include <stdlib.h>
 #include <inttypes.h>
-
-uint64_t __rand48_step(unsigned short *xi, unsigned short *lc);
-extern unsigned short __seed48[7];
+#include "rand48.h"
 
 long nrand48(unsigned short s[3])
 {
index 0519d6676de261d9411bb87ca3eca1215ec8b9cc..f4a56e61b2e65b51008b64f076a0bc14fbfeed9d 100644 (file)
@@ -1,8 +1,6 @@
 #include <stdlib.h>
 #include <inttypes.h>
-
-uint64_t __rand48_step(unsigned short *xi, unsigned short *lc);
-extern unsigned short __seed48[7];
+#include "rand48.h"
 
 long jrand48(unsigned short s[3])
 {
diff --git a/src/prng/rand48.h b/src/prng/rand48.h
new file mode 100644 (file)
index 0000000..4ed6ae5
--- /dev/null
@@ -0,0 +1,4 @@
+#include <stdint.h>
+
+uint64_t __rand48_step(unsigned short *xi, unsigned short *lc);
+extern unsigned short __seed48[7];
index e0699c092afd677bc40339707ac4ca1ab7e265ea..bce7b339fea015aaba454b2b15efdb5a0c1154e1 100644 (file)
@@ -1,7 +1,6 @@
 #include <stdlib.h>
 #include <string.h>
-
-extern unsigned short __seed48[7];
+#include "rand48.h"
 
 unsigned short *seed48(unsigned short *s)
 {