]> git.saurik.com Git - apple/libc.git/blob - gen/FreeBSD/srand48.c.patch
Libc-763.13.tar.gz
[apple/libc.git] / gen / FreeBSD / srand48.c.patch
1 --- srand48.c.orig 2009-11-07 14:51:38.000000000 -0800
2 +++ srand48.c 2009-11-07 14:51:39.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 }