summaryrefslogtreecommitdiff
path: root/pack.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1998-05-08 09:38:16 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1998-05-08 09:38:16 +0000
commitdde6b7dd06268221b3e6931ca7582b2da7b52403 (patch)
tree0bdfde93b61d81649427e054af09fc3a7660a82d /pack.c
parent71ad3aa4ffdf0c5e8b387bb9c258ce1b66d6836e (diff)
pack/unpack unsigned
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/v1_1r@204 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'pack.c')
-rw-r--r--pack.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/pack.c b/pack.c
index 6cd644c331..8bfb771830 100644
--- a/pack.c
+++ b/pack.c
@@ -308,7 +308,7 @@ pack_pack(ary, fmt)
from = NEXTFROM;
if (NIL_P(from)) i = 0;
else {
- i = NUM2INT(from);
+ i = NUM2UINT(from);
}
str_cat(res, (UCHAR*)&i, sizeof(int));
}
@@ -322,7 +322,7 @@ pack_pack(ary, fmt)
from = NEXTFROM;
if (NIL_P(from)) l = 0;
else {
- l = NUM2INT(from);
+ l = NUM2UINT(from);
}
str_cat(res, (UCHAR*)&l, sizeof(long));
}
@@ -349,7 +349,7 @@ pack_pack(ary, fmt)
from = NEXTFROM;
if (NIL_P(from)) l = 0;
else {
- l = NUM2INT(from);
+ l = NUM2UINT(from);
}
l = htonl(l);
str_cat(res, (UCHAR*)&l, sizeof(long));
@@ -377,7 +377,7 @@ pack_pack(ary, fmt)
from = NEXTFROM;
if (NIL_P(from)) l = 0;
else {
- l = NUM2INT(from);
+ l = NUM2UINT(from);
}
l = htovl(l);
str_cat(res, (UCHAR*)&l, sizeof(long));
@@ -743,7 +743,7 @@ pack_unpack(str, fmt)
unsigned int tmp;
memcpy(&tmp, s, sizeof(int));
s += sizeof(int);
- ary_push(ary, int2inum(tmp));
+ ary_push(ary, uint2inum(tmp));
}
break;