diff options
| author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-09-01 17:40:32 +0000 |
|---|---|---|
| committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-09-01 17:40:32 +0000 |
| commit | 6e7f84a5d87c383badb79d6ac6a575bb72bf7f4d (patch) | |
| tree | 4caf1aa63bc2e4fe3b3ef506a074a5fd2a2cf18d /transcode.c | |
| parent | 1d6245665fb2ad4d16010d47b09a9ab11be2c552 (diff) | |
| download | ruby-6e7f84a5d87c383badb79d6ac6a575bb72bf7f4d.tar.gz ruby-6e7f84a5d87c383badb79d6ac6a575bb72bf7f4d.tar.xz ruby-6e7f84a5d87c383badb79d6ac6a575bb72bf7f4d.zip | |
* tool/transcode-tblgen.rb: record offsets array as index of
byte_array to avoid relocation.
* transcode.c (transcode_restartable0): add byte_array to get offsets
array.
* transcode_data.h (BYTE_LOOKUP_BASE): change return type to
uintptr_t.
(rb_transcoder): add fields: byte_array, word_array and word_size.
* enc/trans/newline.trans: follow rb_transcoder change.
* enc/trans/iso2022.trans: ditto.
* enc/trans/utf_16_32.trans: ditto.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19043 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'transcode.c')
| -rw-r--r-- | transcode.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/transcode.c b/transcode.c index f4409a39a..bc1597e5b 100644 --- a/transcode.c +++ b/transcode.c @@ -493,10 +493,11 @@ transcode_restartable0(const unsigned char **in_pos, unsigned char **out_pos, next_byte = (unsigned char)*in_p++; follow_byte: - if (next_byte < BYTE_LOOKUP_BASE(next_table)[0] || BYTE_LOOKUP_BASE(next_table)[1] < next_byte) +#define BL_BASE(next_table) (tr->byte_array + BYTE_LOOKUP_BASE(next_table)) + if (next_byte < BL_BASE(next_table)[0] || BL_BASE(next_table)[1] < next_byte) next_info = INVALID; else { - unsigned int next_offset = BYTE_LOOKUP_BASE(next_table)[2+next_byte-BYTE_LOOKUP_BASE(next_table)[0]]; + unsigned int next_offset = BL_BASE(next_table)[2+next_byte-BL_BASE(next_table)[0]]; next_info = (VALUE)BYTE_LOOKUP_INFO(next_table)[next_offset]; } follow_info: |
