From 297958b17e5a5920f1386aa238ad838336072df2 Mon Sep 17 00:00:00 2001 From: roland Date: Tue, 19 Mar 1996 19:53:43 +0000 Subject: [PATCH] Tue Feb 20 11:33:46 1996 David Mosberger-Tang * stdlib/random.c, stdlib/random_r.c: replaced "long int" by int32_t where 32 bit integers are required. Also change LONG_MAX into 0x7fffffff since the intent is to turn off the sign bit in a 32 bit integer. Sat Feb 17 11:29:29 1996 David Mosberger-Tang * stdlib/random.c: on 64 bit machines, randtbl[] and __random[] need to operate on "int" instead of "long int". --- stdlib/random.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/stdlib/random.c b/stdlib/random.c index c3f8eaa0a3..0ab8f05e5f 100644 --- a/stdlib/random.c +++ b/stdlib/random.c @@ -114,7 +114,7 @@ position of the rear pointer is just (MAX_TYPES * (rptr - state)) + TYPE_3 == TYPE_3. */ -static long int randtbl[DEG_3 + 1] = +static int32_t randtbl[DEG_3 + 1] = { TYPE_3, @@ -239,10 +239,10 @@ weak_alias (__setstate, setstate) rear pointers can't wrap on the same call by not testing the rear pointer if the front one has wrapped. Returns a 31-bit random number. */ -long int +int __random () { - long int retval; + int32_t retval; (void) __random_r (&unsafe_state, &retval); -- 2.11.0