summaryrefslogtreecommitdiff
path: root/numeric.c
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-12-24 18:12:24 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-12-24 18:12:24 +0000
commite3215a73423bdfca2ee2a2cae45a616296f0f605 (patch)
tree9ab7ee75fdacc3dc0f78ff5aa3335b6de6aa6436 /numeric.c
parent8f5b0a4cd4decba7a56d1acb9601db47d2935ec0 (diff)
* 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 'numeric.c')
-rw-r--r--numeric.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/numeric.c b/numeric.c
index 6ba8686..b9f2b1d 100644
--- a/numeric.c
+++ b/numeric.c
@@ -2669,8 +2669,8 @@ rb_fix_lshift(VALUE x, VALUE y)
static VALUE
fix_lshift(long val, unsigned long width)
{
- if (width > (sizeof(VALUE)*CHAR_BIT-1)
- || ((unsigned long)val)>>(sizeof(VALUE)*CHAR_BIT-1-width) > 0) {
+ if (width > (SIZEOF_LONG*CHAR_BIT-1)
+ || ((unsigned long)val)>>(SIZEOF_LONG*CHAR_BIT-1-width) > 0) {
return rb_big_lshift(rb_int2big(val), ULONG2NUM(width));
}
val = val << width;
@@ -2743,7 +2743,7 @@ fix_aref(VALUE fix, VALUE idx)
i = NUM2LONG(idx);
if (i < 0) return INT2FIX(0);
- if (sizeof(VALUE)*CHAR_BIT-1 < i) {
+ if (SIZEOF_LONG*CHAR_BIT-1 < i) {
if (val < 0) return INT2FIX(1);
return INT2FIX(0);
}