summaryrefslogtreecommitdiff
path: root/pack.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1999-06-25 09:02:52 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1999-06-25 09:02:52 +0000
commit01a24da8d31dad0bd15b96a4527dbccb345c6a78 (patch)
treecd137ccc900fd4fc9d4932059aed25eed41f8c62 /pack.c
parent031d2e84df58ed54948671931544c41cf32da1ca (diff)
990625
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_3@492 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'pack.c')
-rw-r--r--pack.c11
1 files changed, 9 insertions, 2 deletions
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