1 --- random.c.orig 2004-12-01 20:08:48.000000000 -0800
2 +++ random.c 2004-12-01 20:12:11.000000000 -0800
5 __FBSDID("$FreeBSD: src/lib/libc/stdlib/random.c,v 1.24 2004/01/20 03:02:18 das Exp $");
8 + * We always compile with __DARWIN_UNIX03 set to one, relying on the fact that
9 + * (for non-LP64) sizeof(int) == sizeof(long) == sizeof(size_t), so that we
10 + * don't have to have two different versions of the prototypes. For LP64,
11 + * we only support the POSIX-compatible prototypes.
13 +#undef __DARWIN_UNIX03
14 +#define __DARWIN_UNIX03 1
15 #include "namespace.h"
16 #include <sys/time.h> /* for srandomdev() */
17 #include <fcntl.h> /* for srandomdev() */
19 static int rand_sep = SEP_3;
20 static uint32_t *end_ptr = &randtbl[DEG_3 + 1];
22 -static inline uint32_t good_rand(int32_t);
23 +static inline uint32_t good_rand(int32_t) __attribute__((always_inline));
25 static inline uint32_t good_rand (x)
39 initstate(seed, arg_state, n)
40 - unsigned long seed; /* seed for R.N.G. */
41 + unsigned seed; /* seed for R.N.G. */
42 char *arg_state; /* pointer to state array */
43 - long n; /* # bytes of state info */
44 + size_t n; /* # bytes of state info */
46 char *ostate = (char *)(&state[-1]);
47 uint32_t *int_arg_state = (uint32_t *)arg_state;
52 - char *arg_state; /* pointer to state array */
53 + const char *arg_state; /* pointer to state array */
55 uint32_t *new_state = (uint32_t *)arg_state;
56 uint32_t type = new_state[0] % MAX_TYPES;