diff options
author | pat <> | 2005-03-30 18:51:49 +0000 |
---|---|---|
committer | pat <> | 2005-03-30 18:51:49 +0000 |
commit | 894b6ab0099e7d9ca2ad9acb75246cd0a4542167 (patch) | |
tree | f9fb8e9324f6cbdc10d72cab8b889d470252465a /src/lib/libc/stdlib/random.c | |
parent | 162f8b042bf31ab94714a6f194e9836c08c085f5 (diff) | |
download | openbsd-894b6ab0099e7d9ca2ad9acb75246cd0a4542167.tar.gz openbsd-894b6ab0099e7d9ca2ad9acb75246cd0a4542167.tar.bz2 openbsd-894b6ab0099e7d9ca2ad9acb75246cd0a4542167.zip |
ansi + de-register
ok otto deraadt
Diffstat (limited to 'src/lib/libc/stdlib/random.c')
-rw-r--r-- | src/lib/libc/stdlib/random.c | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/src/lib/libc/stdlib/random.c b/src/lib/libc/stdlib/random.c index 4807d2f27d..4ca8735e75 100644 --- a/src/lib/libc/stdlib/random.c +++ b/src/lib/libc/stdlib/random.c | |||
@@ -28,7 +28,7 @@ | |||
28 | */ | 28 | */ |
29 | 29 | ||
30 | #if defined(LIBC_SCCS) && !defined(lint) | 30 | #if defined(LIBC_SCCS) && !defined(lint) |
31 | static char *rcsid = "$OpenBSD: random.c,v 1.12 2003/06/02 20:18:38 millert Exp $"; | 31 | static char *rcsid = "$OpenBSD: random.c,v 1.13 2005/03/30 18:51:49 pat Exp $"; |
32 | #endif /* LIBC_SCCS and not lint */ | 32 | #endif /* LIBC_SCCS and not lint */ |
33 | 33 | ||
34 | #include <sys/param.h> | 34 | #include <sys/param.h> |
@@ -190,8 +190,7 @@ static int rand_sep = SEP_3; | |||
190 | * for default usage relies on values produced by this routine. | 190 | * for default usage relies on values produced by this routine. |
191 | */ | 191 | */ |
192 | void | 192 | void |
193 | srandom(x) | 193 | srandom(unsigned int x) |
194 | unsigned int x; | ||
195 | { | 194 | { |
196 | int i; | 195 | int i; |
197 | int32_t test; | 196 | int32_t test; |
@@ -232,7 +231,7 @@ srandom(x) | |||
232 | * a fixed seed. | 231 | * a fixed seed. |
233 | */ | 232 | */ |
234 | void | 233 | void |
235 | srandomdev() | 234 | srandomdev(void) |
236 | { | 235 | { |
237 | int fd, i, mib[2], n; | 236 | int fd, i, mib[2], n; |
238 | size_t len; | 237 | size_t len; |
@@ -299,10 +298,7 @@ srandomdev() | |||
299 | * Returns a pointer to the old state. | 298 | * Returns a pointer to the old state. |
300 | */ | 299 | */ |
301 | char * | 300 | char * |
302 | initstate(seed, arg_state, n) | 301 | initstate(u_int seed, char *arg_state, size_t n) |
303 | u_int seed; /* seed for R.N.G. */ | ||
304 | char *arg_state; /* pointer to state array */ | ||
305 | size_t n; /* # bytes of state info */ | ||
306 | { | 302 | { |
307 | char *ostate = (char *)(&state[-1]); | 303 | char *ostate = (char *)(&state[-1]); |
308 | 304 | ||
@@ -359,8 +355,7 @@ initstate(seed, arg_state, n) | |||
359 | * Returns a pointer to the old state information. | 355 | * Returns a pointer to the old state information. |
360 | */ | 356 | */ |
361 | char * | 357 | char * |
362 | setstate(arg_state) | 358 | setstate(const char *arg_state) |
363 | const char *arg_state; | ||
364 | { | 359 | { |
365 | int32_t *new_state = (int32_t *)arg_state; | 360 | int32_t *new_state = (int32_t *)arg_state; |
366 | int32_t type = new_state[0] % MAX_TYPES; | 361 | int32_t type = new_state[0] % MAX_TYPES; |
@@ -411,7 +406,7 @@ setstate(arg_state) | |||
411 | * Returns a 31-bit random number. | 406 | * Returns a 31-bit random number. |
412 | */ | 407 | */ |
413 | long | 408 | long |
414 | random() | 409 | random(void) |
415 | { | 410 | { |
416 | int32_t i; | 411 | int32_t i; |
417 | 412 | ||