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

ruby-changes:7568

From: akr <ko1@a...>
Date: Wed, 3 Sep 2008 21:00:12 +0900 (JST)
Subject: [ruby-changes:7568] Ruby:r19089 (trunk): * transcode.c (BYTE_ADDR): defined.

akr	2008-09-03 20:59:50 +0900 (Wed, 03 Sep 2008)

  New Revision: 19089

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

  Log:
    * transcode.c (BYTE_ADDR): defined.
      (WORD_ADDR): ditto.
      (BL_BASE): use BYTE_ADDR and WORD_ADDR.
      (BL_INFO): use WORD_ADDR.

  Modified files:
    trunk/ChangeLog
    trunk/transcode.c

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 19088)
+++ ChangeLog	(revision 19089)
@@ -1,3 +1,10 @@
+Wed Sep  3 20:58:30 2008  Tanaka Akira  <akr@f...>
+
+	* transcode.c (BYTE_ADDR): defined.
+	  (WORD_ADDR): ditto.
+	  (BL_BASE): use BYTE_ADDR and WORD_ADDR.
+	  (BL_INFO): use WORD_ADDR.
+
 Wed Sep  3 20:47:31 2008  Tanaka Akira  <akr@f...>
 
 	* transcode_data.h (rb_transcoder): new field: byte_array_length and
Index: transcode.c
===================================================================
--- transcode.c	(revision 19088)
+++ transcode.c	(revision 19089)
@@ -491,16 +491,17 @@
             continue;
         }
 
+#define BYTE_ADDR(index) (tr->byte_array + (index))
+#define WORD_ADDR(index) (tr->word_array + (index)/sizeof(*tr->word_array))
+#define BL_BASE(next_table) BYTE_ADDR(BYTE_LOOKUP_BASE(WORD_ADDR(next_table)))
+#define BL_INFO(next_table) WORD_ADDR(BYTE_LOOKUP_INFO(WORD_ADDR(next_table)))
+
 	next_byte = (unsigned char)*in_p++;
       follow_byte:
-#define BL_BASE(next_table) \
-        (tr->byte_array + BYTE_LOOKUP_BASE(tr->word_array + next_table/sizeof(*tr->word_array)))
         if (next_byte < BL_BASE(next_table)[0] || BL_BASE(next_table)[1] < next_byte)
             next_info = INVALID;
         else {
             unsigned int next_offset = BL_BASE(next_table)[2+next_byte-BL_BASE(next_table)[0]];
-#define BL_INFO(next_table) \
-            (tr->word_array + BYTE_LOOKUP_INFO(tr->word_array + next_table/sizeof(*tr->word_array))/sizeof(*tr->word_array))
             next_info = (VALUE)BL_INFO(next_table)[next_offset];
         }
       follow_info:

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

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