From dde6b7dd06268221b3e6931ca7582b2da7b52403 Mon Sep 17 00:00:00 2001 From: matz Date: Fri, 8 May 1998 09:38:16 +0000 Subject: pack/unpack unsigned git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/v1_1r@204 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- pack.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'pack.c') 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; -- cgit v1.2.3