From e63a9901412d465cd90143d658fda8fa938d7f8c Mon Sep 17 00:00:00 2001 From: matz Date: Thu, 18 Apr 2002 08:46:18 +0000 Subject: * re.c (rb_reg_expr_str): should treat backslash specially in escaping. * io.c: complete off_t handling; missing argument for fptr_finalize(); polished rb_scan_args call. * dir.c: wrap multi-statment macro by do { } while (0) * eval.c, numeric,c, sprintf.c, util.c: ditto. * bignum.c (rb_big_eq): check `y == x' if y is neither Fixnum, Bignum, nor Float. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2382 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- random.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'random.c') diff --git a/random.c b/random.c index ba568cdb82..e3830166d4 100644 --- a/random.c +++ b/random.c @@ -6,7 +6,7 @@ $Date$ created at: Fri Dec 24 16:39:21 JST 1993 - Copyright (C) 1993-2001 Yukihiro Matsumoto + Copyright (C) 1993-2002 Yukihiro Matsumoto **********************************************************************/ @@ -77,7 +77,7 @@ void srand48 _((long)); #endif /* not HAVE_DRAND48 */ static int first = 1; -#ifdef HAVE_RANDOM +#ifdef HAVE_INITSTATE static char state[256]; #endif @@ -88,7 +88,7 @@ rand_init(seed) int old; static unsigned int saved_seed; -#if defined HAVE_INITSTATE +#ifdef HAVE_INITSTATE if (first == 1) { initstate(1, state, sizeof state); } @@ -111,11 +111,11 @@ rb_f_srand(argc, argv, obj) VALUE *argv; VALUE obj; { - VALUE a; + VALUE sd; unsigned int seed, old; rb_secure(4); - if (rb_scan_args(argc, argv, "01", &a) == 0) { + if (rb_scan_args(argc, argv, "01", &sd) == 0) { static int n = 0; struct timeval tv; @@ -123,7 +123,7 @@ rb_f_srand(argc, argv, obj) seed = tv.tv_sec ^ tv.tv_usec ^ getpid() ^ n++; } else { - seed = NUM2UINT(a); + seed = NUM2UINT(sd); } old = rand_init(seed); -- cgit v1.2.1