aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-06-25 12:19:58 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-06-25 12:19:58 +0000
commitb58230bcbdf49cbc47f9d9f225a98c242d990b91 (patch)
tree37684ca12d858fcaab91c361ae4935c947131164
parentd4f1cc32042789d24d698d7a09a4b8c5058c0526 (diff)
downloadruby-b58230bcbdf49cbc47f9d9f225a98c242d990b91.tar.gz
* bignum.c (big2ulong): "check" argument removed.
(rb_big2ulong): Follow above change. (rb_big2long): Ditto. (rb_big_rshift): Ditto. (rb_big_aref): Ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41622 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog8
-rw-r--r--bignum.c17
2 files changed, 15 insertions, 10 deletions
diff --git a/ChangeLog b/ChangeLog
index 1772aa2fbf..8a1c3c6153 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+Tue Jun 25 20:36:31 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (big2ulong): "check" argument removed.
+ (rb_big2ulong): Follow above change.
+ (rb_big2long): Ditto.
+ (rb_big_rshift): Ditto.
+ (rb_big_aref): Ditto.
+
Tue Jun 25 20:08:29 2013 Tanaka Akira <akr@fsij.org>
* bignum.c (rb_big2ulong_pack): Use rb_integer_pack.
diff --git a/bignum.c b/bignum.c
index e9b58ce25a..9760d0b455 100644
--- a/bignum.c
+++ b/bignum.c
@@ -2408,7 +2408,7 @@ rb_big_to_s(int argc, VALUE *argv, VALUE x)
}
static unsigned long
-big2ulong(VALUE x, const char *type, int check)
+big2ulong(VALUE x, const char *type)
{
long len = RBIGNUM_LEN(x);
unsigned long num;
@@ -2417,10 +2417,7 @@ big2ulong(VALUE x, const char *type, int check)
if (len == 0)
return 0;
if (BIGSIZE(x) > sizeof(long)) {
- if (check)
- rb_raise(rb_eRangeError, "bignum too big to convert into `%s'", type);
- if (bdigit_roomof(sizeof(long)) < len)
- len = bdigit_roomof(sizeof(long));
+ rb_raise(rb_eRangeError, "bignum too big to convert into `%s'", type);
}
ds = BDIGITS(x);
#if SIZEOF_LONG <= SIZEOF_BDIGITS
@@ -2447,7 +2444,7 @@ rb_big2ulong_pack(VALUE x)
VALUE
rb_big2ulong(VALUE x)
{
- unsigned long num = big2ulong(x, "unsigned long", TRUE);
+ unsigned long num = big2ulong(x, "unsigned long");
if (RBIGNUM_POSITIVE_P(x)) {
return num;
@@ -2464,7 +2461,7 @@ rb_big2ulong(VALUE x)
SIGNED_VALUE
rb_big2long(VALUE x)
{
- unsigned long num = big2ulong(x, "long", TRUE);
+ unsigned long num = big2ulong(x, "long");
if (RBIGNUM_POSITIVE_P(x)) {
if (num <= LONG_MAX)
@@ -4892,7 +4889,7 @@ rb_big_lshift(VALUE x, VALUE y)
if (!NIL_P(t)) return t;
neg = 1;
}
- shift = big2ulong(y, "long", TRUE);
+ shift = big2ulong(y, "long");
break;
}
y = rb_to_int(y);
@@ -4969,7 +4966,7 @@ rb_big_rshift(VALUE x, VALUE y)
else {
neg = 1;
}
- shift = big2ulong(y, "long", TRUE);
+ shift = big2ulong(y, "long");
break;
}
y = rb_to_int(y);
@@ -5067,7 +5064,7 @@ rb_big_aref(VALUE x, VALUE y)
out_of_range:
return RBIGNUM_SIGN(x) ? INT2FIX(0) : INT2FIX(1);
}
- shift = big2ulong(y, "long", TRUE);
+ shift = big2ulong(y, "long");
}
else {
i = NUM2LONG(y);