summaryrefslogtreecommitdiffstats
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
commit38f53383cb1f4514ec491eb202d04650a3472558 (patch)
tree9ab7ee75fdacc3dc0f78ff5aa3335b6de6aa6436 /numeric.c
parent484347a8db8edd9db0db3b87c0e0f94243cef419 (diff)
downloadruby-38f53383cb1f4514ec491eb202d04650a3472558.tar.gz
ruby-38f53383cb1f4514ec491eb202d04650a3472558.tar.xz
ruby-38f53383cb1f4514ec491eb202d04650a3472558.zip
* 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: http://svn.ruby-lang.org/repos/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 6ba8686bf..b9f2b1d08 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);
}