ruby-changes:6590
From: mame <ko1@a...>
Date: Thu, 17 Jul 2008 20:42:33 +0900 (JST)
Subject: [ruby-changes:6590] Ruby:r18106 (trunk): * pack.c (pack_unpack): fix v and V with big endian.
mame 2008-07-17 20:42:17 +0900 (Thu, 17 Jul 2008) New Revision: 18106 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=18106 Log: * pack.c (pack_unpack): fix v and V with big endian. [1].pack("V").unpack("V") was [4294967296]. Modified files: trunk/ChangeLog trunk/pack.c Index: ChangeLog =================================================================== --- ChangeLog (revision 18105) +++ ChangeLog (revision 18106) @@ -1,3 +1,8 @@ +Thu Jul 17 20:41:42 2008 Yusuke Endoh <mame@t...> + + * pack.c (pack_unpack): fix v and V with big endian. + [1].pack("V").unpack("V") was [4294967296]. + Thu Jul 17 20:35:03 2008 Yusuke Endoh <mame@t...> * pack.c (pack_pack): fix i! with big endian. [1].pack("i!") was Index: pack.c =================================================================== --- pack.c (revision 18105) +++ pack.c (revision 18106) @@ -1617,7 +1617,7 @@ PACK_LENGTH_ADJUST(unsigned short,2); while (len-- > 0) { unsigned short tmp = 0; - memcpy(OFF16(&tmp), s, NATINT_LEN(unsigned short,2)); + memcpy(&tmp, s, NATINT_LEN(unsigned short,2)); s += NATINT_LEN(unsigned short,2); UNPACK_PUSH(UINT2NUM(vtohs(tmp))); } @@ -1628,7 +1628,7 @@ PACK_LENGTH_ADJUST(unsigned long,4); while (len-- > 0) { unsigned long tmp = 0; - memcpy(OFF32(&tmp), s, NATINT_LEN(long,4)); + memcpy(&tmp, s, NATINT_LEN(long,4)); s += NATINT_LEN(long,4); UNPACK_PUSH(ULONG2NUM(vtohl(tmp))); } -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/