From b0acbc4c9afd41602ec9f4b0ee6914b4461ccd32 Mon Sep 17 00:00:00 2001 From: matz Date: Mon, 1 Dec 2003 08:42:53 +0000 Subject: * pack.c (htov16): converts endian using swap16. htov32(), hton16, hton32 as well. [ruby-talk:85377] * pack.c (swap16): swap 2 bytes no matter how big short is on the platform. swap32() is also prepared. * numeric.c (rb_num2int): returns long to preserve information. rb_fix2int(), rb_num2uint(), rb_fix2uint() as well. [ruby-talk:85377] * numeric.c (rb_num2uint): should not check for value range if the source value is negative. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5075 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ruby.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'ruby.h') diff --git a/ruby.h b/ruby.h index 4791398b1e..d90eaffe60 100644 --- a/ruby.h +++ b/ruby.h @@ -239,13 +239,13 @@ unsigned long rb_num2ulong _((VALUE)); #define NUM2LONG(x) (FIXNUM_P(x)?FIX2LONG(x):rb_num2long((VALUE)x)) #define NUM2ULONG(x) rb_num2ulong((VALUE)x) #if SIZEOF_INT < SIZEOF_LONG -int rb_num2int _((VALUE)); +long rb_num2int _((VALUE)); #define NUM2INT(x) (FIXNUM_P(x)?FIX2INT(x):rb_num2int((VALUE)x)) -int rb_fix2int _((VALUE)); +long rb_fix2int _((VALUE)); #define FIX2INT(x) rb_fix2int((VALUE)x) -unsigned int rb_num2uint _((VALUE)); +unsigned long rb_num2uint _((VALUE)); #define NUM2UINT(x) rb_num2uint(x) -unsigned int rb_fix2uint _((VALUE)); +unsigned long rb_fix2uint _((VALUE)); #define FIX2UINT(x) rb_fix2uint(x) #else #define NUM2INT(x) ((int)NUM2LONG(x)) -- cgit v1.2.3