aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-06-25 02:40:11 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-06-25 02:40:11 +0000
commit0a89315b83671e833b306bd047460dc8194037ae (patch)
treeb78ee60e49db6d9103b3f25202c9b183ac5065cb
parentcb2cfdd937c07f9c521a5ea58ed339ff674c22f4 (diff)
downloadruby-0a89315b83671e833b306bd047460dc8194037ae.tar.gz
bignum.c: suppress warning
* bignum.c (big2ulong): suppress shorten-64-to-32 warning. BDIGIT can be bigger than long now. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41612 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog5
-rw-r--r--bignum.c4
2 files changed, 6 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index e6b767e544..6d19538110 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,7 @@
-Tue Jun 25 11:39:34 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Jun 25 11:40:08 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * bignum.c (big2ulong): suppress shorten-64-to-32 warning. BDIGIT can
+ be bigger than long now.
* bignum.c (LSHIFTX): remove redundant never-true expression.
diff --git a/bignum.c b/bignum.c
index f15cf832c7..5f8c6d62b3 100644
--- a/bignum.c
+++ b/bignum.c
@@ -2422,8 +2422,8 @@ big2ulong(VALUE x, const char *type, int check)
ds = BDIGITS(x);
num = 0;
while (len--) {
- num = BIGUP(num);
- num += ds[len];
+ num <<= BITSPERDIG;
+ num += (unsigned long)ds[len]; /* overflow is already checked */
}
return num;
}