summaryrefslogtreecommitdiff
path: root/random.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-04-18 08:46:18 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-04-18 08:46:18 +0000
commite63a9901412d465cd90143d658fda8fa938d7f8c (patch)
tree12cf55d22b7b78304e8a692c44217e9531a31c02 /random.c
parent8a7b08bb787c2d8d531e0b84974fb2a4bec30d87 (diff)
* 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
Diffstat (limited to 'random.c')
-rw-r--r--random.c12
1 files changed, 6 insertions, 6 deletions
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);