From d0a3c64fb4af21a911f2b7553bbddb45dd9e4484 Mon Sep 17 00:00:00 2001 From: ocean Date: Fri, 17 Feb 2006 02:21:39 +0000 Subject: * util.c (ruby_strtod): Float("1e") should fail. [ruby-core:7330] * pack.c (EXTEND32): unpack("l") did not work where sizeof(long) != 4. [ruby-talk:180024] * pack.c (pack_unpack): fixed integer overflow on template "w". [ruby-talk:180126] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9947 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- pack.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'pack.c') diff --git a/pack.c b/pack.c index f475f26f9b..b98a1209e3 100644 --- a/pack.c +++ b/pack.c @@ -345,11 +345,11 @@ num2i32(VALUE x) return 0; /* not reached */ } -#if SIZEOF_LONG == SIZE32 || SIZEOF_INT == SIZE32 +#if SIZEOF_LONG == SIZE32 # define EXTEND32(x) #else /* invariant in modulo 1<<31 */ -# define EXTEND32(x) do {if (!natint) {(x) = (I32)(((1<<31)-1-(x))^~(~0<<31));}} while(0) +# define EXTEND32(x) do { if (!natint) {(x) = (((1L<<31)-1-(x))^~(~0L<<31));}} while(0) #endif #if SIZEOF_SHORT == SIZE16 # define EXTEND16(x) @@ -1937,7 +1937,7 @@ pack_unpack(VALUE str, VALUE fmt) case 'w': { unsigned long ul = 0; - unsigned long ulmask = 0xfeL << ((sizeof(unsigned long) - 1) * 8); + unsigned long ulmask = 0xfeUL << ((sizeof(unsigned long) - 1) * 8); while (len > 0 && s < send) { ul <<= 7; -- cgit v1.2.3