From 7565d728b6f3910cf41ce106bf0b7bc2aef2bc77 Mon Sep 17 00:00:00 2001 From: akr Date: Tue, 25 Jun 2013 12:51:17 +0000 Subject: [PATCH] * bignum.c (big2dbl): Use (BDIGIT)1 instead of 1UL. (bary_mul_normal): Remove a useless cast. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41625 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 5 +++++ bignum.c | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 5c3ed8b5c2..3a754ecdca 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Tue Jun 25 21:43:13 2013 Tanaka Akira + + * bignum.c (big2dbl): Use (BDIGIT)1 instead of 1UL. + (bary_mul_normal): Remove a useless cast. + Tue Jun 25 21:26:00 2013 Kenta Murata * ext/bigdecimal/bigdecimal.c (BigMath_s_exp): Fix for the cases when diff --git a/bignum.c b/bignum.c index 9760d0b455..65ba7790f2 100644 --- a/bignum.c +++ b/bignum.c @@ -2618,7 +2618,7 @@ big2dbl(VALUE x) d = ds[i] + BIGRAD*d; } dl = ds[i]; - if (bits && (dl & (1UL << (bits %= BITSPERDIG)))) { + if (bits && (dl & ((BDIGIT)1 << (bits %= BITSPERDIG)))) { int carry = (dl & ~(BDIGMAX << bits)) != 0; if (!carry) { while (i-- > 0) { @@ -3386,7 +3386,7 @@ bary_mul_normal(BDIGIT *zds, size_t zl, BDIGIT *xds, size_t xl, BDIGIT *yds, siz if (dd == 0) continue; n = 0; for (j = 0; j < yl; j++) { - BDIGIT_DBL ee = n + (BDIGIT_DBL)dd * yds[j]; + BDIGIT_DBL ee = n + dd * yds[j]; n = zds[i + j] + ee; if (ee) zds[i + j] = BIGLO(n); n = BIGDN(n);