1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* random.c (DIGSPERINT): fix for LP64.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24164 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2009-07-17 06:21:14 +00:00
parent ed52949e79
commit 003fa83e0c
2 changed files with 5 additions and 3 deletions

View file

@ -1,4 +1,6 @@
Fri Jul 17 13:58:26 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
Fri Jul 17 15:20:53 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
* random.c (DIGSPERINT): fix for LP64.
* random.c (fill_random_seed): /dev/urandom is not available on
DOSISH systems.

View file

@ -226,7 +226,7 @@ rb_genrand_real(void)
#define BDIGITS(x) (RBIGNUM_DIGITS(x))
#define BITSPERDIG (SIZEOF_BDIGITS*CHAR_BIT)
#define BIGRAD ((BDIGIT_DBL)1 << BITSPERDIG)
#define DIGSPERINT (SIZEOF_LONG/SIZEOF_BDIGITS)
#define DIGSPERINT (SIZEOF_INT/SIZEOF_BDIGITS)
#define BIGUP(x) ((BDIGIT_DBL)(x) << BITSPERDIG)
#define BIGDN(x) RSHIFT(x,BITSPERDIG)
#define BIGLO(x) ((BDIGIT)((x) & (BIGRAD-1)))
@ -615,7 +615,7 @@ random_load(VALUE obj, VALUE dump)
do {
x = (x << CHAR_BIT * SIZEOF_BDIGITS) | *--d;
} while (--len % DIGSPERINT);
#endif
# endif
mt->state[len / DIGSPERINT] = (unsigned int)x;
} while (len > 0);
}