]> git.saurik.com Git - apple/libc.git/blame - gen/FreeBSD/srand48.c.patch
Libc-498.tar.gz
[apple/libc.git] / gen / FreeBSD / srand48.c.patch
CommitLineData
224c7076
A
1--- srand48.c.orig 2003-05-20 15:21:03.000000000 -0700
2+++ srand48.c 2005-11-03 13:50:51.000000000 -0800
3@@ -13,18 +13,10 @@
4
5 #include "rand48.h"
6
7-extern unsigned short _rand48_seed[3];
8-extern unsigned short _rand48_mult[3];
9-extern unsigned short _rand48_add;
10-
11 void
12 srand48(long seed)
13 {
14- _rand48_seed[0] = RAND48_SEED_0;
15- _rand48_seed[1] = (unsigned short) seed;
16- _rand48_seed[2] = (unsigned short) (seed >> 16);
17- _rand48_mult[0] = RAND48_MULT_0;
18- _rand48_mult[1] = RAND48_MULT_1;
19- _rand48_mult[2] = RAND48_MULT_2;
20+ _rand48_seed = TOUINT48(RAND48_SEED_0, (unsigned short) seed, (unsigned short) (seed >> 16));
21+ _rand48_mult = RAND48_MULT;
22 _rand48_add = RAND48_ADD;
23 }