Skip to content

Commit b5667bd

Browse files
author
Charlie Somerville
committed
Apply encoding const patch
1 parent d813e7a commit b5667bd

File tree

10 files changed

+35
-35
lines changed

10 files changed

+35
-35
lines changed

enc/trans/emoji_iso2022_kddi.trans

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ fun_so_iso2022jp_kddi_decoder(void *statep, const unsigned char *s, size_t l, un
113113
}
114114
}
115115

116-
static const rb_transcoder
116+
static rb_transcoder
117117
rb_iso2022jp_kddi_decoder = {
118118
"ISO-2022-JP-KDDI", "stateless-ISO-2022-JP-KDDI", iso2022jp_kddi_decoder,
119119
TRANSCODE_TABLE_INFO,
@@ -194,7 +194,7 @@ finish_iso2022jp_kddi_encoder(void *statep, unsigned char *o, size_t osize)
194194
return o - output0;
195195
}
196196

197-
static const rb_transcoder
197+
static rb_transcoder
198198
rb_iso2022jp_kddi_encoder = {
199199
"stateless-ISO-2022-JP-KDDI", "ISO-2022-JP-KDDI", iso2022jp_kddi_encoder,
200200
TRANSCODE_TABLE_INFO,

enc/trans/escape.trans

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ escape_xml_attr_quote_finish(void *statep, unsigned char *o, size_t osize)
7272
return n;
7373
}
7474

75-
static const rb_transcoder
75+
static rb_transcoder
7676
rb_escape_xml_attr_quote = {
7777
"", "xml_attr_quote", escape_xml_attr_quote,
7878
TRANSCODE_TABLE_INFO,

enc/trans/gb18030.trans

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ fun_sio_to_gb18030(void *statep, const unsigned char *s, size_t l, VALUE info, u
150150
}
151151

152152

153-
static const rb_transcoder
153+
static rb_transcoder
154154
rb_from_GB18030 = {
155155
"GB18030", "UTF-8", from_GB18030,
156156
TRANSCODE_TABLE_INFO,
@@ -162,7 +162,7 @@ rb_from_GB18030 = {
162162
NULL, NULL, NULL, fun_so_from_gb18030,
163163
NULL, NULL, NULL, fun_sio_from_gb18030
164164
};
165-
static const rb_transcoder
165+
static rb_transcoder
166166
rb_to_GB18030 = {
167167
"UTF-8", "GB18030", to_GB18030,
168168
TRANSCODE_TABLE_INFO,

enc/trans/iso2022.trans

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ fun_so_iso2022jp_decoder(void *statep, const unsigned char *s, size_t l, unsigne
128128
}
129129
}
130130

131-
static const rb_transcoder
131+
static rb_transcoder
132132
rb_iso2022jp_decoder = {
133133
"ISO-2022-JP", "stateless-ISO-2022-JP", iso2022jp_decoder,
134134
TRANSCODE_TABLE_INFO,
@@ -210,7 +210,7 @@ finish_iso2022jp_encoder(void *statep, unsigned char *o, size_t osize)
210210
return o - output0;
211211
}
212212

213-
static const rb_transcoder
213+
static rb_transcoder
214214
rb_iso2022jp_encoder = {
215215
"stateless-ISO-2022-JP", "ISO-2022-JP", iso2022jp_encoder,
216216
TRANSCODE_TABLE_INFO,
@@ -232,7 +232,7 @@ fun_so_stateless_iso2022jp_to_eucjp(void *statep, const unsigned char *s, size_t
232232
return 2;
233233
}
234234

235-
static const rb_transcoder
235+
static rb_transcoder
236236
rb_stateless_iso2022jp_to_eucjp = {
237237
"stateless-ISO-2022-JP", "EUC-JP", stateless_iso2022jp_to_eucjp,
238238
TRANSCODE_TABLE_INFO,
@@ -253,7 +253,7 @@ fun_so_eucjp_to_stateless_iso2022jp(void *statep, const unsigned char *s, size_t
253253
return 3;
254254
}
255255

256-
static const rb_transcoder
256+
static rb_transcoder
257257
rb_eucjp_to_stateless_iso2022jp = {
258258
"EUC-JP", "stateless-ISO-2022-JP", eucjp_to_stateless_iso2022jp,
259259
TRANSCODE_TABLE_INFO,
@@ -357,7 +357,7 @@ fun_so_cp50221_decoder(void *statep, const unsigned char *s, size_t l, unsigned
357357
}
358358
}
359359

360-
static const rb_transcoder
360+
static rb_transcoder
361361
rb_cp50220_decoder = {
362362
"CP50220", "cp51932", cp50221_decoder,
363363
TRANSCODE_TABLE_INFO,
@@ -369,7 +369,7 @@ rb_cp50220_decoder = {
369369
NULL, fun_si_cp50221_decoder, NULL, fun_so_cp50221_decoder
370370
};
371371

372-
static const rb_transcoder
372+
static rb_transcoder
373373
rb_cp50221_decoder = {
374374
"CP50221", "cp51932", cp50221_decoder,
375375
TRANSCODE_TABLE_INFO,
@@ -429,7 +429,7 @@ fun_so_cp5022x_encoder(void *statep, const unsigned char *s, size_t l,
429429
return o - output0;
430430
}
431431

432-
static const rb_transcoder
432+
static rb_transcoder
433433
rb_cp50221_encoder = {
434434
"CP51932", "CP50221", cp50221_encoder,
435435
TRANSCODE_TABLE_INFO,
@@ -539,7 +539,7 @@ finish_cp50220_encoder(void *statep, unsigned char *o, size_t osize)
539539
return o - output0;
540540
}
541541

542-
static const rb_transcoder
542+
static rb_transcoder
543543
rb_cp50220_encoder = {
544544
"CP51932", "CP50220", cp50221_encoder,
545545
TRANSCODE_TABLE_INFO,

enc/trans/japanese.trans

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ fun_so_sjis2eucjp(void *statep, const unsigned char *s, size_t l, unsigned char
6666
}
6767
}
6868

69-
static const rb_transcoder
69+
static rb_transcoder
7070
rb_eucjp2sjis = {
7171
"EUC-JP", "Shift_JIS", eucjp2sjis,
7272
TRANSCODE_TABLE_INFO,
@@ -78,7 +78,7 @@ rb_eucjp2sjis = {
7878
NULL, NULL, NULL, fun_so_eucjp2sjis
7979
};
8080

81-
static const rb_transcoder
81+
static rb_transcoder
8282
rb_sjis2eucjp = {
8383
"Shift_JIS", "EUC-JP", sjis2eucjp,
8484
TRANSCODE_TABLE_INFO,

enc/trans/newline.trans

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ universal_newline_finish(void *statep, unsigned char *o, size_t osize)
8989
return len;
9090
}
9191

92-
static const rb_transcoder
92+
static rb_transcoder
9393
rb_universal_newline = {
9494
"", "universal_newline", universal_newline,
9595
TRANSCODE_TABLE_INFO,
@@ -102,7 +102,7 @@ rb_universal_newline = {
102102
universal_newline_finish
103103
};
104104

105-
static const rb_transcoder
105+
static rb_transcoder
106106
rb_crlf_newline = {
107107
"", "crlf_newline", crlf_newline,
108108
TRANSCODE_TABLE_INFO,
@@ -114,7 +114,7 @@ rb_crlf_newline = {
114114
NULL, NULL, NULL, NULL
115115
};
116116

117-
static const rb_transcoder
117+
static rb_transcoder
118118
rb_cr_newline = {
119119
"", "cr_newline", cr_newline,
120120
TRANSCODE_TABLE_INFO,

enc/trans/utf8_mac.trans

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ fun_so_from_utf8_mac(void *statep,
220220
return buf_output_char(sp, o);
221221
}
222222

223-
static const rb_transcoder
223+
static rb_transcoder
224224
rb_from_UTF8_MAC = {
225225
"UTF8-MAC", "UTF-8", from_UTF8_MAC,
226226
TRANSCODE_TABLE_INFO,

enc/trans/utf_16_32.trans

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,7 @@ fun_so_to_utf_32(void *statep, const unsigned char *s, size_t l, unsigned char *
395395
return fun_so_to_utf_32be(statep, s, l, o, osize);
396396
}
397397

398-
static const rb_transcoder
398+
static rb_transcoder
399399
rb_from_UTF_16BE = {
400400
"UTF-16BE", "UTF-8", from_UTF_16BE,
401401
TRANSCODE_TABLE_INFO,
@@ -407,7 +407,7 @@ rb_from_UTF_16BE = {
407407
NULL, NULL, NULL, fun_so_from_utf_16be
408408
};
409409

410-
static const rb_transcoder
410+
static rb_transcoder
411411
rb_to_UTF_16BE = {
412412
"UTF-8", "UTF-16BE", from_UTF_8,
413413
TRANSCODE_TABLE_INFO,
@@ -419,7 +419,7 @@ rb_to_UTF_16BE = {
419419
NULL, NULL, NULL, fun_so_to_utf_16be
420420
};
421421

422-
static const rb_transcoder
422+
static rb_transcoder
423423
rb_from_UTF_16LE = {
424424
"UTF-16LE", "UTF-8", from_UTF_16LE,
425425
TRANSCODE_TABLE_INFO,
@@ -431,7 +431,7 @@ rb_from_UTF_16LE = {
431431
NULL, NULL, NULL, fun_so_from_utf_16le
432432
};
433433

434-
static const rb_transcoder
434+
static rb_transcoder
435435
rb_to_UTF_16LE = {
436436
"UTF-8", "UTF-16LE", from_UTF_8,
437437
TRANSCODE_TABLE_INFO,
@@ -443,7 +443,7 @@ rb_to_UTF_16LE = {
443443
NULL, NULL, NULL, fun_so_to_utf_16le
444444
};
445445

446-
static const rb_transcoder
446+
static rb_transcoder
447447
rb_from_UTF_32BE = {
448448
"UTF-32BE", "UTF-8", from_UTF_32BE,
449449
TRANSCODE_TABLE_INFO,
@@ -455,7 +455,7 @@ rb_from_UTF_32BE = {
455455
NULL, NULL, NULL, fun_so_from_utf_32be
456456
};
457457

458-
static const rb_transcoder
458+
static rb_transcoder
459459
rb_to_UTF_32BE = {
460460
"UTF-8", "UTF-32BE", from_UTF_8,
461461
TRANSCODE_TABLE_INFO,
@@ -467,7 +467,7 @@ rb_to_UTF_32BE = {
467467
NULL, NULL, NULL, fun_so_to_utf_32be
468468
};
469469

470-
static const rb_transcoder
470+
static rb_transcoder
471471
rb_from_UTF_32LE = {
472472
"UTF-32LE", "UTF-8", from_UTF_32LE,
473473
TRANSCODE_TABLE_INFO,
@@ -479,7 +479,7 @@ rb_from_UTF_32LE = {
479479
NULL, NULL, NULL, fun_so_from_utf_32le
480480
};
481481

482-
static const rb_transcoder
482+
static rb_transcoder
483483
rb_to_UTF_32LE = {
484484
"UTF-8", "UTF-32LE", from_UTF_8,
485485
TRANSCODE_TABLE_INFO,
@@ -491,7 +491,7 @@ rb_to_UTF_32LE = {
491491
NULL, NULL, NULL, fun_so_to_utf_32le
492492
};
493493

494-
static const rb_transcoder
494+
static rb_transcoder
495495
rb_from_UTF_16 = {
496496
"UTF-16", "UTF-8", from_UTF_16,
497497
TRANSCODE_TABLE_INFO,
@@ -503,7 +503,7 @@ rb_from_UTF_16 = {
503503
NULL, fun_si_from_utf_16, NULL, fun_so_from_utf_16
504504
};
505505

506-
static const rb_transcoder
506+
static rb_transcoder
507507
rb_from_UTF_32 = {
508508
"UTF-32", "UTF-8", from_UTF_32,
509509
TRANSCODE_TABLE_INFO,
@@ -515,7 +515,7 @@ rb_from_UTF_32 = {
515515
NULL, fun_si_from_utf_32, NULL, fun_so_from_utf_32
516516
};
517517

518-
static const rb_transcoder
518+
static rb_transcoder
519519
rb_to_UTF_16 = {
520520
"UTF-8", "UTF-16", from_UTF_8,
521521
TRANSCODE_TABLE_INFO,
@@ -527,7 +527,7 @@ rb_to_UTF_16 = {
527527
NULL, NULL, NULL, fun_so_to_utf_16
528528
};
529529

530-
static const rb_transcoder
530+
static rb_transcoder
531531
rb_to_UTF_32 = {
532532
"UTF-8", "UTF-32", from_UTF_8,
533533
TRANSCODE_TABLE_INFO,

template/transdb.h.tmpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<%
22
#
3-
# static const rb_transcoder
3+
# static rb_transcoder
44
# rb_from_US_ASCII = {
55
# "US-ASCII", "UTF-8", &from_US_ASCII, 1, 0,
66
# NULL, NULL,
@@ -37,7 +37,7 @@ transdirs.each do |transdir|
3737
path = File.join(transdir,fn)
3838
open(path) do |f|
3939
f.each_line do |line|
40-
if (/^static const rb_transcoder/ =~ line)..(/"(.*?)"\s*,\s*"(.*?)"/ =~ line)
40+
if (/^static rb_transcoder/ =~ line)..(/"(.*?)"\s*,\s*"(.*?)"/ =~ line)
4141
if $1 && $2
4242
from_to = "%s to %s" % [$1, $2]
4343
if converters[from_to]

tool/transcode-tblgen.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ def insert_at_last(num, str)
6868

6969
def to_s
7070
<<"End"
71-
static const #{@type}
71+
static #{@type}
7272
#{@name}[#{@len}] = {
7373
#{@content}};
7474
End
@@ -847,7 +847,7 @@ def transcode_tblgen(from, to, map, valid_encoding=UnspecifiedValidEncoding)
847847
input_unit_length = UnitLength[from]
848848
max_output = map.map {|k,v| String === v ? v.length/2 : 1 }.max
849849
transcoder_code = <<"End"
850-
static const rb_transcoder
850+
static rb_transcoder
851851
#{transcoder_name} = {
852852
#{c_esc from}, #{c_esc to}, #{real_tree_name},
853853
TRANSCODE_TABLE_INFO,

0 commit comments

Comments
 (0)