summaryrefslogtreecommitdiff
path: root/enc
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-01-20 21:40:08 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-01-20 21:40:08 +0000
commita8969e999a788c880dbd72d4622ab5c8bdf738a6 (patch)
tree24f13b61066c9c370849aedc4f502afb934e6f55 /enc
parentea64014c56374043926e95906fff06b4dfcd051b (diff)
* transcode.c (transcode_dispatch): constified return value.
* transcode_data.h (rb_transcoding): include pointer to rb_transcoder and auxiliary data. * transcode_data.h (rb_transcoder): all callback functions shoud have their own parameters. * enc/trans/{japanese,single_byte}.c: constified. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15148 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'enc')
-rw-r--r--enc/trans/japanese.c16
-rw-r--r--enc/trans/single_byte.c64
2 files changed, 40 insertions, 40 deletions
diff --git a/enc/trans/japanese.c b/enc/trans/japanese.c
index 8b08f81f5d..d065d18240 100644
--- a/enc/trans/japanese.c
+++ b/enc/trans/japanese.c
@@ -4422,7 +4422,7 @@ from_SHIFT_JIS = {
from_SHIFT_JIS_offsets,
from_SHIFT_JIS_infos
};
-static rb_transcoder
+static const rb_transcoder
rb_from_SHIFT_JIS = {
"SHIFT_JIS", "UTF-8", &from_SHIFT_JIS, 3, 0,
NULL, NULL,
@@ -13352,7 +13352,7 @@ to_SHIFT_JIS = {
to_SHIFT_JIS_offsets,
to_SHIFT_JIS_infos
};
-static rb_transcoder
+static const rb_transcoder
rb_to_SHIFT_JIS = {
"UTF-8", "SHIFT_JIS", &to_SHIFT_JIS, 2, 1,
NULL, NULL,
@@ -18126,7 +18126,7 @@ from_EUC_JP = {
from_EUC_JP_offsets,
from_EUC_JP_infos
};
-static rb_transcoder
+static const rb_transcoder
rb_from_EUC_JP = {
"EUC-JP", "UTF-8", &from_EUC_JP, 3, 0,
NULL, NULL,
@@ -23631,7 +23631,7 @@ to_EUC_JP = {
to_SHIFT_JIS_offsets,
to_EUC_JP_infos
};
-static rb_transcoder
+static const rb_transcoder
rb_to_EUC_JP = {
"UTF-8", "EUC-JP", &to_EUC_JP, 2, 1,
NULL, NULL,
@@ -23721,9 +23721,9 @@ get_iso_2022_mode(char **in_pos)
static void
from_iso_2022_jp_transcoder_preprocessor(char **in_pos, char **out_pos,
char *in_stop, char *out_stop,
- rb_transcoder *my_transcoder,
rb_transcoding *my_transcoding)
{
+ const rb_transcoder *my_transcoder = my_transcoding->transcoder;
char *in_p = *in_pos, *out_p = *out_pos;
int cur_mode = ISO_2022_GZ_ASCII;
unsigned char c1;
@@ -23801,9 +23801,9 @@ select_iso_2022_mode(char **out_pos, int new_mode)
static void
to_iso_2022_jp_transcoder_postprocessor(char **in_pos, char **out_pos,
char *in_stop, char *out_stop,
- rb_transcoder *my_transcoder,
rb_transcoding *my_transcoding)
{
+ const rb_transcoder *my_transcoder = my_transcoding->transcoder;
char *in_p = *in_pos, *out_p = *out_pos;
int cur_mode = ISO_2022_GZ_ASCII, new_mode = 0;
unsigned char next_byte;
@@ -23844,13 +23844,13 @@ to_iso_2022_jp_transcoder_postprocessor(char **in_pos, char **out_pos,
*out_pos = out_p;
}
-static rb_transcoder
+static const rb_transcoder
rb_from_ISO_2022_JP = {
"ISO-2022-JP", "UTF-8", &from_EUC_JP, 8, 0,
&from_iso_2022_jp_transcoder_preprocessor, NULL,
};
-static rb_transcoder
+static const rb_transcoder
rb_to_ISO_2022_JP = {
"UTF-8", "ISO-2022-JP", &to_EUC_JP, 8, 1,
NULL, &to_iso_2022_jp_transcoder_postprocessor,
diff --git a/enc/trans/single_byte.c b/enc/trans/single_byte.c
index baa523447e..9e132b8bed 100644
--- a/enc/trans/single_byte.c
+++ b/enc/trans/single_byte.c
@@ -33,25 +33,25 @@ from_US_ASCII = {
from_US_ASCII_infos
};
-static rb_transcoder
+static const rb_transcoder
rb_from_US_ASCII = {
"US-ASCII", "UTF-8", &from_US_ASCII, 1, 0,
NULL, NULL,
};
-static rb_transcoder
+static const rb_transcoder
rb_to_US_ASCII = {
"UTF-8", "US-ASCII", &from_US_ASCII, 1, 1,
NULL, NULL,
};
-static rb_transcoder
+static const rb_transcoder
rb_from_ASCII_8BIT = {
"ASCII-8BIT", "UTF-8", &from_US_ASCII, 1, 0,
NULL, NULL,
};
-static rb_transcoder
+static const rb_transcoder
rb_to_ASCII_8BIT = {
"UTF-8", "ASCII-8BIT", &from_US_ASCII, 1, 1,
NULL, NULL,
@@ -127,7 +127,7 @@ from_ISO_8859_1 = {
from_ISO_8859_1_infos
};
-static rb_transcoder
+static const rb_transcoder
rb_from_ISO_8859_1 = {
"ISO-8859-1", "UTF-8", &from_ISO_8859_1, 2, 0,
NULL, NULL,
@@ -226,7 +226,7 @@ to_ISO_8859_1 = {
to_ISO_8859_1_infos
};
-static rb_transcoder
+static const rb_transcoder
rb_to_ISO_8859_1 = {
"UTF-8", "ISO-8859-1", &to_ISO_8859_1, 1, 1,
NULL, NULL,
@@ -274,7 +274,7 @@ from_ISO_8859_2 = {
from_ISO_8859_2_infos
};
-static rb_transcoder
+static const rb_transcoder
rb_from_ISO_8859_2 = {
"ISO-8859-2", "UTF-8", &from_ISO_8859_2, 2, 0,
NULL, NULL,
@@ -431,7 +431,7 @@ to_ISO_8859_2 = {
to_ISO_8859_2_infos
};
-static rb_transcoder
+static const rb_transcoder
rb_to_ISO_8859_2 = {
"UTF-8", "ISO-8859-2", &to_ISO_8859_2, 1, 1,
NULL, NULL,
@@ -496,7 +496,7 @@ from_ISO_8859_3 = {
from_ISO_8859_3_infos
};
-static rb_transcoder
+static const rb_transcoder
rb_from_ISO_8859_3 = {
"ISO-8859-3", "UTF-8", &from_ISO_8859_3, 2, 0,
NULL, NULL,
@@ -628,7 +628,7 @@ to_ISO_8859_3 = {
to_ISO_8859_3_infos
};
-static rb_transcoder
+static const rb_transcoder
rb_to_ISO_8859_3 = {
"UTF-8", "ISO-8859-3", &to_ISO_8859_3, 1, 1,
NULL, NULL,
@@ -676,7 +676,7 @@ from_ISO_8859_4 = {
from_ISO_8859_4_infos
};
-static rb_transcoder
+static const rb_transcoder
rb_from_ISO_8859_4 = {
"ISO-8859-4", "UTF-8", &from_ISO_8859_4, 2, 0,
NULL, NULL,
@@ -812,7 +812,7 @@ to_ISO_8859_4 = {
to_ISO_8859_4_infos
};
-static rb_transcoder
+static const rb_transcoder
rb_to_ISO_8859_4 = {
"UTF-8", "ISO-8859-4", &to_ISO_8859_4, 1, 1,
NULL, NULL,
@@ -892,7 +892,7 @@ from_ISO_8859_5 = {
from_ISO_8859_5_infos
};
-static rb_transcoder
+static const rb_transcoder
rb_from_ISO_8859_5 = {
"ISO-8859-5", "UTF-8", &from_ISO_8859_5, 3, 0,
NULL, NULL,
@@ -1044,7 +1044,7 @@ to_ISO_8859_5 = {
to_ISO_8859_5_infos
};
-static rb_transcoder
+static const rb_transcoder
rb_to_ISO_8859_5 = {
"UTF-8", "ISO-8859-5", &to_ISO_8859_5, 1, 1,
NULL, NULL,
@@ -1100,7 +1100,7 @@ from_ISO_8859_6 = {
from_ISO_8859_6_infos
};
-static rb_transcoder
+static const rb_transcoder
rb_from_ISO_8859_6 = {
"ISO-8859-6", "UTF-8", &from_ISO_8859_6, 2, 0,
NULL, NULL,
@@ -1207,7 +1207,7 @@ to_ISO_8859_6 = {
to_ISO_8859_6_infos
};
-static rb_transcoder
+static const rb_transcoder
rb_to_ISO_8859_6 = {
"UTF-8", "ISO-8859-6", &to_ISO_8859_6, 1, 1,
NULL, NULL,
@@ -1305,7 +1305,7 @@ from_ISO_8859_7 = {
from_ISO_8859_7_infos
};
-static rb_transcoder
+static const rb_transcoder
rb_from_ISO_8859_7 = {
"ISO-8859-7", "UTF-8", &from_ISO_8859_7, 3, 0,
NULL, NULL,
@@ -1492,7 +1492,7 @@ to_ISO_8859_7 = {
to_ISO_8859_7_infos
};
-static rb_transcoder
+static const rb_transcoder
rb_to_ISO_8859_7 = {
"UTF-8", "ISO-8859-7", &to_ISO_8859_7, 1, 1,
NULL, NULL,
@@ -1573,7 +1573,7 @@ from_ISO_8859_8 = {
from_ISO_8859_8_infos
};
-static rb_transcoder
+static const rb_transcoder
rb_from_ISO_8859_8 = {
"ISO-8859-8", "UTF-8", &from_ISO_8859_8, 3, 0,
NULL, NULL,
@@ -1719,7 +1719,7 @@ to_ISO_8859_8 = {
to_ISO_8859_8_infos
};
-static rb_transcoder
+static const rb_transcoder
rb_to_ISO_8859_8 = {
"UTF-8", "ISO-8859-8", &to_ISO_8859_8, 1, 1,
NULL, NULL,
@@ -1767,7 +1767,7 @@ from_ISO_8859_9 = {
from_ISO_8859_9_infos
};
-static rb_transcoder
+static const rb_transcoder
rb_from_ISO_8859_9 = {
"ISO-8859-9", "UTF-8", &from_ISO_8859_9, 2, 0,
NULL, NULL,
@@ -1870,7 +1870,7 @@ to_ISO_8859_9 = {
to_ISO_8859_9_infos
};
-static rb_transcoder
+static const rb_transcoder
rb_to_ISO_8859_9 = {
"UTF-8", "ISO-8859-9", &to_ISO_8859_9, 1, 1,
NULL, NULL,
@@ -1950,7 +1950,7 @@ from_ISO_8859_10 = {
from_ISO_8859_10_infos
};
-static rb_transcoder
+static const rb_transcoder
rb_from_ISO_8859_10 = {
"ISO-8859-10", "UTF-8", &from_ISO_8859_10, 3, 0,
NULL, NULL,
@@ -2108,7 +2108,7 @@ to_ISO_8859_10 = {
to_ISO_8859_10_infos
};
-static rb_transcoder
+static const rb_transcoder
rb_to_ISO_8859_10 = {
"UTF-8", "ISO-8859-10", &to_ISO_8859_10, 1, 1,
NULL, NULL,
@@ -2203,7 +2203,7 @@ from_ISO_8859_11 = {
from_ISO_8859_11_infos
};
-static rb_transcoder
+static const rb_transcoder
rb_from_ISO_8859_11 = {
"ISO-8859-11", "UTF-8", &from_ISO_8859_11, 3, 0,
NULL, NULL,
@@ -2337,7 +2337,7 @@ to_ISO_8859_11 = {
to_ISO_8859_11_infos
};
-static rb_transcoder
+static const rb_transcoder
rb_to_ISO_8859_11 = {
"UTF-8", "ISO-8859-11", &to_ISO_8859_11, 1, 1,
NULL, NULL,
@@ -2417,7 +2417,7 @@ from_ISO_8859_13 = {
from_ISO_8859_13_infos
};
-static rb_transcoder
+static const rb_transcoder
rb_from_ISO_8859_13 = {
"ISO-8859-13", "UTF-8", &from_ISO_8859_13, 3, 0,
NULL, NULL,
@@ -2562,7 +2562,7 @@ to_ISO_8859_13 = {
to_ISO_8859_13_infos
};
-static rb_transcoder
+static const rb_transcoder
rb_to_ISO_8859_13 = {
"UTF-8", "ISO-8859-13", &to_ISO_8859_13, 1, 1,
NULL, NULL,
@@ -2642,7 +2642,7 @@ from_ISO_8859_14 = {
from_ISO_8859_14_infos
};
-static rb_transcoder
+static const rb_transcoder
rb_from_ISO_8859_14 = {
"ISO-8859-14", "UTF-8", &from_ISO_8859_14, 3, 0,
NULL, NULL,
@@ -2864,7 +2864,7 @@ to_ISO_8859_14 = {
to_ISO_8859_14_infos
};
-static rb_transcoder
+static const rb_transcoder
rb_to_ISO_8859_14 = {
"UTF-8", "ISO-8859-14", &to_ISO_8859_14, 1, 1,
NULL, NULL,
@@ -2944,7 +2944,7 @@ from_ISO_8859_15 = {
from_ISO_8859_15_infos
};
-static rb_transcoder
+static const rb_transcoder
rb_from_ISO_8859_15 = {
"ISO-8859-15", "UTF-8", &from_ISO_8859_15, 3, 0,
NULL, NULL,
@@ -3064,7 +3064,7 @@ to_ISO_8859_15 = {
to_ISO_8859_15_infos
};
-static rb_transcoder
+static const rb_transcoder
rb_to_ISO_8859_15 = {
"UTF-8", "ISO-8859-15", &to_ISO_8859_15, 1, 1,
NULL, NULL,