From 01a24da8d31dad0bd15b96a4527dbccb345c6a78 Mon Sep 17 00:00:00 2001 From: matz Date: Fri, 25 Jun 1999 09:02:52 +0000 Subject: 990625 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_3@492 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- pack.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'pack.c') diff --git a/pack.c b/pack.c index b9988830a6..5461aaddc1 100644 --- a/pack.c +++ b/pack.c @@ -984,7 +984,7 @@ hex2num(c) #ifdef NATINT_PACK #define PACK_LENGTH_ADJUST(type,sz) do { \ - int t__len = NATINT_LEN((type),(sz)); \ + int t__len = NATINT_LEN(type,(sz)); \ tmp = 0; \ if (len > (send-s)/t__len) { \ if (!star) { \ @@ -1018,7 +1018,7 @@ pack_unpack(str, fmt) char type; int len, tmp, star; #ifdef NATINT_PACK - int natint; /* native integer */ + int natint; /* native integer */ #endif s = str2cstr(str, &len); @@ -1028,6 +1028,9 @@ pack_unpack(str, fmt) ary = rb_ary_new(); while (p < pend) { +#ifdef NATINT_PACK + natint = 0; +#endif star = 0; type = *p++; if (*p == '_') { @@ -1630,7 +1633,9 @@ uv_to_utf8(buf, uv) buf[5] = (uv&0x3f)|0x80; return 6; } +#if SIZEOF_LONG > 4 if (uv <= 0xfffffffff) { +#endif buf[0] = 0xfe; buf[1] = ((uv>>30)&0x3f)|0x80; buf[2] = ((uv>>24)&0x3f)|0x80; @@ -1639,8 +1644,10 @@ uv_to_utf8(buf, uv) buf[5] = ((uv>>6)&0x3f)|0x80; buf[6] = (uv&0x3f)|0x80; return 7; +#if SIZEOF_LONG > 4 } rb_raise(rb_eArgError, "uv_to_utf8(); too big value"); +#endif } static unsigned long -- cgit v1.2.3