summaryrefslogtreecommitdiff
path: root/enc
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-09-01 17:40:32 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-09-01 17:40:32 +0000
commit7908180df1364bc6a20cdbf2cb1365f1f0da21fa (patch)
tree4caf1aa63bc2e4fe3b3ef506a074a5fd2a2cf18d /enc
parent6c835ee50ae152daf75d4bd3a63570b7480b1c89 (diff)
* 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: svn+ssh://ci.ruby-lang.org/ruby/trunk@19043 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'enc')
-rw-r--r--enc/trans/iso2022.trans2
-rw-r--r--enc/trans/newline.trans3
-rw-r--r--enc/trans/utf_16_32.trans8
3 files changed, 13 insertions, 0 deletions
diff --git a/enc/trans/iso2022.trans b/enc/trans/iso2022.trans
index 8a94d70040..a11424c2c5 100644
--- a/enc/trans/iso2022.trans
+++ b/enc/trans/iso2022.trans
@@ -70,6 +70,7 @@ fun_so_iso2022jp_to_eucjp(rb_transcoding* t, const unsigned char* s, size_t l, u
static const rb_transcoder
rb_ISO_2022_JP_to_EUC_JP = {
"ISO-2022-JP", "EUC-JP", iso2022jp_to_eucjp,
+ byte_array, word_array, sizeof(uintptr_t),
1, /* input_unit_length */
3, /* max_input */
3, /* max_output */
@@ -142,6 +143,7 @@ finish_eucjp_to_iso2022jp(rb_transcoding *t, unsigned char *o)
static const rb_transcoder
rb_EUC_JP_to_ISO_2022_JP = {
"EUC-JP", "ISO-2022-JP", eucjp_to_iso2022jp,
+ byte_array, word_array, sizeof(uintptr_t),
1, /* input_unit_length */
3, /* max_input */
5, /* max_output */
diff --git a/enc/trans/newline.trans b/enc/trans/newline.trans
index 536cba108c..6431a7d951 100644
--- a/enc/trans/newline.trans
+++ b/enc/trans/newline.trans
@@ -55,6 +55,7 @@ fun_so_universal_newline(rb_transcoding* t, const unsigned char* s, size_t l, un
static const rb_transcoder
rb_universal_newline = {
"universal_newline", "", universal_newline,
+ byte_array, word_array, sizeof(uintptr_t),
1, /* input_unit_length */
1, /* max_input */
1, /* max_output */
@@ -65,6 +66,7 @@ rb_universal_newline = {
static const rb_transcoder
rb_crlf_newline = {
"", "crlf_newline", crlf_newline,
+ byte_array, word_array, sizeof(uintptr_t),
1, /* input_unit_length */
1, /* max_input */
2, /* max_output */
@@ -75,6 +77,7 @@ rb_crlf_newline = {
static const rb_transcoder
rb_cr_newline = {
"", "cr_newline", cr_newline,
+ byte_array, word_array, sizeof(uintptr_t),
1, /* input_unit_length */
1, /* max_input */
1, /* max_output */
diff --git a/enc/trans/utf_16_32.trans b/enc/trans/utf_16_32.trans
index 2bbee65b7f..bb6db9d5e4 100644
--- a/enc/trans/utf_16_32.trans
+++ b/enc/trans/utf_16_32.trans
@@ -262,6 +262,7 @@ fun_so_to_utf_32le(rb_transcoding* t, const unsigned char* s, size_t l, unsigned
static const rb_transcoder
rb_from_UTF_16BE = {
"UTF-16BE", "UTF-8", from_UTF_16BE,
+ byte_array, word_array, sizeof(uintptr_t),
2, /* input_unit_length */
4, /* max_input */
4, /* max_output */
@@ -272,6 +273,7 @@ rb_from_UTF_16BE = {
static const rb_transcoder
rb_to_UTF_16BE = {
"UTF-8", "UTF-16BE", to_UTF_16BE,
+ byte_array, word_array, sizeof(uintptr_t),
1, /* input_unit_length */
4, /* max_input */
4, /* max_output */
@@ -282,6 +284,7 @@ rb_to_UTF_16BE = {
static const rb_transcoder
rb_from_UTF_16LE = {
"UTF-16LE", "UTF-8", from_UTF_16LE,
+ byte_array, word_array, sizeof(uintptr_t),
2, /* input_unit_length */
4, /* max_input */
4, /* max_output */
@@ -292,6 +295,7 @@ rb_from_UTF_16LE = {
static const rb_transcoder
rb_to_UTF_16LE = {
"UTF-8", "UTF-16LE", to_UTF_16BE,
+ byte_array, word_array, sizeof(uintptr_t),
1, /* input_unit_length */
4, /* max_input */
4, /* max_output */
@@ -302,6 +306,7 @@ rb_to_UTF_16LE = {
static const rb_transcoder
rb_from_UTF_32BE = {
"UTF-32BE", "UTF-8", from_UTF_32BE,
+ byte_array, word_array, sizeof(uintptr_t),
4, /* input_unit_length */
4, /* max_input */
4, /* max_output */
@@ -312,6 +317,7 @@ rb_from_UTF_32BE = {
static const rb_transcoder
rb_to_UTF_32BE = {
"UTF-8", "UTF-32BE", to_UTF_16BE,
+ byte_array, word_array, sizeof(uintptr_t),
1, /* input_unit_length */
4, /* max_input */
4, /* max_output */
@@ -322,6 +328,7 @@ rb_to_UTF_32BE = {
static const rb_transcoder
rb_from_UTF_32LE = {
"UTF-32LE", "UTF-8", from_UTF_32LE,
+ byte_array, word_array, sizeof(uintptr_t),
4, /* input_unit_length */
4, /* max_input */
4, /* max_output */
@@ -332,6 +339,7 @@ rb_from_UTF_32LE = {
static const rb_transcoder
rb_to_UTF_32LE = {
"UTF-8", "UTF-32LE", to_UTF_16BE,
+ byte_array, word_array, sizeof(uintptr_t),
1, /* input_unit_length */
4, /* max_input */
4, /* max_output */