Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/common/lib/libc/stdlib update for the new function signature...



details:   https://anonhg.NetBSD.org/src/rev/0a04a2e86b5c
branches:  trunk
changeset: 796639:0a04a2e86b5c
user:      christos <christos%NetBSD.org@localhost>
date:      Thu Jun 12 20:59:46 2014 +0000

description:
update for the new function signatures of initstate/srandom

diffstat:

 common/lib/libc/stdlib/random.c |  12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diffs (50 lines):

diff -r 790868c25ea4 -r 0a04a2e86b5c common/lib/libc/stdlib/random.c
--- a/common/lib/libc/stdlib/random.c   Thu Jun 12 20:22:04 2014 +0000
+++ b/common/lib/libc/stdlib/random.c   Thu Jun 12 20:59:46 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: random.c,v 1.3 2005/12/21 14:23:58 christos Exp $      */
+/*     $NetBSD: random.c,v 1.4 2014/06/12 20:59:46 christos Exp $      */
 
 /*
  * Copyright (c) 1983, 1993
@@ -35,7 +35,7 @@
 #if 0
 static char sccsid[] = "@(#)random.c   8.2 (Berkeley) 5/19/95";
 #else
-__RCSID("$NetBSD: random.c,v 1.3 2005/12/21 14:23:58 christos Exp $");
+__RCSID("$NetBSD: random.c,v 1.4 2014/06/12 20:59:46 christos Exp $");
 #endif
 #endif /* LIBC_SCCS and not lint */
 
@@ -302,11 +302,11 @@
 }
 
 void
-srandom(unsigned long x)
+srandom(unsigned int x)
 {
 
        mutex_lock(&random_mutex);
-       srandom_unlocked((unsigned int) x);
+       srandom_unlocked(x);
        mutex_unlock(&random_mutex);
 }
 
@@ -335,7 +335,7 @@
  */
 char *
 initstate(
-       unsigned long seed,             /* seed for R.N.G. */
+       unsigned int seed,              /* seed for R.N.G. */
        char *arg_state,                /* pointer to state array */
        size_t n)                       /* # bytes of state info */
 {
@@ -377,7 +377,7 @@
        }
        state = (int *) (int_arg_state + 1); /* first location */
        end_ptr = &state[rand_deg];     /* must set end_ptr before srandom */
-       srandom_unlocked((unsigned int) seed);
+       srandom_unlocked(seed);
        if (rand_type == TYPE_0)
                int_arg_state[0] = rand_type;
        else



Home | Main Index | Thread Index | Old Index