From 0a89315b83671e833b306bd047460dc8194037ae Mon Sep 17 00:00:00 2001 From: nobu Date: Tue, 25 Jun 2013 02:40:11 +0000 Subject: [PATCH] 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 --- ChangeLog | 5 ++++- bignum.c | 4 ++-- 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 +Tue Jun 25 11:40:08 2013 Nobuyoshi Nakada + + * 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; }