From 7b152990b6c420df785ce9d5d1fd46571802152f Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Fri, 9 Aug 2019 16:33:21 +0200 Subject: [PATCH] Don't short-circuit MBFL_OUTPUTFILTER_ILLEGAL_MODE_NONE Make sure we always go through mbfl_filt_conv_illegal_output(), so that the number of illegal characters gets counted. --- .../libmbfl/filters/mbfilter_armscii8.c | 4 +--- ext/mbstring/libmbfl/filters/mbfilter_ascii.c | 4 +--- ext/mbstring/libmbfl/filters/mbfilter_big5.c | 4 +--- .../libmbfl/filters/mbfilter_cp1251.c | 4 +--- .../libmbfl/filters/mbfilter_cp1252.c | 4 +--- .../libmbfl/filters/mbfilter_cp1254.c | 4 +--- .../libmbfl/filters/mbfilter_cp5022x.c | 20 +++++-------------- .../libmbfl/filters/mbfilter_cp51932.c | 6 +----- ext/mbstring/libmbfl/filters/mbfilter_cp850.c | 4 +--- ext/mbstring/libmbfl/filters/mbfilter_cp866.c | 4 +--- ext/mbstring/libmbfl/filters/mbfilter_cp932.c | 4 +--- ext/mbstring/libmbfl/filters/mbfilter_cp936.c | 4 +--- .../libmbfl/filters/mbfilter_euc_cn.c | 4 +--- .../libmbfl/filters/mbfilter_euc_jp.c | 4 +--- .../libmbfl/filters/mbfilter_euc_jp_win.c | 4 +--- .../libmbfl/filters/mbfilter_euc_kr.c | 4 +--- .../libmbfl/filters/mbfilter_euc_tw.c | 4 +--- .../libmbfl/filters/mbfilter_gb18030.c | 4 +--- ext/mbstring/libmbfl/filters/mbfilter_hz.c | 4 +--- .../libmbfl/filters/mbfilter_iso2022_jp_ms.c | 4 +--- .../libmbfl/filters/mbfilter_iso2022_kr.c | 4 +--- .../filters/mbfilter_iso2022jp_mobile.c | 4 +--- .../libmbfl/filters/mbfilter_iso8859_1.c | 4 +--- .../libmbfl/filters/mbfilter_iso8859_10.c | 4 +--- .../libmbfl/filters/mbfilter_iso8859_13.c | 4 +--- .../libmbfl/filters/mbfilter_iso8859_14.c | 4 +--- .../libmbfl/filters/mbfilter_iso8859_15.c | 4 +--- .../libmbfl/filters/mbfilter_iso8859_16.c | 4 +--- .../libmbfl/filters/mbfilter_iso8859_2.c | 4 +--- .../libmbfl/filters/mbfilter_iso8859_3.c | 4 +--- .../libmbfl/filters/mbfilter_iso8859_4.c | 4 +--- .../libmbfl/filters/mbfilter_iso8859_5.c | 4 +--- .../libmbfl/filters/mbfilter_iso8859_6.c | 4 +--- .../libmbfl/filters/mbfilter_iso8859_7.c | 4 +--- .../libmbfl/filters/mbfilter_iso8859_8.c | 4 +--- .../libmbfl/filters/mbfilter_iso8859_9.c | 4 +--- ext/mbstring/libmbfl/filters/mbfilter_jis.c | 8 ++------ ext/mbstring/libmbfl/filters/mbfilter_koi8r.c | 4 +--- ext/mbstring/libmbfl/filters/mbfilter_koi8u.c | 4 +--- ext/mbstring/libmbfl/filters/mbfilter_sjis.c | 4 +--- .../libmbfl/filters/mbfilter_sjis_2004.c | 4 +--- .../libmbfl/filters/mbfilter_sjis_mac.c | 16 ++++++--------- .../libmbfl/filters/mbfilter_sjis_mobile.c | 4 +--- .../libmbfl/filters/mbfilter_sjis_open.c | 4 +--- ext/mbstring/libmbfl/filters/mbfilter_ucs2.c | 8 ++------ ext/mbstring/libmbfl/filters/mbfilter_ucs4.c | 8 ++------ ext/mbstring/libmbfl/filters/mbfilter_uhc.c | 4 +--- ext/mbstring/libmbfl/filters/mbfilter_utf16.c | 8 ++------ ext/mbstring/libmbfl/filters/mbfilter_utf32.c | 8 ++------ ext/mbstring/libmbfl/filters/mbfilter_utf7.c | 4 +--- .../libmbfl/filters/mbfilter_utf7imap.c | 4 +--- ext/mbstring/libmbfl/filters/mbfilter_utf8.c | 4 +--- .../libmbfl/filters/mbfilter_utf8_mobile.c | 4 +--- ext/mbstring/libmbfl/mbfl/mbfl_convert.c | 1 + 54 files changed, 68 insertions(+), 195 deletions(-) diff --git a/ext/mbstring/libmbfl/filters/mbfilter_armscii8.c b/ext/mbstring/libmbfl/filters/mbfilter_armscii8.c index bfe3763f18..599c1485fb 100644 --- a/ext/mbstring/libmbfl/filters/mbfilter_armscii8.c +++ b/ext/mbstring/libmbfl/filters/mbfilter_armscii8.c @@ -133,9 +133,7 @@ int mbfl_filt_conv_wchar_armscii8(int c, mbfl_convert_filter *filter) if (s >= 0) { CK((*filter->output_function)(s, filter->data)); } else { - if (filter->illegal_mode != MBFL_OUTPUTFILTER_ILLEGAL_MODE_NONE) { - CK(mbfl_filt_conv_illegal_output(c, filter)); - } + CK(mbfl_filt_conv_illegal_output(c, filter)); } return c; diff --git a/ext/mbstring/libmbfl/filters/mbfilter_ascii.c b/ext/mbstring/libmbfl/filters/mbfilter_ascii.c index b3c1161d32..71bd5b46fa 100644 --- a/ext/mbstring/libmbfl/filters/mbfilter_ascii.c +++ b/ext/mbstring/libmbfl/filters/mbfilter_ascii.c @@ -94,9 +94,7 @@ int mbfl_filt_conv_wchar_ascii(int c, mbfl_convert_filter *filter) if (c >= 0 && c < 0x80) { CK((*filter->output_function)(c, filter->data)); } else { - if (filter->illegal_mode != MBFL_OUTPUTFILTER_ILLEGAL_MODE_NONE) { - CK(mbfl_filt_conv_illegal_output(c, filter)); - } + CK(mbfl_filt_conv_illegal_output(c, filter)); } return c; diff --git a/ext/mbstring/libmbfl/filters/mbfilter_big5.c b/ext/mbstring/libmbfl/filters/mbfilter_big5.c index c2cb9a1005..0fc57d62b1 100644 --- a/ext/mbstring/libmbfl/filters/mbfilter_big5.c +++ b/ext/mbstring/libmbfl/filters/mbfilter_big5.c @@ -319,9 +319,7 @@ mbfl_filt_conv_wchar_big5(int c, mbfl_convert_filter *filter) CK((*filter->output_function)(s & 0xff, filter->data)); } } else { - if (filter->illegal_mode != MBFL_OUTPUTFILTER_ILLEGAL_MODE_NONE) { - CK(mbfl_filt_conv_illegal_output(c, filter)); - } + CK(mbfl_filt_conv_illegal_output(c, filter)); } return c; diff --git a/ext/mbstring/libmbfl/filters/mbfilter_cp1251.c b/ext/mbstring/libmbfl/filters/mbfilter_cp1251.c index 13a2b222ed..fec1b6f807 100644 --- a/ext/mbstring/libmbfl/filters/mbfilter_cp1251.c +++ b/ext/mbstring/libmbfl/filters/mbfilter_cp1251.c @@ -133,9 +133,7 @@ mbfl_filt_conv_wchar_cp1251(int c, mbfl_convert_filter *filter) if (s >= 0) { CK((*filter->output_function)(s, filter->data)); } else { - if (filter->illegal_mode != MBFL_OUTPUTFILTER_ILLEGAL_MODE_NONE) { - CK(mbfl_filt_conv_illegal_output(c, filter)); - } + CK(mbfl_filt_conv_illegal_output(c, filter)); } return c; diff --git a/ext/mbstring/libmbfl/filters/mbfilter_cp1252.c b/ext/mbstring/libmbfl/filters/mbfilter_cp1252.c index 7c628da2f3..a668364a5b 100644 --- a/ext/mbstring/libmbfl/filters/mbfilter_cp1252.c +++ b/ext/mbstring/libmbfl/filters/mbfilter_cp1252.c @@ -106,9 +106,7 @@ int mbfl_filt_conv_wchar_cp1252(int c, mbfl_convert_filter *filter) if (s >= 0) { CK((*filter->output_function)(s, filter->data)); } else { - if (filter->illegal_mode != MBFL_OUTPUTFILTER_ILLEGAL_MODE_NONE) { - CK(mbfl_filt_conv_illegal_output(c, filter)); - } + CK(mbfl_filt_conv_illegal_output(c, filter)); } return c; } diff --git a/ext/mbstring/libmbfl/filters/mbfilter_cp1254.c b/ext/mbstring/libmbfl/filters/mbfilter_cp1254.c index ae63aed6e1..89fc4b6f59 100644 --- a/ext/mbstring/libmbfl/filters/mbfilter_cp1254.c +++ b/ext/mbstring/libmbfl/filters/mbfilter_cp1254.c @@ -105,9 +105,7 @@ mbfl_filt_conv_wchar_cp1254(int c, mbfl_convert_filter *filter) if (s >= 0) { CK((*filter->output_function)(s, filter->data)); } else { - if (filter->illegal_mode != MBFL_OUTPUTFILTER_ILLEGAL_MODE_NONE) { - CK(mbfl_filt_conv_illegal_output(c, filter)); - } + CK(mbfl_filt_conv_illegal_output(c, filter)); } return c; diff --git a/ext/mbstring/libmbfl/filters/mbfilter_cp5022x.c b/ext/mbstring/libmbfl/filters/mbfilter_cp5022x.c index c6012ff682..dd3d1949fa 100644 --- a/ext/mbstring/libmbfl/filters/mbfilter_cp5022x.c +++ b/ext/mbstring/libmbfl/filters/mbfilter_cp5022x.c @@ -563,9 +563,7 @@ mbfl_filt_conv_wchar_jis_ms(int c, mbfl_convert_filter *filter) CK((*filter->output_function)(s & 0x7f, filter->data)); } } else { - if (filter->illegal_mode != MBFL_OUTPUTFILTER_ILLEGAL_MODE_NONE) { - CK(mbfl_filt_conv_illegal_output(c, filter)); - } + CK(mbfl_filt_conv_illegal_output(c, filter)); } return c; @@ -776,9 +774,7 @@ mbfl_filt_conv_wchar_cp50221(int c, mbfl_convert_filter *filter) CK((*filter->output_function)((s >> 8) & 0x7f, filter->data)); CK((*filter->output_function)(s & 0x7f, filter->data)); } else if (s < 0x10000) { /* X0212 */ - if (filter->illegal_mode != MBFL_OUTPUTFILTER_ILLEGAL_MODE_NONE) { - CK(mbfl_filt_conv_illegal_output(c, filter)); - } + CK(mbfl_filt_conv_illegal_output(c, filter)); } else { /* X 0201 latin */ if ((filter->status & 0xff00) != 0x400) { CK((*filter->output_function)(0x1b, filter->data)); /* ESC */ @@ -789,9 +785,7 @@ mbfl_filt_conv_wchar_cp50221(int c, mbfl_convert_filter *filter) CK((*filter->output_function)(s & 0x7f, filter->data)); } } else { - if (filter->illegal_mode != MBFL_OUTPUTFILTER_ILLEGAL_MODE_NONE) { - CK(mbfl_filt_conv_illegal_output(c, filter)); - } + CK(mbfl_filt_conv_illegal_output(c, filter)); } return c; @@ -928,9 +922,7 @@ mbfl_filt_conv_wchar_cp50222(int c, mbfl_convert_filter *filter) CK((*filter->output_function)((s >> 8) & 0x7f, filter->data)); CK((*filter->output_function)(s & 0x7f, filter->data)); } else if (s < 0x10000) { /* X0212 */ - if (filter->illegal_mode != MBFL_OUTPUTFILTER_ILLEGAL_MODE_NONE) { - CK(mbfl_filt_conv_illegal_output(c, filter)); - } + CK(mbfl_filt_conv_illegal_output(c, filter)); } else { /* X 0201 latin */ if ((filter->status & 0xff00) == 0x500) { CK((*filter->output_function)(0x0f, filter->data)); /* SO */ @@ -945,9 +937,7 @@ mbfl_filt_conv_wchar_cp50222(int c, mbfl_convert_filter *filter) CK((*filter->output_function)(s & 0x7f, filter->data)); } } else { - if (filter->illegal_mode != MBFL_OUTPUTFILTER_ILLEGAL_MODE_NONE) { - CK(mbfl_filt_conv_illegal_output(c, filter)); - } + CK(mbfl_filt_conv_illegal_output(c, filter)); } return c; diff --git a/ext/mbstring/libmbfl/filters/mbfilter_cp51932.c b/ext/mbstring/libmbfl/filters/mbfilter_cp51932.c index 8b931ba6d0..189feb2141 100644 --- a/ext/mbstring/libmbfl/filters/mbfilter_cp51932.c +++ b/ext/mbstring/libmbfl/filters/mbfilter_cp51932.c @@ -294,14 +294,10 @@ mbfl_filt_conv_wchar_cp51932(int c, mbfl_convert_filter *filter) CK((*filter->output_function)(((s1 >> 8) & 0xff) | 0x80, filter->data)); CK((*filter->output_function)((s1 & 0xff) | 0x80, filter->data)); } else { - if (filter->illegal_mode != MBFL_OUTPUTFILTER_ILLEGAL_MODE_NONE) { CK(mbfl_filt_conv_illegal_output(c, filter)); - } } } else { - if (filter->illegal_mode != MBFL_OUTPUTFILTER_ILLEGAL_MODE_NONE) { - CK(mbfl_filt_conv_illegal_output(c, filter)); - } + CK(mbfl_filt_conv_illegal_output(c, filter)); } return c; diff --git a/ext/mbstring/libmbfl/filters/mbfilter_cp850.c b/ext/mbstring/libmbfl/filters/mbfilter_cp850.c index 9f47664fbe..38f42b8695 100644 --- a/ext/mbstring/libmbfl/filters/mbfilter_cp850.c +++ b/ext/mbstring/libmbfl/filters/mbfilter_cp850.c @@ -129,9 +129,7 @@ mbfl_filt_conv_wchar_cp850(int c, mbfl_convert_filter *filter) if (s >= 0) { CK((*filter->output_function)(s, filter->data)); } else { - if (filter->illegal_mode != MBFL_OUTPUTFILTER_ILLEGAL_MODE_NONE) { - CK(mbfl_filt_conv_illegal_output(c, filter)); - } + CK(mbfl_filt_conv_illegal_output(c, filter)); } return c; diff --git a/ext/mbstring/libmbfl/filters/mbfilter_cp866.c b/ext/mbstring/libmbfl/filters/mbfilter_cp866.c index c4668dcd57..6f2d602112 100644 --- a/ext/mbstring/libmbfl/filters/mbfilter_cp866.c +++ b/ext/mbstring/libmbfl/filters/mbfilter_cp866.c @@ -133,9 +133,7 @@ mbfl_filt_conv_wchar_cp866(int c, mbfl_convert_filter *filter) if (s >= 0) { CK((*filter->output_function)(s, filter->data)); } else { - if (filter->illegal_mode != MBFL_OUTPUTFILTER_ILLEGAL_MODE_NONE) { - CK(mbfl_filt_conv_illegal_output(c, filter)); - } + CK(mbfl_filt_conv_illegal_output(c, filter)); } return c; diff --git a/ext/mbstring/libmbfl/filters/mbfilter_cp932.c b/ext/mbstring/libmbfl/filters/mbfilter_cp932.c index d4936d9dcd..dcadc4eaa7 100644 --- a/ext/mbstring/libmbfl/filters/mbfilter_cp932.c +++ b/ext/mbstring/libmbfl/filters/mbfilter_cp932.c @@ -321,9 +321,7 @@ mbfl_filt_conv_wchar_cp932(int c, mbfl_convert_filter *filter) CK((*filter->output_function)(s2, filter->data)); } } else { - if (filter->illegal_mode != MBFL_OUTPUTFILTER_ILLEGAL_MODE_NONE) { - CK(mbfl_filt_conv_illegal_output(c, filter)); - } + CK(mbfl_filt_conv_illegal_output(c, filter)); } return c; diff --git a/ext/mbstring/libmbfl/filters/mbfilter_cp936.c b/ext/mbstring/libmbfl/filters/mbfilter_cp936.c index 047eb62a14..95eb6e8015 100644 --- a/ext/mbstring/libmbfl/filters/mbfilter_cp936.c +++ b/ext/mbstring/libmbfl/filters/mbfilter_cp936.c @@ -281,9 +281,7 @@ mbfl_filt_conv_wchar_cp936(int c, mbfl_convert_filter *filter) CK((*filter->output_function)(s & 0xff, filter->data)); } } else { - if (filter->illegal_mode != MBFL_OUTPUTFILTER_ILLEGAL_MODE_NONE) { - CK(mbfl_filt_conv_illegal_output(c, filter)); - } + CK(mbfl_filt_conv_illegal_output(c, filter)); } return c; diff --git a/ext/mbstring/libmbfl/filters/mbfilter_euc_cn.c b/ext/mbstring/libmbfl/filters/mbfilter_euc_cn.c index 08be6f3298..13a14855ec 100644 --- a/ext/mbstring/libmbfl/filters/mbfilter_euc_cn.c +++ b/ext/mbstring/libmbfl/filters/mbfilter_euc_cn.c @@ -207,9 +207,7 @@ mbfl_filt_conv_wchar_euccn(int c, mbfl_convert_filter *filter) CK((*filter->output_function)(s & 0xff, filter->data)); } } else { - if (filter->illegal_mode != MBFL_OUTPUTFILTER_ILLEGAL_MODE_NONE) { - CK(mbfl_filt_conv_illegal_output(c, filter)); - } + CK(mbfl_filt_conv_illegal_output(c, filter)); } return c; diff --git a/ext/mbstring/libmbfl/filters/mbfilter_euc_jp.c b/ext/mbstring/libmbfl/filters/mbfilter_euc_jp.c index 1d98873976..aeeac851e4 100644 --- a/ext/mbstring/libmbfl/filters/mbfilter_euc_jp.c +++ b/ext/mbstring/libmbfl/filters/mbfilter_euc_jp.c @@ -269,9 +269,7 @@ mbfl_filt_conv_wchar_eucjp(int c, mbfl_convert_filter *filter) CK((*filter->output_function)((s & 0xff) | 0x80, filter->data)); } } else { - if (filter->illegal_mode != MBFL_OUTPUTFILTER_ILLEGAL_MODE_NONE) { - CK(mbfl_filt_conv_illegal_output(c, filter)); - } + CK(mbfl_filt_conv_illegal_output(c, filter)); } return c; diff --git a/ext/mbstring/libmbfl/filters/mbfilter_euc_jp_win.c b/ext/mbstring/libmbfl/filters/mbfilter_euc_jp_win.c index 20e0651554..4c26e38fa8 100644 --- a/ext/mbstring/libmbfl/filters/mbfilter_euc_jp_win.c +++ b/ext/mbstring/libmbfl/filters/mbfilter_euc_jp_win.c @@ -373,9 +373,7 @@ mbfl_filt_conv_wchar_eucjpwin(int c, mbfl_convert_filter *filter) CK((*filter->output_function)((s1 & 0xff) | 0x80, filter->data)); } } else { - if (filter->illegal_mode != MBFL_OUTPUTFILTER_ILLEGAL_MODE_NONE) { - CK(mbfl_filt_conv_illegal_output(c, filter)); - } + CK(mbfl_filt_conv_illegal_output(c, filter)); } return c; diff --git a/ext/mbstring/libmbfl/filters/mbfilter_euc_kr.c b/ext/mbstring/libmbfl/filters/mbfilter_euc_kr.c index ee8dc926f0..8509ef4dd2 100644 --- a/ext/mbstring/libmbfl/filters/mbfilter_euc_kr.c +++ b/ext/mbstring/libmbfl/filters/mbfilter_euc_kr.c @@ -221,9 +221,7 @@ mbfl_filt_conv_wchar_euckr(int c, mbfl_convert_filter *filter) CK((*filter->output_function)(s & 0xff, filter->data)); } } else { - if (filter->illegal_mode != MBFL_OUTPUTFILTER_ILLEGAL_MODE_NONE) { - CK(mbfl_filt_conv_illegal_output(c, filter)); - } + CK(mbfl_filt_conv_illegal_output(c, filter)); } return c; diff --git a/ext/mbstring/libmbfl/filters/mbfilter_euc_tw.c b/ext/mbstring/libmbfl/filters/mbfilter_euc_tw.c index 141a2fee7c..290d8b83fb 100644 --- a/ext/mbstring/libmbfl/filters/mbfilter_euc_tw.c +++ b/ext/mbstring/libmbfl/filters/mbfilter_euc_tw.c @@ -270,9 +270,7 @@ mbfl_filt_conv_wchar_euctw(int c, mbfl_convert_filter *filter) CK((*filter->output_function)(s & 0xff, filter->data)); } } else { - if (filter->illegal_mode != MBFL_OUTPUTFILTER_ILLEGAL_MODE_NONE) { - CK(mbfl_filt_conv_illegal_output(c, filter)); - } + CK(mbfl_filt_conv_illegal_output(c, filter)); } return c; } diff --git a/ext/mbstring/libmbfl/filters/mbfilter_gb18030.c b/ext/mbstring/libmbfl/filters/mbfilter_gb18030.c index 6369542e2e..f8d2e1954a 100644 --- a/ext/mbstring/libmbfl/filters/mbfilter_gb18030.c +++ b/ext/mbstring/libmbfl/filters/mbfilter_gb18030.c @@ -412,9 +412,7 @@ mbfl_filt_conv_wchar_gb18030(int c, mbfl_convert_filter *filter) CK((*filter->output_function)(s & 0xff, filter->data)); } } else { - if (filter->illegal_mode != MBFL_OUTPUTFILTER_ILLEGAL_MODE_NONE) { - CK(mbfl_filt_conv_illegal_output(c, filter)); - } + CK(mbfl_filt_conv_illegal_output(c, filter)); } return c; diff --git a/ext/mbstring/libmbfl/filters/mbfilter_hz.c b/ext/mbstring/libmbfl/filters/mbfilter_hz.c index 570fcb4fff..0e360726ed 100644 --- a/ext/mbstring/libmbfl/filters/mbfilter_hz.c +++ b/ext/mbstring/libmbfl/filters/mbfilter_hz.c @@ -211,9 +211,7 @@ mbfl_filt_conv_wchar_hz(int c, mbfl_convert_filter *filter) CK((*filter->output_function)(s & 0x7f, filter->data)); } } else { - if (filter->illegal_mode != MBFL_OUTPUTFILTER_ILLEGAL_MODE_NONE) { - CK(mbfl_filt_conv_illegal_output(c, filter)); - } + CK(mbfl_filt_conv_illegal_output(c, filter)); } return c; diff --git a/ext/mbstring/libmbfl/filters/mbfilter_iso2022_jp_ms.c b/ext/mbstring/libmbfl/filters/mbfilter_iso2022_jp_ms.c index 4e8b974923..cec21c26f2 100644 --- a/ext/mbstring/libmbfl/filters/mbfilter_iso2022_jp_ms.c +++ b/ext/mbstring/libmbfl/filters/mbfilter_iso2022_jp_ms.c @@ -408,9 +408,7 @@ mbfl_filt_conv_wchar_2022jpms(int c, mbfl_convert_filter *filter) CK((*filter->output_function)(s1 & 0x7f, filter->data)); } } else { - if (filter->illegal_mode != MBFL_OUTPUTFILTER_ILLEGAL_MODE_NONE) { - CK(mbfl_filt_conv_illegal_output(c, filter)); - } + CK(mbfl_filt_conv_illegal_output(c, filter)); } return c; diff --git a/ext/mbstring/libmbfl/filters/mbfilter_iso2022_kr.c b/ext/mbstring/libmbfl/filters/mbfilter_iso2022_kr.c index cc0e3653f2..bd1227e6a5 100644 --- a/ext/mbstring/libmbfl/filters/mbfilter_iso2022_kr.c +++ b/ext/mbstring/libmbfl/filters/mbfilter_iso2022_kr.c @@ -263,9 +263,7 @@ mbfl_filt_conv_wchar_2022kr(int c, mbfl_convert_filter *filter) CK((*filter->output_function)(s & 0xff, filter->data)); } } else { - if (filter->illegal_mode != MBFL_OUTPUTFILTER_ILLEGAL_MODE_NONE) { - CK(mbfl_filt_conv_illegal_output(c, filter)); - } + CK(mbfl_filt_conv_illegal_output(c, filter)); } return c; diff --git a/ext/mbstring/libmbfl/filters/mbfilter_iso2022jp_mobile.c b/ext/mbstring/libmbfl/filters/mbfilter_iso2022jp_mobile.c index 3847f78aa1..11307682d6 100644 --- a/ext/mbstring/libmbfl/filters/mbfilter_iso2022jp_mobile.c +++ b/ext/mbstring/libmbfl/filters/mbfilter_iso2022jp_mobile.c @@ -426,9 +426,7 @@ mbfl_filt_conv_wchar_2022jp_mobile(int c, mbfl_convert_filter *filter) CK((*filter->output_function)(s1 & 0x7f, filter->data)); } } else { - if (filter->illegal_mode != MBFL_OUTPUTFILTER_ILLEGAL_MODE_NONE) { - CK(mbfl_filt_conv_illegal_output(c, filter)); - } + CK(mbfl_filt_conv_illegal_output(c, filter)); } return c; diff --git a/ext/mbstring/libmbfl/filters/mbfilter_iso8859_1.c b/ext/mbstring/libmbfl/filters/mbfilter_iso8859_1.c index 9279fe8713..2b75b51e58 100644 --- a/ext/mbstring/libmbfl/filters/mbfilter_iso8859_1.c +++ b/ext/mbstring/libmbfl/filters/mbfilter_iso8859_1.c @@ -91,9 +91,7 @@ int mbfl_filt_conv_wchar_8859_1(int c, mbfl_convert_filter *filter) if (c >= 0 && c < 0x100) { CK((*filter->output_function)(c, filter->data)); } else { - if (filter->illegal_mode != MBFL_OUTPUTFILTER_ILLEGAL_MODE_NONE) { - CK(mbfl_filt_conv_illegal_output(c, filter)); - } + CK(mbfl_filt_conv_illegal_output(c, filter)); } return c; diff --git a/ext/mbstring/libmbfl/filters/mbfilter_iso8859_10.c b/ext/mbstring/libmbfl/filters/mbfilter_iso8859_10.c index f6c6297151..bb050df328 100644 --- a/ext/mbstring/libmbfl/filters/mbfilter_iso8859_10.c +++ b/ext/mbstring/libmbfl/filters/mbfilter_iso8859_10.c @@ -129,9 +129,7 @@ int mbfl_filt_conv_wchar_8859_10(int c, mbfl_convert_filter *filter) if (s >= 0) { CK((*filter->output_function)(s, filter->data)); } else { - if (filter->illegal_mode != MBFL_OUTPUTFILTER_ILLEGAL_MODE_NONE) { - CK(mbfl_filt_conv_illegal_output(c, filter)); - } + CK(mbfl_filt_conv_illegal_output(c, filter)); } return c; diff --git a/ext/mbstring/libmbfl/filters/mbfilter_iso8859_13.c b/ext/mbstring/libmbfl/filters/mbfilter_iso8859_13.c index fc039892e0..5398abd4f7 100644 --- a/ext/mbstring/libmbfl/filters/mbfilter_iso8859_13.c +++ b/ext/mbstring/libmbfl/filters/mbfilter_iso8859_13.c @@ -129,9 +129,7 @@ int mbfl_filt_conv_wchar_8859_13(int c, mbfl_convert_filter *filter) if (s >= 0) { CK((*filter->output_function)(s, filter->data)); } else { - if (filter->illegal_mode != MBFL_OUTPUTFILTER_ILLEGAL_MODE_NONE) { - CK(mbfl_filt_conv_illegal_output(c, filter)); - } + CK(mbfl_filt_conv_illegal_output(c, filter)); } return c; diff --git a/ext/mbstring/libmbfl/filters/mbfilter_iso8859_14.c b/ext/mbstring/libmbfl/filters/mbfilter_iso8859_14.c index db16cd6a7b..bd07ac7b61 100644 --- a/ext/mbstring/libmbfl/filters/mbfilter_iso8859_14.c +++ b/ext/mbstring/libmbfl/filters/mbfilter_iso8859_14.c @@ -129,9 +129,7 @@ int mbfl_filt_conv_wchar_8859_14(int c, mbfl_convert_filter *filter) if (s >= 0) { CK((*filter->output_function)(s, filter->data)); } else { - if (filter->illegal_mode != MBFL_OUTPUTFILTER_ILLEGAL_MODE_NONE) { - CK(mbfl_filt_conv_illegal_output(c, filter)); - } + CK(mbfl_filt_conv_illegal_output(c, filter)); } return c; diff --git a/ext/mbstring/libmbfl/filters/mbfilter_iso8859_15.c b/ext/mbstring/libmbfl/filters/mbfilter_iso8859_15.c index 74e5a2dde7..a564ac4fcf 100644 --- a/ext/mbstring/libmbfl/filters/mbfilter_iso8859_15.c +++ b/ext/mbstring/libmbfl/filters/mbfilter_iso8859_15.c @@ -129,9 +129,7 @@ int mbfl_filt_conv_wchar_8859_15(int c, mbfl_convert_filter *filter) if (s >= 0) { CK((*filter->output_function)(s, filter->data)); } else { - if (filter->illegal_mode != MBFL_OUTPUTFILTER_ILLEGAL_MODE_NONE) { - CK(mbfl_filt_conv_illegal_output(c, filter)); - } + CK(mbfl_filt_conv_illegal_output(c, filter)); } return c; diff --git a/ext/mbstring/libmbfl/filters/mbfilter_iso8859_16.c b/ext/mbstring/libmbfl/filters/mbfilter_iso8859_16.c index 68da24f533..2600822006 100644 --- a/ext/mbstring/libmbfl/filters/mbfilter_iso8859_16.c +++ b/ext/mbstring/libmbfl/filters/mbfilter_iso8859_16.c @@ -129,9 +129,7 @@ int mbfl_filt_conv_wchar_8859_16(int c, mbfl_convert_filter *filter) if (s >= 0) { CK((*filter->output_function)(s, filter->data)); } else { - if (filter->illegal_mode != MBFL_OUTPUTFILTER_ILLEGAL_MODE_NONE) { - CK(mbfl_filt_conv_illegal_output(c, filter)); - } + CK(mbfl_filt_conv_illegal_output(c, filter)); } return c; diff --git a/ext/mbstring/libmbfl/filters/mbfilter_iso8859_2.c b/ext/mbstring/libmbfl/filters/mbfilter_iso8859_2.c index dcc05a00d1..245cc914dc 100644 --- a/ext/mbstring/libmbfl/filters/mbfilter_iso8859_2.c +++ b/ext/mbstring/libmbfl/filters/mbfilter_iso8859_2.c @@ -130,9 +130,7 @@ int mbfl_filt_conv_wchar_8859_2(int c, mbfl_convert_filter *filter) if (s >= 0) { CK((*filter->output_function)(s, filter->data)); } else { - if (filter->illegal_mode != MBFL_OUTPUTFILTER_ILLEGAL_MODE_NONE) { - CK(mbfl_filt_conv_illegal_output(c, filter)); - } + CK(mbfl_filt_conv_illegal_output(c, filter)); } return c; diff --git a/ext/mbstring/libmbfl/filters/mbfilter_iso8859_3.c b/ext/mbstring/libmbfl/filters/mbfilter_iso8859_3.c index 61fbde6f4c..557983b7a7 100644 --- a/ext/mbstring/libmbfl/filters/mbfilter_iso8859_3.c +++ b/ext/mbstring/libmbfl/filters/mbfilter_iso8859_3.c @@ -130,9 +130,7 @@ int mbfl_filt_conv_wchar_8859_3(int c, mbfl_convert_filter *filter) if (s >= 0) { CK((*filter->output_function)(s, filter->data)); } else { - if (filter->illegal_mode != MBFL_OUTPUTFILTER_ILLEGAL_MODE_NONE) { - CK(mbfl_filt_conv_illegal_output(c, filter)); - } + CK(mbfl_filt_conv_illegal_output(c, filter)); } return c; diff --git a/ext/mbstring/libmbfl/filters/mbfilter_iso8859_4.c b/ext/mbstring/libmbfl/filters/mbfilter_iso8859_4.c index f5a8aa7307..f481e01465 100644 --- a/ext/mbstring/libmbfl/filters/mbfilter_iso8859_4.c +++ b/ext/mbstring/libmbfl/filters/mbfilter_iso8859_4.c @@ -128,9 +128,7 @@ int mbfl_filt_conv_wchar_8859_4(int c, mbfl_convert_filter *filter) if (s >= 0) { CK((*filter->output_function)(s, filter->data)); } else { - if (filter->illegal_mode != MBFL_OUTPUTFILTER_ILLEGAL_MODE_NONE) { - CK(mbfl_filt_conv_illegal_output(c, filter)); - } + CK(mbfl_filt_conv_illegal_output(c, filter)); } return c; diff --git a/ext/mbstring/libmbfl/filters/mbfilter_iso8859_5.c b/ext/mbstring/libmbfl/filters/mbfilter_iso8859_5.c index 629caa1081..d00a0afff4 100644 --- a/ext/mbstring/libmbfl/filters/mbfilter_iso8859_5.c +++ b/ext/mbstring/libmbfl/filters/mbfilter_iso8859_5.c @@ -130,9 +130,7 @@ int mbfl_filt_conv_wchar_8859_5(int c, mbfl_convert_filter *filter) if (s >= 0) { CK((*filter->output_function)(s, filter->data)); } else { - if (filter->illegal_mode != MBFL_OUTPUTFILTER_ILLEGAL_MODE_NONE) { - CK(mbfl_filt_conv_illegal_output(c, filter)); - } + CK(mbfl_filt_conv_illegal_output(c, filter)); } return c; diff --git a/ext/mbstring/libmbfl/filters/mbfilter_iso8859_6.c b/ext/mbstring/libmbfl/filters/mbfilter_iso8859_6.c index d3f5f559f2..45120cf487 100644 --- a/ext/mbstring/libmbfl/filters/mbfilter_iso8859_6.c +++ b/ext/mbstring/libmbfl/filters/mbfilter_iso8859_6.c @@ -130,9 +130,7 @@ int mbfl_filt_conv_wchar_8859_6(int c, mbfl_convert_filter *filter) if (s >= 0) { CK((*filter->output_function)(s, filter->data)); } else { - if (filter->illegal_mode != MBFL_OUTPUTFILTER_ILLEGAL_MODE_NONE) { - CK(mbfl_filt_conv_illegal_output(c, filter)); - } + CK(mbfl_filt_conv_illegal_output(c, filter)); } return c; diff --git a/ext/mbstring/libmbfl/filters/mbfilter_iso8859_7.c b/ext/mbstring/libmbfl/filters/mbfilter_iso8859_7.c index a11d1f57ff..79fe4d7509 100644 --- a/ext/mbstring/libmbfl/filters/mbfilter_iso8859_7.c +++ b/ext/mbstring/libmbfl/filters/mbfilter_iso8859_7.c @@ -130,9 +130,7 @@ int mbfl_filt_conv_wchar_8859_7(int c, mbfl_convert_filter *filter) if (s >= 0) { CK((*filter->output_function)(s, filter->data)); } else { - if (filter->illegal_mode != MBFL_OUTPUTFILTER_ILLEGAL_MODE_NONE) { - CK(mbfl_filt_conv_illegal_output(c, filter)); - } + CK(mbfl_filt_conv_illegal_output(c, filter)); } return c; diff --git a/ext/mbstring/libmbfl/filters/mbfilter_iso8859_8.c b/ext/mbstring/libmbfl/filters/mbfilter_iso8859_8.c index fb4020a4ad..a7124d3e4e 100644 --- a/ext/mbstring/libmbfl/filters/mbfilter_iso8859_8.c +++ b/ext/mbstring/libmbfl/filters/mbfilter_iso8859_8.c @@ -129,9 +129,7 @@ int mbfl_filt_conv_wchar_8859_8(int c, mbfl_convert_filter *filter) if (s >= 0) { CK((*filter->output_function)(s, filter->data)); } else { - if (filter->illegal_mode != MBFL_OUTPUTFILTER_ILLEGAL_MODE_NONE) { - CK(mbfl_filt_conv_illegal_output(c, filter)); - } + CK(mbfl_filt_conv_illegal_output(c, filter)); } return c; diff --git a/ext/mbstring/libmbfl/filters/mbfilter_iso8859_9.c b/ext/mbstring/libmbfl/filters/mbfilter_iso8859_9.c index 1e368ba5b6..ba71bfd6a4 100644 --- a/ext/mbstring/libmbfl/filters/mbfilter_iso8859_9.c +++ b/ext/mbstring/libmbfl/filters/mbfilter_iso8859_9.c @@ -129,9 +129,7 @@ int mbfl_filt_conv_wchar_8859_9(int c, mbfl_convert_filter *filter) if (s >= 0) { CK((*filter->output_function)(s, filter->data)); } else { - if (filter->illegal_mode != MBFL_OUTPUTFILTER_ILLEGAL_MODE_NONE) { - CK(mbfl_filt_conv_illegal_output(c, filter)); - } + CK(mbfl_filt_conv_illegal_output(c, filter)); } return c; diff --git a/ext/mbstring/libmbfl/filters/mbfilter_jis.c b/ext/mbstring/libmbfl/filters/mbfilter_jis.c index 8985456d72..f3bd3f8141 100644 --- a/ext/mbstring/libmbfl/filters/mbfilter_jis.c +++ b/ext/mbstring/libmbfl/filters/mbfilter_jis.c @@ -381,9 +381,7 @@ mbfl_filt_conv_wchar_jis(int c, mbfl_convert_filter *filter) CK((*filter->output_function)(s & 0x7f, filter->data)); } } else { - if (filter->illegal_mode != MBFL_OUTPUTFILTER_ILLEGAL_MODE_NONE) { - CK(mbfl_filt_conv_illegal_output(c, filter)); - } + CK(mbfl_filt_conv_illegal_output(c, filter)); } return c; @@ -464,9 +462,7 @@ mbfl_filt_conv_wchar_2022jp(int c, mbfl_convert_filter *filter) CK((*filter->output_function)(s & 0x7f, filter->data)); } } else { - if (filter->illegal_mode != MBFL_OUTPUTFILTER_ILLEGAL_MODE_NONE) { - CK(mbfl_filt_conv_illegal_output(c, filter)); - } + CK(mbfl_filt_conv_illegal_output(c, filter)); } return c; diff --git a/ext/mbstring/libmbfl/filters/mbfilter_koi8r.c b/ext/mbstring/libmbfl/filters/mbfilter_koi8r.c index 101b3f1c85..a9a4479aed 100644 --- a/ext/mbstring/libmbfl/filters/mbfilter_koi8r.c +++ b/ext/mbstring/libmbfl/filters/mbfilter_koi8r.c @@ -133,9 +133,7 @@ mbfl_filt_conv_wchar_koi8r(int c, mbfl_convert_filter *filter) if (s >= 0) { CK((*filter->output_function)(s, filter->data)); } else { - if (filter->illegal_mode != MBFL_OUTPUTFILTER_ILLEGAL_MODE_NONE) { - CK(mbfl_filt_conv_illegal_output(c, filter)); - } + CK(mbfl_filt_conv_illegal_output(c, filter)); } return c; diff --git a/ext/mbstring/libmbfl/filters/mbfilter_koi8u.c b/ext/mbstring/libmbfl/filters/mbfilter_koi8u.c index 25174326f7..675ea03955 100644 --- a/ext/mbstring/libmbfl/filters/mbfilter_koi8u.c +++ b/ext/mbstring/libmbfl/filters/mbfilter_koi8u.c @@ -130,9 +130,7 @@ mbfl_filt_conv_wchar_koi8u(int c, mbfl_convert_filter *filter) if (s >= 0) { CK((*filter->output_function)(s, filter->data)); } else { - if (filter->illegal_mode != MBFL_OUTPUTFILTER_ILLEGAL_MODE_NONE) { - CK(mbfl_filt_conv_illegal_output(c, filter)); - } + CK(mbfl_filt_conv_illegal_output(c, filter)); } return c; diff --git a/ext/mbstring/libmbfl/filters/mbfilter_sjis.c b/ext/mbstring/libmbfl/filters/mbfilter_sjis.c index 5dab2bcbb6..73ded6c704 100644 --- a/ext/mbstring/libmbfl/filters/mbfilter_sjis.c +++ b/ext/mbstring/libmbfl/filters/mbfilter_sjis.c @@ -270,9 +270,7 @@ mbfl_filt_conv_wchar_sjis(int c, mbfl_convert_filter *filter) CK((*filter->output_function)(s2, filter->data)); } } else { - if (filter->illegal_mode != MBFL_OUTPUTFILTER_ILLEGAL_MODE_NONE) { - CK(mbfl_filt_conv_illegal_output(c, filter)); - } + CK(mbfl_filt_conv_illegal_output(c, filter)); } return c; diff --git a/ext/mbstring/libmbfl/filters/mbfilter_sjis_2004.c b/ext/mbstring/libmbfl/filters/mbfilter_sjis_2004.c index da25160b4d..ac476b3e19 100644 --- a/ext/mbstring/libmbfl/filters/mbfilter_sjis_2004.c +++ b/ext/mbstring/libmbfl/filters/mbfilter_sjis_2004.c @@ -668,9 +668,7 @@ retry: CK((*filter->output_function)(s2, filter->data)); } } else { - if (filter->illegal_mode != MBFL_OUTPUTFILTER_ILLEGAL_MODE_NONE) { - CK(mbfl_filt_conv_illegal_output(c, filter)); - } + CK(mbfl_filt_conv_illegal_output(c, filter)); } return c; diff --git a/ext/mbstring/libmbfl/filters/mbfilter_sjis_mac.c b/ext/mbstring/libmbfl/filters/mbfilter_sjis_mac.c index a1cfa72521..8bc8e6e68f 100644 --- a/ext/mbstring/libmbfl/filters/mbfilter_sjis_mac.c +++ b/ext/mbstring/libmbfl/filters/mbfilter_sjis_mac.c @@ -364,9 +364,7 @@ mbfl_filt_conv_wchar_sjis_mac(int c, mbfl_convert_filter *filter) CK((*filter->output_function)(s1 & 0xff, filter->data)); } } else { - if (filter->illegal_mode != MBFL_OUTPUTFILTER_ILLEGAL_MODE_NONE) { - CK(mbfl_filt_conv_illegal_output(c, filter)); - } + CK(mbfl_filt_conv_illegal_output(c, filter)); } if (s2 <= 0 || s1 == -1) { @@ -488,9 +486,7 @@ mbfl_filt_conv_wchar_sjis_mac(int c, mbfl_convert_filter *filter) CK((*filter->output_function)(s2, filter->data)); } } else { - if (filter->illegal_mode != MBFL_OUTPUTFILTER_ILLEGAL_MODE_NONE) { - CK(mbfl_filt_conv_illegal_output(c, filter)); - } + CK(mbfl_filt_conv_illegal_output(c, filter)); } break; @@ -525,7 +521,7 @@ mbfl_filt_conv_wchar_sjis_mac(int c, mbfl_convert_filter *filter) } } - if (filter->status == 0 && filter->illegal_mode != MBFL_OUTPUTFILTER_ILLEGAL_MODE_NONE) { + if (filter->status == 0) { CK(mbfl_filt_conv_illegal_output(c1, filter)); CK(mbfl_filt_conv_illegal_output(c, filter)); } @@ -556,7 +552,7 @@ mbfl_filt_conv_wchar_sjis_mac(int c, mbfl_convert_filter *filter) CK((*filter->output_function)(s2, filter->data)); } - if (s1 <= 0 && filter->illegal_mode != MBFL_OUTPUTFILTER_ILLEGAL_MODE_NONE) { + if (s1 <= 0) { CK(mbfl_filt_conv_illegal_output(0xf860, filter)); CK(mbfl_filt_conv_illegal_output(c1, filter)); CK(mbfl_filt_conv_illegal_output(c, filter)); @@ -605,7 +601,7 @@ mbfl_filt_conv_wchar_sjis_mac(int c, mbfl_convert_filter *filter) CK((*filter->output_function)(s2, filter->data)); } - if (s1 <= 0 && filter->illegal_mode != MBFL_OUTPUTFILTER_ILLEGAL_MODE_NONE) { + if (s1 <= 0) { CK(mbfl_filt_conv_illegal_output(0xf861, filter)); for (i=0; i<3; i++) { if (c1 == code_tbl_m[i+5][3]) { @@ -651,7 +647,7 @@ mbfl_filt_conv_wchar_sjis_mac(int c, mbfl_convert_filter *filter) CK((*filter->output_function)(s2, filter->data)); } - if (s1 <= 0 && filter->illegal_mode != MBFL_OUTPUTFILTER_ILLEGAL_MODE_NONE) { + if (s1 <= 0) { CK(mbfl_filt_conv_illegal_output(0xf862, filter)); for (i=0; i<4; i++) { if (c1 == code_tbl_m[i+8][4]) { diff --git a/ext/mbstring/libmbfl/filters/mbfilter_sjis_mobile.c b/ext/mbstring/libmbfl/filters/mbfilter_sjis_mobile.c index 3dd2e213c6..316250ddb2 100644 --- a/ext/mbstring/libmbfl/filters/mbfilter_sjis_mobile.c +++ b/ext/mbstring/libmbfl/filters/mbfilter_sjis_mobile.c @@ -905,9 +905,7 @@ mbfl_filt_conv_wchar_sjis_mobile(int c, mbfl_convert_filter *filter) CK((*filter->output_function)(s2, filter->data)); } } else { - if (filter->illegal_mode != MBFL_OUTPUTFILTER_ILLEGAL_MODE_NONE) { - CK(mbfl_filt_conv_illegal_output(c, filter)); - } + CK(mbfl_filt_conv_illegal_output(c, filter)); } return c; diff --git a/ext/mbstring/libmbfl/filters/mbfilter_sjis_open.c b/ext/mbstring/libmbfl/filters/mbfilter_sjis_open.c index fcf2953108..855b6eda8b 100644 --- a/ext/mbstring/libmbfl/filters/mbfilter_sjis_open.c +++ b/ext/mbstring/libmbfl/filters/mbfilter_sjis_open.c @@ -321,9 +321,7 @@ mbfl_filt_conv_wchar_sjis_open(int c, mbfl_convert_filter *filter) CK((*filter->output_function)(s2, filter->data)); } } else { - if (filter->illegal_mode != MBFL_OUTPUTFILTER_ILLEGAL_MODE_NONE) { - CK(mbfl_filt_conv_illegal_output(c, filter)); - } + CK(mbfl_filt_conv_illegal_output(c, filter)); } return c; diff --git a/ext/mbstring/libmbfl/filters/mbfilter_ucs2.c b/ext/mbstring/libmbfl/filters/mbfilter_ucs2.c index 76886695dd..da42ef10f5 100644 --- a/ext/mbstring/libmbfl/filters/mbfilter_ucs2.c +++ b/ext/mbstring/libmbfl/filters/mbfilter_ucs2.c @@ -195,9 +195,7 @@ int mbfl_filt_conv_wchar_ucs2be(int c, mbfl_convert_filter *filter) CK((*filter->output_function)((c >> 8) & 0xff, filter->data)); CK((*filter->output_function)(c & 0xff, filter->data)); } else { - if (filter->illegal_mode != MBFL_OUTPUTFILTER_ILLEGAL_MODE_NONE) { - CK(mbfl_filt_conv_illegal_output(c, filter)); - } + CK(mbfl_filt_conv_illegal_output(c, filter)); } return c; @@ -232,9 +230,7 @@ int mbfl_filt_conv_wchar_ucs2le(int c, mbfl_convert_filter *filter) CK((*filter->output_function)(c & 0xff, filter->data)); CK((*filter->output_function)((c >> 8) & 0xff, filter->data)); } else { - if (filter->illegal_mode != MBFL_OUTPUTFILTER_ILLEGAL_MODE_NONE) { - CK(mbfl_filt_conv_illegal_output(c, filter)); - } + CK(mbfl_filt_conv_illegal_output(c, filter)); } return c; diff --git a/ext/mbstring/libmbfl/filters/mbfilter_ucs4.c b/ext/mbstring/libmbfl/filters/mbfilter_ucs4.c index 0b85a6f339..26ae5d47cc 100644 --- a/ext/mbstring/libmbfl/filters/mbfilter_ucs4.c +++ b/ext/mbstring/libmbfl/filters/mbfilter_ucs4.c @@ -224,9 +224,7 @@ int mbfl_filt_conv_wchar_ucs4be(int c, mbfl_convert_filter *filter) CK((*filter->output_function)((c >> 8) & 0xff, filter->data)); CK((*filter->output_function)(c & 0xff, filter->data)); } else { - if (filter->illegal_mode != MBFL_OUTPUTFILTER_ILLEGAL_MODE_NONE) { - CK(mbfl_filt_conv_illegal_output(c, filter)); - } + CK(mbfl_filt_conv_illegal_output(c, filter)); } return c; @@ -270,9 +268,7 @@ int mbfl_filt_conv_wchar_ucs4le(int c, mbfl_convert_filter *filter) CK((*filter->output_function)((c >> 16) & 0xff, filter->data)); CK((*filter->output_function)((c >> 24) & 0xff, filter->data)); } else { - if (filter->illegal_mode != MBFL_OUTPUTFILTER_ILLEGAL_MODE_NONE) { - CK(mbfl_filt_conv_illegal_output(c, filter)); - } + CK(mbfl_filt_conv_illegal_output(c, filter)); } return c; diff --git a/ext/mbstring/libmbfl/filters/mbfilter_uhc.c b/ext/mbstring/libmbfl/filters/mbfilter_uhc.c index 1c1db5f42a..7995c812c2 100644 --- a/ext/mbstring/libmbfl/filters/mbfilter_uhc.c +++ b/ext/mbstring/libmbfl/filters/mbfilter_uhc.c @@ -218,9 +218,7 @@ mbfl_filt_conv_wchar_uhc(int c, mbfl_convert_filter *filter) CK((*filter->output_function)(s & 0xff, filter->data)); } } else { - if (filter->illegal_mode != MBFL_OUTPUTFILTER_ILLEGAL_MODE_NONE) { - CK(mbfl_filt_conv_illegal_output(c, filter)); - } + CK(mbfl_filt_conv_illegal_output(c, filter)); } return c; diff --git a/ext/mbstring/libmbfl/filters/mbfilter_utf16.c b/ext/mbstring/libmbfl/filters/mbfilter_utf16.c index 8772d8d5be..961bfdcaf3 100644 --- a/ext/mbstring/libmbfl/filters/mbfilter_utf16.c +++ b/ext/mbstring/libmbfl/filters/mbfilter_utf16.c @@ -245,9 +245,7 @@ int mbfl_filt_conv_wchar_utf16be(int c, mbfl_convert_filter *filter) CK((*filter->output_function)((n >> 8) & 0xff, filter->data)); CK((*filter->output_function)(n & 0xff, filter->data)); } else { - if (filter->illegal_mode != MBFL_OUTPUTFILTER_ILLEGAL_MODE_NONE) { - CK(mbfl_filt_conv_illegal_output(c, filter)); - } + CK(mbfl_filt_conv_illegal_output(c, filter)); } return c; @@ -310,9 +308,7 @@ int mbfl_filt_conv_wchar_utf16le(int c, mbfl_convert_filter *filter) CK((*filter->output_function)(n & 0xff, filter->data)); CK((*filter->output_function)((n >> 8) & 0xff, filter->data)); } else { - if (filter->illegal_mode != MBFL_OUTPUTFILTER_ILLEGAL_MODE_NONE) { - CK(mbfl_filt_conv_illegal_output(c, filter)); - } + CK(mbfl_filt_conv_illegal_output(c, filter)); } return c; diff --git a/ext/mbstring/libmbfl/filters/mbfilter_utf32.c b/ext/mbstring/libmbfl/filters/mbfilter_utf32.c index b1b41331eb..9f7ddf1dea 100644 --- a/ext/mbstring/libmbfl/filters/mbfilter_utf32.c +++ b/ext/mbstring/libmbfl/filters/mbfilter_utf32.c @@ -233,9 +233,7 @@ int mbfl_filt_conv_wchar_utf32be(int c, mbfl_convert_filter *filter) CK((*filter->output_function)((c >> 8) & 0xff, filter->data)); CK((*filter->output_function)(c & 0xff, filter->data)); } else { - if (filter->illegal_mode != MBFL_OUTPUTFILTER_ILLEGAL_MODE_NONE) { - CK(mbfl_filt_conv_illegal_output(c, filter)); - } + CK(mbfl_filt_conv_illegal_output(c, filter)); } return c; @@ -284,9 +282,7 @@ int mbfl_filt_conv_wchar_utf32le(int c, mbfl_convert_filter *filter) CK((*filter->output_function)((c >> 16) & 0xff, filter->data)); CK((*filter->output_function)((c >> 24) & 0xff, filter->data)); } else { - if (filter->illegal_mode != MBFL_OUTPUTFILTER_ILLEGAL_MODE_NONE) { - CK(mbfl_filt_conv_illegal_output(c, filter)); - } + CK(mbfl_filt_conv_illegal_output(c, filter)); } return c; diff --git a/ext/mbstring/libmbfl/filters/mbfilter_utf7.c b/ext/mbstring/libmbfl/filters/mbfilter_utf7.c index 5c13e45b8e..901c1a4a8b 100644 --- a/ext/mbstring/libmbfl/filters/mbfilter_utf7.c +++ b/ext/mbstring/libmbfl/filters/mbfilter_utf7.c @@ -296,9 +296,7 @@ int mbfl_filt_conv_wchar_utf7(int c, mbfl_convert_filter *filter) CK((*filter->filter_function)(s, filter)); return c; } else { - if (filter->illegal_mode != MBFL_OUTPUTFILTER_ILLEGAL_MODE_NONE) { - CK(mbfl_filt_conv_illegal_output(c, filter)); - } + CK(mbfl_filt_conv_illegal_output(c, filter)); return c; } diff --git a/ext/mbstring/libmbfl/filters/mbfilter_utf7imap.c b/ext/mbstring/libmbfl/filters/mbfilter_utf7imap.c index c4d2b5c42d..4203124cc3 100644 --- a/ext/mbstring/libmbfl/filters/mbfilter_utf7imap.c +++ b/ext/mbstring/libmbfl/filters/mbfilter_utf7imap.c @@ -251,9 +251,7 @@ int mbfl_filt_conv_wchar_utf7imap(int c, mbfl_convert_filter *filter) CK((*filter->filter_function)(s, filter)); return c; } else { - if (filter->illegal_mode != MBFL_OUTPUTFILTER_ILLEGAL_MODE_NONE) { - CK(mbfl_filt_conv_illegal_output(c, filter)); - } + CK(mbfl_filt_conv_illegal_output(c, filter)); return c; } diff --git a/ext/mbstring/libmbfl/filters/mbfilter_utf8.c b/ext/mbstring/libmbfl/filters/mbfilter_utf8.c index 1e2ad5b959..05815bbdb0 100644 --- a/ext/mbstring/libmbfl/filters/mbfilter_utf8.c +++ b/ext/mbstring/libmbfl/filters/mbfilter_utf8.c @@ -234,9 +234,7 @@ int mbfl_filt_conv_wchar_utf8(int c, mbfl_convert_filter *filter) CK((*filter->output_function)((c & 0x3f) | 0x80, filter->data)); } } else { - if (filter->illegal_mode != MBFL_OUTPUTFILTER_ILLEGAL_MODE_NONE) { - CK(mbfl_filt_conv_illegal_output(c, filter)); - } + CK(mbfl_filt_conv_illegal_output(c, filter)); } return c; diff --git a/ext/mbstring/libmbfl/filters/mbfilter_utf8_mobile.c b/ext/mbstring/libmbfl/filters/mbfilter_utf8_mobile.c index 060cd90860..3e166609e7 100644 --- a/ext/mbstring/libmbfl/filters/mbfilter_utf8_mobile.c +++ b/ext/mbstring/libmbfl/filters/mbfilter_utf8_mobile.c @@ -339,9 +339,7 @@ int mbfl_filt_conv_wchar_utf8_mobile(int c, mbfl_convert_filter *filter) CK((*filter->output_function)((c & 0x3f) | 0x80, filter->data)); } } else { - if (filter->illegal_mode != MBFL_OUTPUTFILTER_ILLEGAL_MODE_NONE) { - CK(mbfl_filt_conv_illegal_output(c, filter)); - } + CK(mbfl_filt_conv_illegal_output(c, filter)); } return c; diff --git a/ext/mbstring/libmbfl/mbfl/mbfl_convert.c b/ext/mbstring/libmbfl/mbfl/mbfl_convert.c index e13838f4ca..04e0a13de9 100644 --- a/ext/mbstring/libmbfl/mbfl/mbfl_convert.c +++ b/ext/mbstring/libmbfl/mbfl/mbfl_convert.c @@ -427,6 +427,7 @@ mbfl_filt_conv_illegal_output(int c, mbfl_convert_filter *filter) } } break; + case MBFL_OUTPUTFILTER_ILLEGAL_MODE_NONE: default: break; } -- 2.40.0