mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* random.c (limited_big_rand): declare rnd, lim and mask as uint32_t
to avoid 64 bit to 32 bit shorten warnings. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41174 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
1ba82b765c
commit
6c5000b5f1
2 changed files with 9 additions and 3 deletions
|
@ -1,3 +1,8 @@
|
|||
Sat Jun 8 19:31:00 2013 Charlie Somerville <charliesome@ruby-lang.org>
|
||||
|
||||
* random.c (limited_big_rand): declare rnd, lim and mask as uint32_t
|
||||
to avoid 64 bit to 32 bit shorten warnings.
|
||||
|
||||
Sat Jun 8 19:23:53 2013 NARUSE, Yui <naruse@ruby-lang.org>
|
||||
|
||||
* win32/Makefile.sub: r41163 changed win32/win32.c and configure.in
|
||||
|
|
7
random.c
7
random.c
|
@ -741,7 +741,7 @@ limited_big_rand(struct MT *mt, VALUE limit)
|
|||
{
|
||||
/* mt must be initialized */
|
||||
|
||||
unsigned long mask, lim, rnd;
|
||||
uint32_t mask;
|
||||
long i;
|
||||
int boundary;
|
||||
|
||||
|
@ -761,8 +761,9 @@ limited_big_rand(struct MT *mt, VALUE limit)
|
|||
mask = 0;
|
||||
boundary = 1;
|
||||
for (i = len-1; 0 <= i; i--) {
|
||||
lim = lim_array[i];
|
||||
mask = mask ? 0xffffffff : make_mask(lim);
|
||||
uint32_t rnd;
|
||||
uint32_t lim = lim_array[i];
|
||||
mask = mask ? 0xffffffff : (uint32_t)make_mask(lim);
|
||||
if (mask) {
|
||||
rnd = genrand_int32(mt) & mask;
|
||||
if (boundary) {
|
||||
|
|
Loading…
Reference in a new issue