From 8d73dc7bfcbed79abb762f301f8e72deaeaed0b6 Mon Sep 17 00:00:00 2001 From: Moriyoshi Koizumi Date: Mon, 21 Feb 2005 07:57:08 +0000 Subject: [PATCH] - Fix compiler warnings. --- ext/mbstring/libmbfl/filters/mk_sb_tbl.awk | 29 +++++++++++++++++-- .../filters/unicode_table_iso8859_10.h | 2 +- .../filters/unicode_table_iso8859_13.h | 2 +- .../filters/unicode_table_iso8859_14.h | 2 +- .../filters/unicode_table_iso8859_15.h | 2 +- .../filters/unicode_table_iso8859_16.h | 2 +- .../libmbfl/filters/unicode_table_iso8859_2.h | 2 +- .../libmbfl/filters/unicode_table_iso8859_3.h | 2 +- .../libmbfl/filters/unicode_table_iso8859_4.h | 2 +- .../libmbfl/filters/unicode_table_iso8859_5.h | 2 +- .../libmbfl/filters/unicode_table_iso8859_6.h | 2 +- .../libmbfl/filters/unicode_table_iso8859_7.h | 2 +- .../libmbfl/filters/unicode_table_iso8859_8.h | 2 +- .../libmbfl/filters/unicode_table_iso8859_9.h | 2 +- ext/mbstring/mbstring.c | 2 +- 15 files changed, 40 insertions(+), 17 deletions(-) diff --git a/ext/mbstring/libmbfl/filters/mk_sb_tbl.awk b/ext/mbstring/libmbfl/filters/mk_sb_tbl.awk index ae090b5aa55..f0ad290e241 100755 --- a/ext/mbstring/libmbfl/filters/mk_sb_tbl.awk +++ b/ext/mbstring/libmbfl/filters/mk_sb_tbl.awk @@ -5,6 +5,29 @@ # Description: a script that generates a single byte code set to Unicode # mapping table. # + +function conv(str) { + if (!match(str, "^0[xX]")) { + return 0 + str + } + + retval = 0 + + for (i = 3; i <= length(str); i++) { + n = index("0123456789abcdefABCDEF", substr(str, i, 1)) - 1 + + if (n < 0) { + return 0 + str; + } else if (n >= 16) { + n -= 6; + } + + retval = retval * 16 + n + } + + return retval +} + BEGIN { FS="[ \t#]" } @@ -14,7 +37,7 @@ BEGIN { } { - tbl[$1 + 0] = $2 + tbl[conv($1)] = conv($2) } END { @@ -23,14 +46,14 @@ END { print "#ifndef " IFNDEF_NAME } - print "static const unsigned int " TABLE_NAME "[] = {" + print "static const int " TABLE_NAME "[] = {" i = 160; for (;;) { printf("\t0x%04x, 0x%04x, 0x%04x, 0x%04x, 0x%04x, 0x%04x, 0x%04x, 0x%04x", tbl[i++], tbl[i++], tbl[i++], tbl[i++], tbl[i++], tbl[i++], tbl[i++], tbl[i++]); if (i != 256) { printf(",\n"); } else { - print + print "" break; } } diff --git a/ext/mbstring/libmbfl/filters/unicode_table_iso8859_10.h b/ext/mbstring/libmbfl/filters/unicode_table_iso8859_10.h index 48b1301b729..2b6b78f32bd 100644 --- a/ext/mbstring/libmbfl/filters/unicode_table_iso8859_10.h +++ b/ext/mbstring/libmbfl/filters/unicode_table_iso8859_10.h @@ -1,6 +1,6 @@ /* This file is automatically generated. Do not edit! */ #ifndef UNICODE_TABLE_ISO8859_10_H -static const unsigned int iso8859_10_ucs_table[] = { +static const int iso8859_10_ucs_table[] = { 0x00a0, 0x0104, 0x0112, 0x0122, 0x012a, 0x0128, 0x0136, 0x00a7, 0x013b, 0x0110, 0x0160, 0x0166, 0x017d, 0x00ad, 0x016a, 0x014a, 0x00b0, 0x0105, 0x0113, 0x0123, 0x012b, 0x0129, 0x0137, 0x00b7, diff --git a/ext/mbstring/libmbfl/filters/unicode_table_iso8859_13.h b/ext/mbstring/libmbfl/filters/unicode_table_iso8859_13.h index e7991f8e284..5822396525c 100644 --- a/ext/mbstring/libmbfl/filters/unicode_table_iso8859_13.h +++ b/ext/mbstring/libmbfl/filters/unicode_table_iso8859_13.h @@ -1,6 +1,6 @@ /* This file is automatically generated. Do not edit! */ #ifndef UNICODE_TABLE_ISO8859_13_H -static const unsigned int iso8859_13_ucs_table[] = { +static const int iso8859_13_ucs_table[] = { 0x00a0, 0x201d, 0x00a2, 0x00a3, 0x00a4, 0x201e, 0x00a6, 0x00a7, 0x00d8, 0x00a9, 0x0156, 0x00ab, 0x00ac, 0x00ad, 0x00ae, 0x00c6, 0x00b0, 0x00b1, 0x00b2, 0x00b3, 0x201c, 0x00b5, 0x00b6, 0x00b7, diff --git a/ext/mbstring/libmbfl/filters/unicode_table_iso8859_14.h b/ext/mbstring/libmbfl/filters/unicode_table_iso8859_14.h index 8c0bfe133ae..6bd03b367ab 100644 --- a/ext/mbstring/libmbfl/filters/unicode_table_iso8859_14.h +++ b/ext/mbstring/libmbfl/filters/unicode_table_iso8859_14.h @@ -1,6 +1,6 @@ /* This file is automatically generated. Do not edit! */ #ifndef UNICODE_TABLE_ISO8859_14_H -static const unsigned int iso8859_14_ucs_table[] = { +static const int iso8859_14_ucs_table[] = { 0x00a0, 0x1e02, 0x1e03, 0x00a3, 0x010a, 0x010b, 0x1e0a, 0x00a7, 0x1e80, 0x00a9, 0x1e82, 0x1e0b, 0x1ef2, 0x00ad, 0x00ae, 0x0178, 0x1e1e, 0x1e1f, 0x0120, 0x0121, 0x1e40, 0x1e41, 0x00b6, 0x1e56, diff --git a/ext/mbstring/libmbfl/filters/unicode_table_iso8859_15.h b/ext/mbstring/libmbfl/filters/unicode_table_iso8859_15.h index 82743da2b5e..029a2bcfc4e 100644 --- a/ext/mbstring/libmbfl/filters/unicode_table_iso8859_15.h +++ b/ext/mbstring/libmbfl/filters/unicode_table_iso8859_15.h @@ -1,6 +1,6 @@ /* This file is automatically generated. Do not edit! */ #ifndef UNICODE_TABLE_ISO8859_15_H -static const unsigned int iso8859_15_ucs_table[] = { +static const int iso8859_15_ucs_table[] = { 0x00a0, 0x00a1, 0x00a2, 0x00a3, 0x20ac, 0x00a5, 0x0160, 0x00a7, 0x0161, 0x00a9, 0x00aa, 0x00ab, 0x00ac, 0x00ad, 0x00ae, 0x00af, 0x00b0, 0x00b1, 0x00b2, 0x00b3, 0x017d, 0x00b5, 0x00b6, 0x00b7, diff --git a/ext/mbstring/libmbfl/filters/unicode_table_iso8859_16.h b/ext/mbstring/libmbfl/filters/unicode_table_iso8859_16.h index 256865fd616..555472d0dc1 100644 --- a/ext/mbstring/libmbfl/filters/unicode_table_iso8859_16.h +++ b/ext/mbstring/libmbfl/filters/unicode_table_iso8859_16.h @@ -1,6 +1,6 @@ /* This file is automatically generated. Do not edit! */ #ifndef UNICODE_TABLEISO8859_16_H -static const unsigned int iso8859_16_ucs_table[] = { +static const int iso8859_16_ucs_table[] = { 0x00a0, 0x0104, 0x0105, 0x0141, 0x20ac, 0x201e, 0x0160, 0x00a7, 0x0161, 0x00a9, 0x0218, 0x00ab, 0x0179, 0x00ad, 0x017a, 0x017b, 0x00b0, 0x00b1, 0x010c, 0x0142, 0x017d, 0x201d, 0x00b6, 0x00b7, diff --git a/ext/mbstring/libmbfl/filters/unicode_table_iso8859_2.h b/ext/mbstring/libmbfl/filters/unicode_table_iso8859_2.h index ab1ca6eea83..12bb3cb2dc3 100644 --- a/ext/mbstring/libmbfl/filters/unicode_table_iso8859_2.h +++ b/ext/mbstring/libmbfl/filters/unicode_table_iso8859_2.h @@ -1,6 +1,6 @@ /* This file is automatically generated. Do not edit! */ #ifndef UNICODE_TABLE_ISO8859_2_H -static const unsigned int iso8859_2_ucs_table[] = { +static const int iso8859_2_ucs_table[] = { 0x00a0, 0x0104, 0x02d8, 0x0141, 0x00a4, 0x013d, 0x015a, 0x00a7, 0x00a8, 0x0160, 0x015e, 0x0164, 0x0179, 0x00ad, 0x017d, 0x017b, 0x00b0, 0x0105, 0x02db, 0x0142, 0x00b4, 0x013e, 0x015b, 0x02c7, diff --git a/ext/mbstring/libmbfl/filters/unicode_table_iso8859_3.h b/ext/mbstring/libmbfl/filters/unicode_table_iso8859_3.h index f0501787e3d..f50c348affe 100644 --- a/ext/mbstring/libmbfl/filters/unicode_table_iso8859_3.h +++ b/ext/mbstring/libmbfl/filters/unicode_table_iso8859_3.h @@ -1,6 +1,6 @@ /* This file is automatically generated. Do not edit! */ #ifndef UNICODE_TABLE_ISO8859_3_H -static const unsigned int iso8859_3_ucs_table[] = { +static const int iso8859_3_ucs_table[] = { 0x00a0, 0x0126, 0x02d8, 0x00a3, 0x00a4, 0x0000, 0x0124, 0x00a7, 0x00a8, 0x0130, 0x015e, 0x011e, 0x0134, 0x00ad, 0x0000, 0x017b, 0x00b0, 0x0127, 0x00b2, 0x00b3, 0x00b4, 0x00b5, 0x0125, 0x00b7, diff --git a/ext/mbstring/libmbfl/filters/unicode_table_iso8859_4.h b/ext/mbstring/libmbfl/filters/unicode_table_iso8859_4.h index 01f90fb3e9d..ff7ecdb4c0b 100644 --- a/ext/mbstring/libmbfl/filters/unicode_table_iso8859_4.h +++ b/ext/mbstring/libmbfl/filters/unicode_table_iso8859_4.h @@ -1,6 +1,6 @@ /* This file is automatically generated. Do not edit! */ #ifndef UNICODE_TABLE_ISO8859_4_H -static const unsigned int iso8859_4_ucs_table[] = { +static const int iso8859_4_ucs_table[] = { 0x00a0, 0x0104, 0x0138, 0x0156, 0x00a4, 0x0128, 0x013b, 0x00a7, 0x00a8, 0x0160, 0x0112, 0x0122, 0x0166, 0x00ad, 0x017d, 0x00af, 0x00b0, 0x0105, 0x02db, 0x0157, 0x00b4, 0x0129, 0x013c, 0x02c7, diff --git a/ext/mbstring/libmbfl/filters/unicode_table_iso8859_5.h b/ext/mbstring/libmbfl/filters/unicode_table_iso8859_5.h index 70c9f38c5e8..411ab84b605 100644 --- a/ext/mbstring/libmbfl/filters/unicode_table_iso8859_5.h +++ b/ext/mbstring/libmbfl/filters/unicode_table_iso8859_5.h @@ -1,6 +1,6 @@ /* This file is automatically generated. Do not edit! */ #ifndef UNICODE_TABLE_ISO8859_5_H -static const unsigned int iso8859_5_ucs_table[] = { +static const int iso8859_5_ucs_table[] = { 0x00a0, 0x0401, 0x0402, 0x0403, 0x0404, 0x0405, 0x0406, 0x0407, 0x0408, 0x0409, 0x040a, 0x040b, 0x040c, 0x00ad, 0x040e, 0x040f, 0x0410, 0x0411, 0x0412, 0x0413, 0x0414, 0x0415, 0x0416, 0x0417, diff --git a/ext/mbstring/libmbfl/filters/unicode_table_iso8859_6.h b/ext/mbstring/libmbfl/filters/unicode_table_iso8859_6.h index c9d66243370..0b3952e3a0b 100644 --- a/ext/mbstring/libmbfl/filters/unicode_table_iso8859_6.h +++ b/ext/mbstring/libmbfl/filters/unicode_table_iso8859_6.h @@ -1,6 +1,6 @@ /* This file is automatically generated. Do not edit! */ #ifndef UNICODE_TABLE_ISO8859_6_H -static const unsigned int iso8859_6_ucs_table[] = { +static const int iso8859_6_ucs_table[] = { 0x00a0, 0x0000, 0x0000, 0x0000, 0x00a4, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x060c, 0x00ad, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, diff --git a/ext/mbstring/libmbfl/filters/unicode_table_iso8859_7.h b/ext/mbstring/libmbfl/filters/unicode_table_iso8859_7.h index 4961c30f928..687f4cbc744 100644 --- a/ext/mbstring/libmbfl/filters/unicode_table_iso8859_7.h +++ b/ext/mbstring/libmbfl/filters/unicode_table_iso8859_7.h @@ -1,6 +1,6 @@ /* This file is automatically generated. Do not edit! */ #ifndef UNICODE_TABLE_ISO8859_7_H -static const unsigned int iso8859_7_ucs_table[] = { +static const int iso8859_7_ucs_table[] = { 0x00a0, 0x2018, 0x2019, 0x00a3, 0x20ac, 0x20af, 0x00a6, 0x00a7, 0x00a8, 0x00a9, 0x037a, 0x00ab, 0x00ac, 0x00ad, 0x0000, 0x2015, 0x00b0, 0x00b1, 0x00b2, 0x00b3, 0x0384, 0x0385, 0x0386, 0x00b7, diff --git a/ext/mbstring/libmbfl/filters/unicode_table_iso8859_8.h b/ext/mbstring/libmbfl/filters/unicode_table_iso8859_8.h index 3a52badb36b..4ec6490bae4 100644 --- a/ext/mbstring/libmbfl/filters/unicode_table_iso8859_8.h +++ b/ext/mbstring/libmbfl/filters/unicode_table_iso8859_8.h @@ -1,6 +1,6 @@ /* This file is automatically generated. Do not edit! */ #ifndef UNICODE_TABLE_ISO8859_8_H -static const unsigned int iso8859_8_ucs_table[] = { +static const int iso8859_8_ucs_table[] = { 0x00a0, 0x0000, 0x00a2, 0x00a3, 0x00a4, 0x00a5, 0x00a6, 0x00a7, 0x00a8, 0x00a9, 0x00d7, 0x00ab, 0x00ac, 0x00ad, 0x00ae, 0x00af, 0x00b0, 0x00b1, 0x00b2, 0x00b3, 0x00b4, 0x00b5, 0x00b6, 0x00b7, diff --git a/ext/mbstring/libmbfl/filters/unicode_table_iso8859_9.h b/ext/mbstring/libmbfl/filters/unicode_table_iso8859_9.h index eaac8c6723d..12f988ad7a2 100644 --- a/ext/mbstring/libmbfl/filters/unicode_table_iso8859_9.h +++ b/ext/mbstring/libmbfl/filters/unicode_table_iso8859_9.h @@ -1,6 +1,6 @@ /* This file is automatically generated. Do not edit! */ #ifndef UNICODE_TABLE_ISO8859_9_H -static const unsigned int iso8859_9_ucs_table[] = { +static const int iso8859_9_ucs_table[] = { 0x00a0, 0x00a1, 0x00a2, 0x00a3, 0x00a4, 0x00a5, 0x00a6, 0x00a7, 0x00a8, 0x00a9, 0x00aa, 0x00ab, 0x00ac, 0x00ad, 0x00ae, 0x00af, 0x00b0, 0x00b1, 0x00b2, 0x00b3, 0x00b4, 0x00b5, 0x00b6, 0x00b7, diff --git a/ext/mbstring/mbstring.c b/ext/mbstring/mbstring.c index 068cb966699..0988a660784 100644 --- a/ext/mbstring/mbstring.c +++ b/ext/mbstring/mbstring.c @@ -134,7 +134,7 @@ static const enum mbfl_no_encoding php_mb_default_identify_list_neut[] = { }; -php_mb_nls_ident_list php_mb_default_identify_list[] = { +static const php_mb_nls_ident_list php_mb_default_identify_list[] = { { mbfl_no_language_japanese, php_mb_default_identify_list_ja, sizeof(php_mb_default_identify_list_ja) / sizeof(php_mb_default_identify_list_ja[0]) }, { mbfl_no_language_korean, php_mb_default_identify_list_kr, sizeof(php_mb_default_identify_list_kr) / sizeof(php_mb_default_identify_list_kr[0]) }, { mbfl_no_language_traditional_chinese, php_mb_default_identify_list_tw_hk, sizeof(php_mb_default_identify_list_tw_hk) / sizeof(php_mb_default_identify_list_tw_hk[0]) },