aboutsummaryrefslogtreecommitdiffstats
path: root/random.c
diff options
context:
space:
mode:
authorcharliesome <charliesome@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-06-08 10:33:05 +0000
committercharliesome <charliesome@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-06-08 10:33:05 +0000
commit6c5000b5f1a00bb1d21215aeb1881e8c66d4676d (patch)
tree09b6d1797221ff95b059b75e0880422d33b798ab /random.c
parent1ba82b765c17dac9bbd4a02ec51c0f36e94e1342 (diff)
downloadruby-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.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/random.c b/random.c
index d41846b67e..6973ce389a 100644
--- a/random.c
+++ b/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) {