[前][次][番号順一覧][スレッド一覧]

ruby-changes:17524

From: naruse <ko1@a...>
Date: Mon, 18 Oct 2010 15:37:39 +0900 (JST)
Subject: [ruby-changes:17524] Ruby:r29529 (trunk): Revert r29527.

naruse	2010-10-18 15:33:50 +0900 (Mon, 18 Oct 2010)

  New Revision: 29529

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=29529

  Log:
    Revert r29527. [ruby-dev:42419]

  Modified files:
    trunk/ChangeLog
    trunk/pack.c
    trunk/test/ruby/test_pack.rb

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 29528)
+++ ChangeLog	(revision 29529)
@@ -3,13 +3,6 @@
 	* ext/digest/digest.c (rb_digest_class_init): Define
 	  Digest::Class.new(). [Feature #3954]
 
-Mon Oct 18 12:00:12 2010  NARUSE, Yui  <naruse@r...>
-
-	* pack.c (pack_pack): Add native size option ! to q and Q.
-	  [ruby-dev:42375]
-
-	* pack.c (pack_unpack): ditto.
-
 Mon Oct 18 12:58:40 2010  Tanaka Akira  <akr@f...>
 
 	* pack.c (pack_pack): refine the document.  [ruby-dev:42397]
Index: pack.c
===================================================================
--- pack.c	(revision 29528)
+++ pack.c	(revision 29529)
@@ -48,15 +48,8 @@
 
 #ifdef NATINT_PACK
 # define NATINT_LEN(type,len) (natint?(int)sizeof(type):(int)(len))
-# ifdef LONG_LONG_
-#  define NATLL_LEN() NATINT_LEN(LONG_LONG, 8);
-# else
-#  define NATLL_LEN() natint ? \
-    rb_raise(rb_eNotImpError,"this machine doesn't have long long"),0 : 8
-# endif
 #else
 # define NATINT_LEN(type,len) ((int)sizeof(type))
-# define NATLL_LEN() 8
 #endif
 
 #if SIZEOF_LONG == 8
@@ -335,26 +328,24 @@
  *      S_, S!    | Integer | unsigned short, native endian
  *      I, I_, I! | Integer | unsigned int, native endian
  *      L_, L!    | Integer | unsigned long, native endian
- *      Q_, Q!    | Integer | unsigned long long, native endian
  *                |         |
  *      s_, s!    | Integer | signed short, native endian
  *      i, i_, i! | Integer | signed int, native endian
  *      l_, l!    | Integer | signed long, native endian
- *      q_, q!    | Integer | signed long long, native endian
  *                |         |
  *      S> L> Q>  | Integer | same as the directives without ">" except
  *      s> l> q>  |         | big endian
  *      S!> I!>   |         | (available since Ruby 1.9.3)
- *      L!> Q!>   |         | "S>" is same as "n"
+ *      L!>       |         | "S>" is same as "n"
  *      s!> i!>   |         | "L>" is same as "N"
- *      l!> q!>   |         |
+ *      l!>       |         |
  *                |         |
  *      S< L< Q<  | Integer | same as the directives without "<" except
  *      s< l< q<  |         | little endian
  *      S!< I!<   |         | (available since Ruby 1.9.3)
- *      L!< Q!<   |         | "S<" is same as "v"
+ *      L!<       |         | "S<" is same as "v"
  *      s!< i!<   |         | "L<" is same as "V"
- *      l!< q!<   |         |
+ *      l!<       |         |
  *                |         |
  *      n         | Integer | 16-bit unsigned, network (big-endian) byte order
  *      N         | Integer | 32-bit unsigned, network (big-endian) byte order
@@ -446,7 +437,7 @@
 	}
 
 	{
-	    static const char natstr[] = "sSiIlLqQ";
+	    static const char natstr[] = "sSiIlL";
 	    static const char endstr[] = "sSiIlLqQ";
 
           modifiers:
@@ -720,13 +711,13 @@
 
 	  case 'q':		/* signed quad (64bit) int */
             signed_p = 1;
-	    integer_size = NATLL_LEN();
+	    integer_size = 8;
             bigendian_p = BIGENDIAN_P();
             goto pack_integer;
 
 	  case 'Q':		/* unsigned quad (64bit) int */
             signed_p = 0;
-	    integer_size = NATLL_LEN();
+	    integer_size = 8;
             bigendian_p = BIGENDIAN_P();
             goto pack_integer;
 
@@ -1401,7 +1392,7 @@
 
 	star = 0;
 	{
-	    static const char natstr[] = "sSiIlLqQ";
+	    static const char natstr[] = "sSiIlL";
 	    static const char endstr[] = "sSiIlLqQ";
 
           modifiers:
@@ -1630,13 +1621,13 @@
 
 	  case 'q':
 	    signed_p = 1;
-	    integer_size = NATLL_LEN();
+	    integer_size = 8;
 	    bigendian_p = BIGENDIAN_P();
 	    goto unpack_integer;
 
 	  case 'Q':
 	    signed_p = 0;
-	    integer_size = NATLL_LEN();
+	    integer_size = 8;
 	    bigendian_p = BIGENDIAN_P();
 	    goto unpack_integer;
 
Index: test/ruby/test_pack.rb
===================================================================
--- test/ruby/test_pack.rb	(revision 29528)
+++ test/ruby/test_pack.rb	(revision 29529)
@@ -85,9 +85,7 @@
     assert_match(/\A\x00*\x01\x02\x03\x04\z/, [0x01020304].pack("I!"+mod))
     assert_match(/\A\x00*\x01\x02\x03\x04\z/, [0x01020304].pack("l!"+mod))
     assert_match(/\A\x00*\x01\x02\x03\x04\z/, [0x01020304].pack("L!"+mod))
-    assert_match(/\A\x00*\x01\x02\x03\x04\z/, [0x01020304].pack("q!"+mod))
-    assert_match(/\A\x00*\x01\x02\x03\x04\z/, [0x01020304].pack("Q!"+mod))
-    %w[s S l L q Q s! S! i I i! I! l! L! q! Q!].each {|fmt|
+    %w[s S l L q Q s! S! i I i! I! l! L!].each {|fmt|
       fmt += mod
       nuls = [0].pack(fmt)
       v = 0
@@ -120,9 +118,7 @@
     assert_match(/\A\x04\x03\x02\x01\x00*\z/, [0x01020304].pack("I!"+mod))
     assert_match(/\A\x04\x03\x02\x01\x00*\z/, [0x01020304].pack("l!"+mod))
     assert_match(/\A\x04\x03\x02\x01\x00*\z/, [0x01020304].pack("L!"+mod))
-    assert_match(/\A\x04\x03\x02\x01\x00*\z/, [0x01020304].pack("q!"+mod))
-    assert_match(/\A\x04\x03\x02\x01\x00*\z/, [0x01020304].pack("Q!"+mod))
-    %w[s S l L q Q s! S! i I i! I! l! L! q! Q!].each {|fmt|
+    %w[s S l L q Q s! S! i I i! I! l! L!].each {|fmt|
       fmt += mod
       nuls = [0].pack(fmt)
       v = 0

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]