public
Description: ruby lang (www.ruby-lang.org) svn mirror
Homepage: http://svn.ruby-lang.org/repos/ruby/
Clone URL: git://github.com/juretta/ruby.git
Search Repo:
* pack.c (pack_unpack): fix v and V with big endian.
  [1].pack("V").unpack("V") was [4294967296].


git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18106 
b2dd03c8-39d4-4d8f-98ff-823fe69b080e
mame (author)
Thu Jul 17 04:42:17 -0700 2008
commit  1cf42d35dd4e9d4fc20a6873bf389eff028b60a3
tree    5e7e28646cc7477d499930702d9915ce6d4b44d1
parent  a87a4b2a29ad7dee09b29064549ab9aa9620c286
...
 
 
 
 
 
1
2
3
...
1
2
3
4
5
6
7
8
0
@@ -1,3 +1,8 @@
0
+Thu Jul 17 20:41:42 2008 Yusuke Endoh <mame@tsg.ne.jp>
0
+
0
+ * pack.c (pack_unpack): fix v and V with big endian.
0
+ [1].pack("V").unpack("V") was [4294967296].
0
+
0
 Thu Jul 17 20:35:03 2008 Yusuke Endoh <mame@tsg.ne.jp>
0
 
0
   * pack.c (pack_pack): fix i! with big endian. [1].pack("i!") was
0
...
1617
1618
1619
1620
 
1621
1622
1623
...
1628
1629
1630
1631
 
1632
1633
1634
...
1617
1618
1619
 
1620
1621
1622
1623
...
1628
1629
1630
 
1631
1632
1633
1634
0
@@ -1617,7 +1617,7 @@ pack_unpack(VALUE str, VALUE fmt)
0
    PACK_LENGTH_ADJUST(unsigned short,2);
0
    while (len-- > 0) {
0
     unsigned short tmp = 0;
0
- memcpy(OFF16(&tmp), s, NATINT_LEN(unsigned short,2));
0
+ memcpy(&tmp, s, NATINT_LEN(unsigned short,2));
0
     s += NATINT_LEN(unsigned short,2);
0
     UNPACK_PUSH(UINT2NUM(vtohs(tmp)));
0
    }
0
@@ -1628,7 +1628,7 @@ pack_unpack(VALUE str, VALUE fmt)
0
    PACK_LENGTH_ADJUST(unsigned long,4);
0
    while (len-- > 0) {
0
     unsigned long tmp = 0;
0
- memcpy(OFF32(&tmp), s, NATINT_LEN(long,4));
0
+ memcpy(&tmp, s, NATINT_LEN(long,4));
0
     s += NATINT_LEN(long,4);
0
     UNPACK_PUSH(ULONG2NUM(vtohl(tmp)));
0
    }

Comments

    No one has commented yet.