summaryrefslogtreecommitdiff
path: root/random.c
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-06-08 07:01:19 (GMT)
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-06-08 07:01:19 (GMT)
commit8a1609040e959ffb370c121840cf1fdfb144616a (patch)
tree1115cd91844916ec4ebf707a5d70caf767946b9e /random.c
parentccce83c454880c9a0414f8b750ca0808e1f40ccc (diff)
* random.c (rand_init): Add a cast to fix clang compile error:
random.c:410:32: error: implicit conversion loses integer precision: 'size_t' (aka 'unsigned long') to 'int' [-Werror,-Wshorten-64-to-32] This cast doesn't cause a problem because len is not bigger than MT_MAX_STATE. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41168 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'random.c')
-rw-r--r--random.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/random.c b/random.c
index 19b65a7..38aee08 100644
--- a/random.c
+++ b/random.c
@@ -407,7 +407,7 @@ rand_init(struct MT *mt, VALUE vseed)
else {
if (sign != 2 && buf[len-1] == 1) /* remove leading-zero-guard */
len--;
- init_by_array(mt, buf, len);
+ init_by_array(mt, buf, (int)len);
}
if (buf != buf0) xfree(buf);
return seed;