summaryrefslogtreecommitdiff
path: root/src/lib/libc/stdlib/random.c
diff options
context:
space:
mode:
authorpat <>2005-03-30 18:51:49 +0000
committerpat <>2005-03-30 18:51:49 +0000
commit894b6ab0099e7d9ca2ad9acb75246cd0a4542167 (patch)
treef9fb8e9324f6cbdc10d72cab8b889d470252465a /src/lib/libc/stdlib/random.c
parent162f8b042bf31ab94714a6f194e9836c08c085f5 (diff)
downloadopenbsd-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.c17
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)
31static char *rcsid = "$OpenBSD: random.c,v 1.12 2003/06/02 20:18:38 millert Exp $"; 31static 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 */
192void 192void
193srandom(x) 193srandom(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 */
234void 233void
235srandomdev() 234srandomdev(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 */
301char * 300char *
302initstate(seed, arg_state, n) 301initstate(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 */
361char * 357char *
362setstate(arg_state) 358setstate(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 */
413long 408long
414random() 409random(void)
415{ 410{
416 int32_t i; 411 int32_t i;
417 412