diff options
author | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-12-24 18:12:24 +0000 |
---|---|---|
committer | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-12-24 18:12:24 +0000 |
commit | e3215a73423bdfca2ee2a2cae45a616296f0f605 (patch) | |
tree | 9ab7ee75fdacc3dc0f78ff5aa3335b6de6aa6436 /bignum.c | |
parent | 8f5b0a4cd4decba7a56d1acb9601db47d2935ec0 (diff) | |
download | ruby-e3215a73423bdfca2ee2a2cae45a616296f0f605.tar.gz |
* pack.c (pack_pack): use NUM2LONG instead of NUM2INT.
* numeric.c (fix_lshift, fix_aref): use SIZEOF_LONG instead of
SIZEOF_VALUE.
* bignum.c (big2ulong, rb_big_aref): ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14625 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'bignum.c')
-rw-r--r-- | bignum.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -977,10 +977,10 @@ big2ulong(VALUE x, const char *type, int check) BDIGIT_DBL num; BDIGIT *ds; - if (len > SIZEOF_VALUE/SIZEOF_BDIGITS) { + if (len > DIGSPERLONG) { if (check) rb_raise(rb_eRangeError, "bignum too big to convert into `%s'", type); - len = SIZEOF_VALUE/SIZEOF_BDIGITS; + len = DIGSPERLONG; } ds = BDIGITS(x); num = 0; @@ -2390,7 +2390,7 @@ rb_big_aref(VALUE x, VALUE y) if (TYPE(y) == T_BIGNUM) { if (!RBIGNUM_SIGN(y)) return INT2FIX(0); - if (RBIGNUM_LEN(bigtrunc(y)) > SIZEOF_VALUE/SIZEOF_BDIGITS) { + if (RBIGNUM_LEN(bigtrunc(y)) > DIGSPERLONG) { out_of_range: return RBIGNUM_SIGN(x) ? INT2FIX(0) : INT2FIX(1); } |