diff options
author | charliesome <charliesome@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-06-08 10:33:05 +0000 |
---|---|---|
committer | charliesome <charliesome@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-06-08 10:33:05 +0000 |
commit | 6c5000b5f1a00bb1d21215aeb1881e8c66d4676d (patch) | |
tree | 09b6d1797221ff95b059b75e0880422d33b798ab /random.c | |
parent | 1ba82b765c17dac9bbd4a02ec51c0f36e94e1342 (diff) | |
download | ruby-6c5000b5f1a00bb1d21215aeb1881e8c66d4676d.tar.gz |
* 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
Diffstat (limited to 'random.c')
-rw-r--r-- | random.c | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -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) { |