diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2000-01-17 08:37:53 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2000-01-17 08:37:53 +0000 |
commit | dde62bcd2efbb3825d982326896ab774e73e4218 (patch) | |
tree | 6a421d3818dd390cf8f6b2c5544726a8950e1401 /random.c | |
parent | e43877719bd4bbd12e493e896a0f98c5b349937b (diff) | |
download | ruby-dde62bcd2efbb3825d982326896ab774e73e4218.tar.gz |
2000-01-17
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@606 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'random.c')
-rw-r--r-- | random.c | 8 |
1 files changed, 3 insertions, 5 deletions
@@ -76,8 +76,8 @@ void srand48 _((long)); #endif /* not HAVE_DRAND48 */ -#ifdef HAVE_RANDOM static int first = 1; +#if !defined HAVE_DRAND48 && defined HAVE_RANDOM static char state[256]; #endif @@ -88,15 +88,15 @@ rand_init(seed) int old; static unsigned int saved_seed; -#ifdef HAVE_RANDOM +#if !defined HAVE_DRAND48 && defined HAVE_RANDOM if (first == 1) { initstate(1, state, sizeof state); - first = 0; } else { setstate(state); } #endif + first = 0; SRANDOM(seed); old = saved_seed; @@ -135,8 +135,6 @@ rb_f_rand(obj, vmax) { long val, max; - static initialized = 0; - if (first) { struct timeval tv; |