diff options
author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-09-03 11:59:50 +0000 |
---|---|---|
committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-09-03 11:59:50 +0000 |
commit | ac5631e6f0f39e0eb64f6b344dd05f3659ee332f (patch) | |
tree | 62ecdbc01bc787e16f14fd5f4f5183faf48107ff /transcode.c | |
parent | 4277473d5b42ae87dab2e2203c5f7602e41f9456 (diff) | |
download | ruby-ac5631e6f0f39e0eb64f6b344dd05f3659ee332f.tar.gz |
* transcode.c (BYTE_ADDR): defined.
(WORD_ADDR): ditto.
(BL_BASE): use BYTE_ADDR and WORD_ADDR.
(BL_INFO): use WORD_ADDR.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19089 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'transcode.c')
-rw-r--r-- | transcode.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/transcode.c b/transcode.c index c6c828cbb4..c68a6b9ab0 100644 --- a/transcode.c +++ b/transcode.c @@ -491,16 +491,17 @@ transcode_restartable0(const unsigned char **in_pos, unsigned char **out_pos, 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: |