cvs: pecl /translit translit.c /translit/data convert.php cyrillic_transliterate.c diacritical_remove.c greek_transliterate.c han_transliterate.c
hangul_to_jamo_transliterate.c hebrew_transliterate.c jamo_transliterate.c lowercase_cyrillic.c lowercase_greek.c lowercase_latin.c
normalize_ligature.c normalize_punctuation.c numbers.c special_decompose.c translit_types.h uppercase_cyrillic.c uppercase_greek.c uppercase_latin.c
| From: | Derick Rethans | Date: | Thu, 11 Nov 2004 16:28:22 +0000 |
| Subject: | cvs: pecl /translit translit.c /translit/data convert.php cyrillic_transliterate.c diacritical_remove.c greek_transliterate.c han_transliterate.c hangul_to_jamo_transliterate.c hebrew_transliterate.c jamo_transliterate.c lowercase_cyrillic.c lowercase_greek.c lowercase_latin.c normalize_ligature.c normalize_punctuation.c numbers.c special_decompose.c translit_types.h uppercase_cyrillic.c uppercase_greek.c uppercase_latin.c |
||
| Groups: | php.pecl.cvs | ||
| Request: | Send a blank email to pecl-cvs+get-2022@lists.php.net to get a copy of this message | ||
derick Thu Nov 11 11:28:22 2004 EDT
Modified files:
/pecl/translit translit.c
/pecl/translit/data convert.php cyrillic_transliterate.c
diacritical_remove.c greek_transliterate.c
han_transliterate.c
hangul_to_jamo_transliterate.c
hebrew_transliterate.c jamo_transliterate.c
lowercase_cyrillic.c lowercase_greek.c
lowercase_latin.c normalize_ligature.c
normalize_punctuation.c numbers.c
special_decompose.c translit_types.h
uppercase_cyrillic.c uppercase_greek.c
uppercase_latin.c
Log:
- Removed empty structs (Both in manually written code and generated code).
- Fixed unused variable and other warnings.
http://cvs.php.net/diff.php/pecl/translit/translit.c?r1=1.5&r2=1.6&ty=u Index: pecl/translit/translit.c diff -u pecl/translit/translit.c:1.5 pecl/translit/translit.c:1.6 --- pecl/translit/translit.c:1.5 Wed Nov 10 06:24:56 2004 +++ pecl/translit/translit.c Thu Nov 11 11:28:17 2004 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: translit.c,v 1.5 2004/11/10 11:24:56 derick Exp $ */ +/* $Id: translit.c,v 1.6 2004/11/11 16:28:17 derick Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -59,11 +59,6 @@ ZEND_GET_MODULE(translit) #endif -/* {{{ PHP_INI */ -PHP_INI_BEGIN() -PHP_INI_END() -/* }}} */ - translit_filter_entry translit_filters[] = { #include "data/filter_table.h" @@ -72,6 +67,7 @@ PHP_MINIT_FUNCTION(translit) { + return SUCCESS; } /* {{{ PHP_MINFO_FUNCTION @@ -108,7 +104,7 @@ long str_len; int free_it = 0; - unsigned char *string, *outs; + unsigned char *string; unsigned short *in, *out; unsigned int inl, outl; @@ -122,7 +118,7 @@ while (zend_hash_get_current_data_ex(target_hash, (void **)&entry, &pos) == SUCCESS) { if (Z_TYPE_PP(entry) == IS_STRING) { - if (filter = translit_find_filter(Z_STRVAL_PP(entry))) { + if ((filter = translit_find_filter(Z_STRVAL_PP(entry)))) { filter(in, inl, &out, &outl); if (free_it) { free(in); http://cvs.php.net/diff.php/pecl/translit/data/convert.php?r1=1.5&r2=1.6&ty=u Index: pecl/translit/data/convert.php diff -u pecl/translit/data/convert.php:1.5 pecl/translit/data/convert.php:1.6 --- pecl/translit/data/convert.php:1.5 Tue Nov 9 05:14:30 2004 +++ pecl/translit/data/convert.php Thu Nov 11 11:28:19 2004 @@ -183,54 +183,63 @@ } $rev_jump = array(); + $table_definition = ''; /* Generate jump table */ $c = 0; - $table_definition = "static unsigned char *{$function_name}_jump_table[". (count($jumps)). "] = {\n"; - foreach ($jumps as $block => $dummy) - { - $table_definition .= "\t{$function_name}_jump_map_{$block},\n"; - $rev_jump[$c] = $block; - $c++; + if (count($jumps)) { + $table_definition .= "static unsigned char *{$function_name}_jump_table[". (count($jumps)). "] = {\n"; + foreach ($jumps as $block => $dummy) + { + $table_definition .= "\t{$function_name}_jump_map_{$block},\n"; + $rev_jump[$c] = $block; + $c++; + } + $table_definition .= "};\n"; } - $table_definition .= "};\n"; $rev_map = array(); /* Generate map table */ $c = 0; - $table_definition .= "static unsigned short *{$function_name}_map_table[". (count($map)). "] = {\n"; - foreach ($map as $block => $dummy) - { - $table_definition .= "\t{$function_name}_replace_map_{$block},\n"; - $rev_map[$block] = $c; - $c++; + if (count($map)) { + $table_definition .= "static unsigned short *{$function_name}_map_table[". (count($map)). "] = {\n"; + foreach ($map as $block => $dummy) + { + $table_definition .= "\t{$function_name}_replace_map_{$block},\n"; + $rev_map[$block] = $c; + $c++; + } + $table_definition .= "};\n"; } - $table_definition .= "};\n"; $rev_expand = array(); /* Generate expand table */ $c = 0; - $table_definition .= "static us$expand_max_length *{$function_name}_expand_table[". (count($expand)). "] = {\n"; - foreach ($expand as $block => $dummy) - { - $table_definition .= "\t{$function_name}_expand_map_{$block},\n"; - $rev_expand[$block] = $c; - $c++; + if (count($expand)) { + $table_definition .= "static us$expand_max_length *{$function_name}_expand_table[". (count($expand)). "] = {\n"; + foreach ($expand as $block => $dummy) + { + $table_definition .= "\t{$function_name}_expand_map_{$block},\n"; + $rev_expand[$block] = $c; + $c++; + } + $table_definition .= "};\n"; } - $table_definition .= "};\n"; $rev_transpose = array(); /* Generate transpose table */ $c = 0; - $table_definition .= "static unsigned short *{$function_name}_transpose_table[". (count($transpose)). "] = {\n"; - foreach ($transpose as $block => $dummy) - { - $table_definition .= "\t{$function_name}_transpose_map_{$block},\n"; - $rev_transpose[$block] = $c; - $c++; + if (count($transpose)) { + $table_definition .= "static unsigned short *{$function_name}_transpose_table[". (count($transpose)). "] = {\n"; + foreach ($transpose as $block => $dummy) + { + $table_definition .= "\t{$function_name}_transpose_map_{$block},\n"; + $rev_transpose[$block] = $c; + $c++; + } + $table_definition .= "};\n"; } - $table_definition .= "};\n"; $txt .= <<<ENDCODE $table_definition http://cvs.php.net/diff.php/pecl/translit/data/cyrillic_transliterate.c?r1=1.4&r2=1.5&ty=u Index: pecl/translit/data/cyrillic_transliterate.c diff -u pecl/translit/data/cyrillic_transliterate.c:1.4 pecl/translit/data/cyrillic_transliterate.c:1.5 --- pecl/translit/data/cyrillic_transliterate.c:1.4 Wed Nov 10 11:39:27 2004 +++ pecl/translit/data/cyrillic_transliterate.c Thu Nov 11 11:28:19 2004 @@ -87,8 +87,6 @@ static us3 *cyrillic_transliterate_expand_table[1] = { cyrillic_transliterate_expand_map_4, }; -static unsigned short *cyrillic_transliterate_transpose_table[0] = { -}; int cyrillic_transliterate_convert(unsigned short *in, unsigned int in_length, unsigned short **out, unsigned int *out_length) @@ -240,8 +238,6 @@ static us3 *cyrillic_transliterate_bulgarian_expand_table[1] = { cyrillic_transliterate_bulgarian_expand_map_4, }; -static unsigned short *cyrillic_transliterate_bulgarian_transpose_table[0] = { -}; int cyrillic_transliterate_bulgarian_convert(unsigned short *in, unsigned int in_length, unsigned short **out, unsigned int *out_length) http://cvs.php.net/diff.php/pecl/translit/data/diacritical_remove.c?r1=1.5&r2=1.6&ty=u Index: pecl/translit/data/diacritical_remove.c diff -u pecl/translit/data/diacritical_remove.c:1.5 pecl/translit/data/diacritical_remove.c:1.6 --- pecl/translit/data/diacritical_remove.c:1.5 Tue Nov 9 05:14:30 2004 +++ pecl/translit/data/diacritical_remove.c Thu Nov 11 11:28:19 2004 @@ -169,10 +169,6 @@ diacritical_remove_replace_map_2, diacritical_remove_replace_map_30, }; -static us0 *diacritical_remove_expand_table[0] = { -}; -static unsigned short *diacritical_remove_transpose_table[0] = { -}; int diacritical_remove_convert(unsigned short *in, unsigned int in_length, unsigned short **out, unsigned int *out_length) http://cvs.php.net/diff.php/pecl/translit/data/greek_transliterate.c?r1=1.3&r2=1.4&ty=u Index: pecl/translit/data/greek_transliterate.c diff -u pecl/translit/data/greek_transliterate.c:1.3 pecl/translit/data/greek_transliterate.c:1.4 --- pecl/translit/data/greek_transliterate.c:1.3 Tue Nov 9 05:14:30 2004 +++ pecl/translit/data/greek_transliterate.c Thu Nov 11 11:28:19 2004 @@ -87,8 +87,6 @@ static us3 *greek_transliterate_expand_table[1] = { greek_transliterate_expand_map_3, }; -static unsigned short *greek_transliterate_transpose_table[0] = { -}; int greek_transliterate_convert(unsigned short *in, unsigned int in_length, unsigned short **out, unsigned int *out_length) http://cvs.php.net/diff.php/pecl/translit/data/han_transliterate.c?r1=1.3&r2=1.4&ty=u Index: pecl/translit/data/han_transliterate.c diff -u pecl/translit/data/han_transliterate.c:1.3 pecl/translit/data/han_transliterate.c:1.4 --- pecl/translit/data/han_transliterate.c:1.3 Tue Nov 9 05:14:30 2004 +++ pecl/translit/data/han_transliterate.c Thu Nov 11 11:28:19 2004 @@ -6057,8 +6057,6 @@ han_transliterate_jump_map_250, han_transliterate_jump_map_249, }; -static unsigned short *han_transliterate_map_table[0] = { -}; static us6 *han_transliterate_expand_table[110] = { han_transliterate_expand_map_84, han_transliterate_expand_map_147, @@ -6171,8 +6169,6 @@ han_transliterate_expand_map_250, han_transliterate_expand_map_249, }; -static unsigned short *han_transliterate_transpose_table[0] = { -}; int han_transliterate_convert(unsigned short *in, unsigned int in_length, unsigned short **out, unsigned int *out_length) http://cvs.php.net/diff.php/pecl/translit/data/hangul_to_jamo_transliterate.c?r1=1.1&r2=1.2&ty=u Index: pecl/translit/data/hangul_to_jamo_transliterate.c diff -u pecl/translit/data/hangul_to_jamo_transliterate.c:1.1 pecl/translit/data/hangul_to_jamo_transliterate.c:1.2 --- pecl/translit/data/hangul_to_jamo_transliterate.c:1.1 Tue Nov 9 05:14:30 2004 +++ pecl/translit/data/hangul_to_jamo_transliterate.c Thu Nov 11 11:28:20 2004 @@ -2,15 +2,11 @@ int hangul_to_jamo_transliterate_convert(unsigned short *in, unsigned int in_length, unsigned short **out, unsigned int *out_length) { - unsigned int i, j, no_jump, jump, out_idx; - unsigned char block, cp; - unsigned char *jump_map; - unsigned short *replace_map, *transpose_map; - us3 *expand_map; + unsigned int i, out_idx; unsigned short *tmp_out; unsigned int str_length, SIndex; unsigned short SBase = 0xAC00, LBase = 0x1100, VBase = 0x1161, L, V, T; - unsigned short TBase = 0x11A7, SCount = 11172, LCount = 19, VCount = 21, TCount = 28, NCount; + unsigned short TBase = 0x11A7, SCount = 11172, VCount = 21, TCount = 28, NCount; NCount = VCount * TCount; http://cvs.php.net/diff.php/pecl/translit/data/hebrew_transliterate.c?r1=1.3&r2=1.4&ty=u Index: pecl/translit/data/hebrew_transliterate.c diff -u pecl/translit/data/hebrew_transliterate.c:1.3 pecl/translit/data/hebrew_transliterate.c:1.4 --- pecl/translit/data/hebrew_transliterate.c:1.3 Tue Nov 9 05:14:30 2004 +++ pecl/translit/data/hebrew_transliterate.c Thu Nov 11 11:28:20 2004 @@ -87,8 +87,6 @@ static us2 *hebrew_transliterate_expand_table[1] = { hebrew_transliterate_expand_map_5, }; -static unsigned short *hebrew_transliterate_transpose_table[0] = { -}; int hebrew_transliterate_convert(unsigned short *in, unsigned int in_length, unsigned short **out, unsigned int *out_length) http://cvs.php.net/diff.php/pecl/translit/data/jamo_transliterate.c?r1=1.1&r2=1.2&ty=u Index: pecl/translit/data/jamo_transliterate.c diff -u pecl/translit/data/jamo_transliterate.c:1.1 pecl/translit/data/jamo_transliterate.c:1.2 --- pecl/translit/data/jamo_transliterate.c:1.1 Tue Nov 9 05:14:30 2004 +++ pecl/translit/data/jamo_transliterate.c Thu Nov 11 11:28:20 2004 @@ -87,8 +87,6 @@ static us3 *jamo_transliterate_expand_table[1] = { jamo_transliterate_expand_map_17, }; -static unsigned short *jamo_transliterate_transpose_table[0] = { -}; int jamo_transliterate_convert(unsigned short *in, unsigned int in_length, unsigned short **out, unsigned int *out_length) http://cvs.php.net/diff.php/pecl/translit/data/lowercase_cyrillic.c?r1=1.3&r2=1.4&ty=u Index: pecl/translit/data/lowercase_cyrillic.c diff -u pecl/translit/data/lowercase_cyrillic.c:1.3 pecl/translit/data/lowercase_cyrillic.c:1.4 --- pecl/translit/data/lowercase_cyrillic.c:1.3 Tue Nov 9 05:14:30 2004 +++ pecl/translit/data/lowercase_cyrillic.c Thu Nov 11 11:28:20 2004 @@ -85,10 +85,6 @@ lowercase_cyrillic_jump_map_4, lowercase_cyrillic_jump_map_5, }; -static unsigned short *lowercase_cyrillic_map_table[0] = { -}; -static us0 *lowercase_cyrillic_expand_table[0] = { -}; static unsigned short *lowercase_cyrillic_transpose_table[2] = { lowercase_cyrillic_transpose_map_4, lowercase_cyrillic_transpose_map_5, http://cvs.php.net/diff.php/pecl/translit/data/lowercase_greek.c?r1=1.3&r2=1.4&ty=u Index: pecl/translit/data/lowercase_greek.c diff -u pecl/translit/data/lowercase_greek.c:1.3 pecl/translit/data/lowercase_greek.c:1.4 --- pecl/translit/data/lowercase_greek.c:1.3 Tue Nov 9 05:14:30 2004 +++ pecl/translit/data/lowercase_greek.c Thu Nov 11 11:28:20 2004 @@ -46,10 +46,6 @@ static unsigned char *lowercase_greek_jump_table[1] = { lowercase_greek_jump_map_3, }; -static unsigned short *lowercase_greek_map_table[0] = { -}; -static us0 *lowercase_greek_expand_table[0] = { -}; static unsigned short *lowercase_greek_transpose_table[1] = { lowercase_greek_transpose_map_3, }; http://cvs.php.net/diff.php/pecl/translit/data/lowercase_latin.c?r1=1.3&r2=1.4&ty=u Index: pecl/translit/data/lowercase_latin.c diff -u pecl/translit/data/lowercase_latin.c:1.3 pecl/translit/data/lowercase_latin.c:1.4 --- pecl/translit/data/lowercase_latin.c:1.3 Tue Nov 9 05:14:30 2004 +++ pecl/translit/data/lowercase_latin.c Thu Nov 11 11:28:20 2004 @@ -163,10 +163,6 @@ lowercase_latin_jump_map_2, lowercase_latin_jump_map_30, }; -static unsigned short *lowercase_latin_map_table[0] = { -}; -static us0 *lowercase_latin_expand_table[0] = { -}; static unsigned short *lowercase_latin_transpose_table[4] = { lowercase_latin_transpose_map_0, lowercase_latin_transpose_map_1, http://cvs.php.net/diff.php/pecl/translit/data/normalize_ligature.c?r1=1.3&r2=1.4&ty=u Index: pecl/translit/data/normalize_ligature.c diff -u pecl/translit/data/normalize_ligature.c:1.3 pecl/translit/data/normalize_ligature.c:1.4 --- pecl/translit/data/normalize_ligature.c:1.3 Tue Nov 9 05:14:30 2004 +++ pecl/translit/data/normalize_ligature.c Thu Nov 11 11:28:20 2004 @@ -117,14 +117,10 @@ normalize_ligature_jump_map_0, normalize_ligature_jump_map_1, }; -static unsigned short *normalize_ligature_map_table[0] = { -}; static us2 *normalize_ligature_expand_table[2] = { normalize_ligature_expand_map_0, normalize_ligature_expand_map_1, }; -static unsigned short *normalize_ligature_transpose_table[0] = { -}; int normalize_ligature_convert(unsigned short *in, unsigned int in_length, unsigned short **out, unsigned int *out_length) http://cvs.php.net/diff.php/pecl/translit/data/normalize_punctuation.c?r1=1.3&r2=1.4&ty=u Index: pecl/translit/data/normalize_punctuation.c diff -u pecl/translit/data/normalize_punctuation.c:1.3 pecl/translit/data/normalize_punctuation.c:1.4 --- pecl/translit/data/normalize_punctuation.c:1.3 Tue Nov 9 05:14:31 2004 +++ pecl/translit/data/normalize_punctuation.c Thu Nov 11 11:28:20 2004 @@ -247,8 +247,6 @@ static us2 *normalize_punctuation_expand_table[1] = { normalize_punctuation_expand_map_32, }; -static unsigned short *normalize_punctuation_transpose_table[0] = { -}; int normalize_punctuation_convert(unsigned short *in, unsigned int in_length, unsigned short **out, unsigned int *out_length) http://cvs.php.net/diff.php/pecl/translit/data/numbers.c?r1=1.1&r2=1.2&ty=u Index: pecl/translit/data/numbers.c diff -u pecl/translit/data/numbers.c:1.1 pecl/translit/data/numbers.c:1.2 --- pecl/translit/data/numbers.c:1.1 Tue Nov 9 05:14:31 2004 +++ pecl/translit/data/numbers.c Thu Nov 11 11:28:20 2004 @@ -108,8 +108,6 @@ normalize_superscript_numbers_replace_map_0, normalize_superscript_numbers_replace_map_32, }; -static us0 *normalize_superscript_numbers_expand_table[0] = { -}; static unsigned short *normalize_superscript_numbers_transpose_table[1] = { normalize_superscript_numbers_transpose_map_32, }; @@ -224,10 +222,6 @@ static unsigned char *normalize_subscript_numbers_jump_table[1] = { normalize_subscript_numbers_jump_map_32, }; -static unsigned short *normalize_subscript_numbers_map_table[0] = { -}; -static us0 *normalize_subscript_numbers_expand_table[0] = { -}; static unsigned short *normalize_subscript_numbers_transpose_table[1] = { normalize_subscript_numbers_transpose_map_32, }; @@ -988,8 +982,6 @@ normalize_numbers_replace_map_0, normalize_numbers_replace_map_32, }; -static us0 *normalize_numbers_expand_table[0] = { -}; static unsigned short *normalize_numbers_transpose_table[16] = { normalize_numbers_transpose_map_32, normalize_numbers_transpose_map_6, @@ -1196,8 +1188,6 @@ normalize_superscript_replace_map_0, normalize_superscript_replace_map_32, }; -static us0 *normalize_superscript_expand_table[0] = { -}; static unsigned short *normalize_superscript_transpose_table[1] = { normalize_superscript_transpose_map_32, }; @@ -1334,8 +1324,6 @@ static unsigned short *normalize_subscript_map_table[1] = { normalize_subscript_replace_map_32, }; -static us0 *normalize_subscript_expand_table[0] = { -}; static unsigned short *normalize_subscript_transpose_table[1] = { normalize_subscript_transpose_map_32, }; http://cvs.php.net/diff.php/pecl/translit/data/special_decompose.c?r1=1.1&r2=1.2&ty=u Index: pecl/translit/data/special_decompose.c diff -u pecl/translit/data/special_decompose.c:1.1 pecl/translit/data/special_decompose.c:1.2 --- pecl/translit/data/special_decompose.c:1.1 Tue Nov 9 05:14:31 2004 +++ pecl/translit/data/special_decompose.c Thu Nov 11 11:28:20 2004 @@ -62,13 +62,9 @@ static unsigned char *decompose_special_jump_table[1] = { decompose_special_jump_map_0, }; -static unsigned short *decompose_special_map_table[0] = { -}; static us5 *decompose_special_expand_table[1] = { decompose_special_expand_map_0, }; -static unsigned short *decompose_special_transpose_table[0] = { -}; int decompose_special_convert(unsigned short *in, unsigned int in_length, unsigned short **out, unsigned int *out_length) @@ -260,8 +256,6 @@ static us3 *decompose_currency_signs_expand_table[1] = { decompose_currency_signs_expand_map_32, }; -static unsigned short *decompose_currency_signs_transpose_table[0] = { -}; int decompose_currency_signs_convert(unsigned short *in, unsigned int in_length, unsigned short **out, unsigned int *out_length) @@ -490,8 +484,6 @@ decompose_expand_map_0, decompose_expand_map_32, }; -static unsigned short *decompose_transpose_table[0] = { -}; int decompose_convert(unsigned short *in, unsigned int in_length, unsigned short **out, unsigned int *out_length) http://cvs.php.net/diff.php/pecl/translit/data/translit_types.h?r1=1.3&r2=1.4&ty=u Index: pecl/translit/data/translit_types.h diff -u pecl/translit/data/translit_types.h:1.3 pecl/translit/data/translit_types.h:1.4 --- pecl/translit/data/translit_types.h:1.3 Wed Nov 10 17:44:24 2004 +++ pecl/translit/data/translit_types.h Thu Nov 11 11:28:20 2004 @@ -1,6 +1,4 @@ -#ifdef PHP_WIN32 #include <malloc.h> -#endif typedef unsigned short us0[1]; typedef unsigned short us1[2]; http://cvs.php.net/diff.php/pecl/translit/data/uppercase_cyrillic.c?r1=1.3&r2=1.4&ty=u Index: pecl/translit/data/uppercase_cyrillic.c diff -u pecl/translit/data/uppercase_cyrillic.c:1.3 pecl/translit/data/uppercase_cyrillic.c:1.4 --- pecl/translit/data/uppercase_cyrillic.c:1.3 Tue Nov 9 05:14:31 2004 +++ pecl/translit/data/uppercase_cyrillic.c Thu Nov 11 11:28:20 2004 @@ -85,10 +85,6 @@ uppercase_cyrillic_jump_map_4, uppercase_cyrillic_jump_map_5, }; -static unsigned short *uppercase_cyrillic_map_table[0] = { -}; -static us0 *uppercase_cyrillic_expand_table[0] = { -}; static unsigned short *uppercase_cyrillic_transpose_table[2] = { uppercase_cyrillic_transpose_map_4, uppercase_cyrillic_transpose_map_5, http://cvs.php.net/diff.php/pecl/translit/data/uppercase_greek.c?r1=1.3&r2=1.4&ty=u Index: pecl/translit/data/uppercase_greek.c diff -u pecl/translit/data/uppercase_greek.c:1.3 pecl/translit/data/uppercase_greek.c:1.4 --- pecl/translit/data/uppercase_greek.c:1.3 Tue Nov 9 05:14:31 2004 +++ pecl/translit/data/uppercase_greek.c Thu Nov 11 11:28:21 2004 @@ -68,8 +68,6 @@ static unsigned short *uppercase_greek_map_table[1] = { uppercase_greek_replace_map_3, }; -static us0 *uppercase_greek_expand_table[0] = { -}; static unsigned short *uppercase_greek_transpose_table[1] = { uppercase_greek_transpose_map_3, }; http://cvs.php.net/diff.php/pecl/translit/data/uppercase_latin.c?r1=1.3&r2=1.4&ty=u Index: pecl/translit/data/uppercase_latin.c diff -u pecl/translit/data/uppercase_latin.c:1.3 pecl/translit/data/uppercase_latin.c:1.4 --- pecl/translit/data/uppercase_latin.c:1.3 Tue Nov 9 05:14:31 2004 +++ pecl/translit/data/uppercase_latin.c Thu Nov 11 11:28:21 2004 @@ -163,10 +163,6 @@ uppercase_latin_jump_map_2, uppercase_latin_jump_map_30, }; -static unsigned short *uppercase_latin_map_table[0] = { -}; -static us0 *uppercase_latin_expand_table[0] = { -}; static unsigned short *uppercase_latin_transpose_table[4] = { uppercase_latin_transpose_map_0, uppercase_latin_transpose_map_1,
http://cvs.php.net/diff.php/pecl/translit/translit.c?r1=1.5&r2=1.6&ty=u Index: pecl/translit/translit.c diff -u pecl/translit/translit.c:1.5 pecl/translit/translit.c:1.6 --- pecl/translit/translit.c:1.5 Wed Nov 10 06:24:56 2004 +++ pecl/translit/translit.c Thu Nov 11 11:28:17 2004 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: translit.c,v 1.5 2004/11/10 11:24:56 derick Exp $ */ +/* $Id: translit.c,v 1.6 2004/11/11 16:28:17 derick Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -59,11 +59,6 @@ ZEND_GET_MODULE(translit) #endif -/* {{{ PHP_INI */ -PHP_INI_BEGIN() -PHP_INI_END() -/* }}} */ - translit_filter_entry translit_filters[] = { #include "data/filter_table.h" @@ -72,6 +67,7 @@ PHP_MINIT_FUNCTION(translit) { + return SUCCESS; } /* {{{ PHP_MINFO_FUNCTION @@ -108,7 +104,7 @@ long str_len; int free_it = 0; - unsigned char *string, *outs; + unsigned char *string; unsigned short *in, *out; unsigned int inl, outl; @@ -122,7 +118,7 @@ while (zend_hash_get_current_data_ex(target_hash, (void **)&entry, &pos) == SUCCESS) { if (Z_TYPE_PP(entry) == IS_STRING) { - if (filter = translit_find_filter(Z_STRVAL_PP(entry))) { + if ((filter = translit_find_filter(Z_STRVAL_PP(entry)))) { filter(in, inl, &out, &outl); if (free_it) { free(in); http://cvs.php.net/diff.php/pecl/translit/data/convert.php?r1=1.5&r2=1.6&ty=u Index: pecl/translit/data/convert.php diff -u pecl/translit/data/convert.php:1.5 pecl/translit/data/convert.php:1.6 --- pecl/translit/data/convert.php:1.5 Tue Nov 9 05:14:30 2004 +++ pecl/translit/data/convert.php Thu Nov 11 11:28:19 2004 @@ -183,54 +183,63 @@ } $rev_jump = array(); + $table_definition = ''; /* Generate jump table */ $c = 0; - $table_definition = "static unsigned char *{$function_name}_jump_table[". (count($jumps)). "] = {\n"; - foreach ($jumps as $block => $dummy) - { - $table_definition .= "\t{$function_name}_jump_map_{$block},\n"; - $rev_jump[$c] = $block; - $c++; + if (count($jumps)) { + $table_definition .= "static unsigned char *{$function_name}_jump_table[". (count($jumps)). "] = {\n"; + foreach ($jumps as $block => $dummy) + { + $table_definition .= "\t{$function_name}_jump_map_{$block},\n"; + $rev_jump[$c] = $block; + $c++; + } + $table_definition .= "};\n"; } - $table_definition .= "};\n"; $rev_map = array(); /* Generate map table */ $c = 0; - $table_definition .= "static unsigned short *{$function_name}_map_table[". (count($map)). "] = {\n"; - foreach ($map as $block => $dummy) - { - $table_definition .= "\t{$function_name}_replace_map_{$block},\n"; - $rev_map[$block] = $c; - $c++; + if (count($map)) { + $table_definition .= "static unsigned short *{$function_name}_map_table[". (count($map)). "] = {\n"; + foreach ($map as $block => $dummy) + { + $table_definition .= "\t{$function_name}_replace_map_{$block},\n"; + $rev_map[$block] = $c; + $c++; + } + $table_definition .= "};\n"; } - $table_definition .= "};\n"; $rev_expand = array(); /* Generate expand table */ $c = 0; - $table_definition .= "static us$expand_max_length *{$function_name}_expand_table[". (count($expand)). "] = {\n"; - foreach ($expand as $block => $dummy) - { - $table_definition .= "\t{$function_name}_expand_map_{$block},\n"; - $rev_expand[$block] = $c; - $c++; + if (count($expand)) { + $table_definition .= "static us$expand_max_length *{$function_name}_expand_table[". (count($expand)). "] = {\n"; + foreach ($expand as $block => $dummy) + { + $table_definition .= "\t{$function_name}_expand_map_{$block},\n"; + $rev_expand[$block] = $c; + $c++; + } + $table_definition .= "};\n"; } - $table_definition .= "};\n"; $rev_transpose = array(); /* Generate transpose table */ $c = 0; - $table_definition .= "static unsigned short *{$function_name}_transpose_table[". (count($transpose)). "] = {\n"; - foreach ($transpose as $block => $dummy) - { - $table_definition .= "\t{$function_name}_transpose_map_{$block},\n"; - $rev_transpose[$block] = $c; - $c++; + if (count($transpose)) { + $table_definition .= "static unsigned short *{$function_name}_transpose_table[". (count($transpose)). "] = {\n"; + foreach ($transpose as $block => $dummy) + { + $table_definition .= "\t{$function_name}_transpose_map_{$block},\n"; + $rev_transpose[$block] = $c; + $c++; + } + $table_definition .= "};\n"; } - $table_definition .= "};\n"; $txt .= <<<ENDCODE $table_definition http://cvs.php.net/diff.php/pecl/translit/data/cyrillic_transliterate.c?r1=1.4&r2=1.5&ty=u Index: pecl/translit/data/cyrillic_transliterate.c diff -u pecl/translit/data/cyrillic_transliterate.c:1.4 pecl/translit/data/cyrillic_transliterate.c:1.5 --- pecl/translit/data/cyrillic_transliterate.c:1.4 Wed Nov 10 11:39:27 2004 +++ pecl/translit/data/cyrillic_transliterate.c Thu Nov 11 11:28:19 2004 @@ -87,8 +87,6 @@ static us3 *cyrillic_transliterate_expand_table[1] = { cyrillic_transliterate_expand_map_4, }; -static unsigned short *cyrillic_transliterate_transpose_table[0] = { -}; int cyrillic_transliterate_convert(unsigned short *in, unsigned int in_length, unsigned short **out, unsigned int *out_length) @@ -240,8 +238,6 @@ static us3 *cyrillic_transliterate_bulgarian_expand_table[1] = { cyrillic_transliterate_bulgarian_expand_map_4, }; -static unsigned short *cyrillic_transliterate_bulgarian_transpose_table[0] = { -}; int cyrillic_transliterate_bulgarian_convert(unsigned short *in, unsigned int in_length, unsigned short **out, unsigned int *out_length) http://cvs.php.net/diff.php/pecl/translit/data/diacritical_remove.c?r1=1.5&r2=1.6&ty=u Index: pecl/translit/data/diacritical_remove.c diff -u pecl/translit/data/diacritical_remove.c:1.5 pecl/translit/data/diacritical_remove.c:1.6 --- pecl/translit/data/diacritical_remove.c:1.5 Tue Nov 9 05:14:30 2004 +++ pecl/translit/data/diacritical_remove.c Thu Nov 11 11:28:19 2004 @@ -169,10 +169,6 @@ diacritical_remove_replace_map_2, diacritical_remove_replace_map_30, }; -static us0 *diacritical_remove_expand_table[0] = { -}; -static unsigned short *diacritical_remove_transpose_table[0] = { -}; int diacritical_remove_convert(unsigned short *in, unsigned int in_length, unsigned short **out, unsigned int *out_length) http://cvs.php.net/diff.php/pecl/translit/data/greek_transliterate.c?r1=1.3&r2=1.4&ty=u Index: pecl/translit/data/greek_transliterate.c diff -u pecl/translit/data/greek_transliterate.c:1.3 pecl/translit/data/greek_transliterate.c:1.4 --- pecl/translit/data/greek_transliterate.c:1.3 Tue Nov 9 05:14:30 2004 +++ pecl/translit/data/greek_transliterate.c Thu Nov 11 11:28:19 2004 @@ -87,8 +87,6 @@ static us3 *greek_transliterate_expand_table[1] = { greek_transliterate_expand_map_3, }; -static unsigned short *greek_transliterate_transpose_table[0] = { -}; int greek_transliterate_convert(unsigned short *in, unsigned int in_length, unsigned short **out, unsigned int *out_length) http://cvs.php.net/diff.php/pecl/translit/data/han_transliterate.c?r1=1.3&r2=1.4&ty=u Index: pecl/translit/data/han_transliterate.c diff -u pecl/translit/data/han_transliterate.c:1.3 pecl/translit/data/han_transliterate.c:1.4 --- pecl/translit/data/han_transliterate.c:1.3 Tue Nov 9 05:14:30 2004 +++ pecl/translit/data/han_transliterate.c Thu Nov 11 11:28:19 2004 @@ -6057,8 +6057,6 @@ han_transliterate_jump_map_250, han_transliterate_jump_map_249, }; -static unsigned short *han_transliterate_map_table[0] = { -}; static us6 *han_transliterate_expand_table[110] = { han_transliterate_expand_map_84, han_transliterate_expand_map_147, @@ -6171,8 +6169,6 @@ han_transliterate_expand_map_250, han_transliterate_expand_map_249, }; -static unsigned short *han_transliterate_transpose_table[0] = { -}; int han_transliterate_convert(unsigned short *in, unsigned int in_length, unsigned short **out, unsigned int *out_length) http://cvs.php.net/diff.php/pecl/translit/data/hangul_to_jamo_transliterate.c?r1=1.1&r2=1.2&ty=u Index: pecl/translit/data/hangul_to_jamo_transliterate.c diff -u pecl/translit/data/hangul_to_jamo_transliterate.c:1.1 pecl/translit/data/hangul_to_jamo_transliterate.c:1.2 --- pecl/translit/data/hangul_to_jamo_transliterate.c:1.1 Tue Nov 9 05:14:30 2004 +++ pecl/translit/data/hangul_to_jamo_transliterate.c Thu Nov 11 11:28:20 2004 @@ -2,15 +2,11 @@ int hangul_to_jamo_transliterate_convert(unsigned short *in, unsigned int in_length, unsigned short **out, unsigned int *out_length) { - unsigned int i, j, no_jump, jump, out_idx; - unsigned char block, cp; - unsigned char *jump_map; - unsigned short *replace_map, *transpose_map; - us3 *expand_map; + unsigned int i, out_idx; unsigned short *tmp_out; unsigned int str_length, SIndex; unsigned short SBase = 0xAC00, LBase = 0x1100, VBase = 0x1161, L, V, T; - unsigned short TBase = 0x11A7, SCount = 11172, LCount = 19, VCount = 21, TCount = 28, NCount; + unsigned short TBase = 0x11A7, SCount = 11172, VCount = 21, TCount = 28, NCount; NCount = VCount * TCount; http://cvs.php.net/diff.php/pecl/translit/data/hebrew_transliterate.c?r1=1.3&r2=1.4&ty=u Index: pecl/translit/data/hebrew_transliterate.c diff -u pecl/translit/data/hebrew_transliterate.c:1.3 pecl/translit/data/hebrew_transliterate.c:1.4 --- pecl/translit/data/hebrew_transliterate.c:1.3 Tue Nov 9 05:14:30 2004 +++ pecl/translit/data/hebrew_transliterate.c Thu Nov 11 11:28:20 2004 @@ -87,8 +87,6 @@ static us2 *hebrew_transliterate_expand_table[1] = { hebrew_transliterate_expand_map_5, }; -static unsigned short *hebrew_transliterate_transpose_table[0] = { -}; int hebrew_transliterate_convert(unsigned short *in, unsigned int in_length, unsigned short **out, unsigned int *out_length) http://cvs.php.net/diff.php/pecl/translit/data/jamo_transliterate.c?r1=1.1&r2=1.2&ty=u Index: pecl/translit/data/jamo_transliterate.c diff -u pecl/translit/data/jamo_transliterate.c:1.1 pecl/translit/data/jamo_transliterate.c:1.2 --- pecl/translit/data/jamo_transliterate.c:1.1 Tue Nov 9 05:14:30 2004 +++ pecl/translit/data/jamo_transliterate.c Thu Nov 11 11:28:20 2004 @@ -87,8 +87,6 @@ static us3 *jamo_transliterate_expand_table[1] = { jamo_transliterate_expand_map_17, }; -static unsigned short *jamo_transliterate_transpose_table[0] = { -}; int jamo_transliterate_convert(unsigned short *in, unsigned int in_length, unsigned short **out, unsigned int *out_length) http://cvs.php.net/diff.php/pecl/translit/data/lowercase_cyrillic.c?r1=1.3&r2=1.4&ty=u Index: pecl/translit/data/lowercase_cyrillic.c diff -u pecl/translit/data/lowercase_cyrillic.c:1.3 pecl/translit/data/lowercase_cyrillic.c:1.4 --- pecl/translit/data/lowercase_cyrillic.c:1.3 Tue Nov 9 05:14:30 2004 +++ pecl/translit/data/lowercase_cyrillic.c Thu Nov 11 11:28:20 2004 @@ -85,10 +85,6 @@ lowercase_cyrillic_jump_map_4, lowercase_cyrillic_jump_map_5, }; -static unsigned short *lowercase_cyrillic_map_table[0] = { -}; -static us0 *lowercase_cyrillic_expand_table[0] = { -}; static unsigned short *lowercase_cyrillic_transpose_table[2] = { lowercase_cyrillic_transpose_map_4, lowercase_cyrillic_transpose_map_5, http://cvs.php.net/diff.php/pecl/translit/data/lowercase_greek.c?r1=1.3&r2=1.4&ty=u Index: pecl/translit/data/lowercase_greek.c diff -u pecl/translit/data/lowercase_greek.c:1.3 pecl/translit/data/lowercase_greek.c:1.4 --- pecl/translit/data/lowercase_greek.c:1.3 Tue Nov 9 05:14:30 2004 +++ pecl/translit/data/lowercase_greek.c Thu Nov 11 11:28:20 2004 @@ -46,10 +46,6 @@ static unsigned char *lowercase_greek_jump_table[1] = { lowercase_greek_jump_map_3, }; -static unsigned short *lowercase_greek_map_table[0] = { -}; -static us0 *lowercase_greek_expand_table[0] = { -}; static unsigned short *lowercase_greek_transpose_table[1] = { lowercase_greek_transpose_map_3, }; http://cvs.php.net/diff.php/pecl/translit/data/lowercase_latin.c?r1=1.3&r2=1.4&ty=u Index: pecl/translit/data/lowercase_latin.c diff -u pecl/translit/data/lowercase_latin.c:1.3 pecl/translit/data/lowercase_latin.c:1.4 --- pecl/translit/data/lowercase_latin.c:1.3 Tue Nov 9 05:14:30 2004 +++ pecl/translit/data/lowercase_latin.c Thu Nov 11 11:28:20 2004 @@ -163,10 +163,6 @@ lowercase_latin_jump_map_2, lowercase_latin_jump_map_30, }; -static unsigned short *lowercase_latin_map_table[0] = { -}; -static us0 *lowercase_latin_expand_table[0] = { -}; static unsigned short *lowercase_latin_transpose_table[4] = { lowercase_latin_transpose_map_0, lowercase_latin_transpose_map_1, http://cvs.php.net/diff.php/pecl/translit/data/normalize_ligature.c?r1=1.3&r2=1.4&ty=u Index: pecl/translit/data/normalize_ligature.c diff -u pecl/translit/data/normalize_ligature.c:1.3 pecl/translit/data/normalize_ligature.c:1.4 --- pecl/translit/data/normalize_ligature.c:1.3 Tue Nov 9 05:14:30 2004 +++ pecl/translit/data/normalize_ligature.c Thu Nov 11 11:28:20 2004 @@ -117,14 +117,10 @@ normalize_ligature_jump_map_0, normalize_ligature_jump_map_1, }; -static unsigned short *normalize_ligature_map_table[0] = { -}; static us2 *normalize_ligature_expand_table[2] = { normalize_ligature_expand_map_0, normalize_ligature_expand_map_1, }; -static unsigned short *normalize_ligature_transpose_table[0] = { -}; int normalize_ligature_convert(unsigned short *in, unsigned int in_length, unsigned short **out, unsigned int *out_length) http://cvs.php.net/diff.php/pecl/translit/data/normalize_punctuation.c?r1=1.3&r2=1.4&ty=u Index: pecl/translit/data/normalize_punctuation.c diff -u pecl/translit/data/normalize_punctuation.c:1.3 pecl/translit/data/normalize_punctuation.c:1.4 --- pecl/translit/data/normalize_punctuation.c:1.3 Tue Nov 9 05:14:31 2004 +++ pecl/translit/data/normalize_punctuation.c Thu Nov 11 11:28:20 2004 @@ -247,8 +247,6 @@ static us2 *normalize_punctuation_expand_table[1] = { normalize_punctuation_expand_map_32, }; -static unsigned short *normalize_punctuation_transpose_table[0] = { -}; int normalize_punctuation_convert(unsigned short *in, unsigned int in_length, unsigned short **out, unsigned int *out_length) http://cvs.php.net/diff.php/pecl/translit/data/numbers.c?r1=1.1&r2=1.2&ty=u Index: pecl/translit/data/numbers.c diff -u pecl/translit/data/numbers.c:1.1 pecl/translit/data/numbers.c:1.2 --- pecl/translit/data/numbers.c:1.1 Tue Nov 9 05:14:31 2004 +++ pecl/translit/data/numbers.c Thu Nov 11 11:28:20 2004 @@ -108,8 +108,6 @@ normalize_superscript_numbers_replace_map_0, normalize_superscript_numbers_replace_map_32, }; -static us0 *normalize_superscript_numbers_expand_table[0] = { -}; static unsigned short *normalize_superscript_numbers_transpose_table[1] = { normalize_superscript_numbers_transpose_map_32, }; @@ -224,10 +222,6 @@ static unsigned char *normalize_subscript_numbers_jump_table[1] = { normalize_subscript_numbers_jump_map_32, }; -static unsigned short *normalize_subscript_numbers_map_table[0] = { -}; -static us0 *normalize_subscript_numbers_expand_table[0] = { -}; static unsigned short *normalize_subscript_numbers_transpose_table[1] = { normalize_subscript_numbers_transpose_map_32, }; @@ -988,8 +982,6 @@ normalize_numbers_replace_map_0, normalize_numbers_replace_map_32, }; -static us0 *normalize_numbers_expand_table[0] = { -}; static unsigned short *normalize_numbers_transpose_table[16] = { normalize_numbers_transpose_map_32, normalize_numbers_transpose_map_6, @@ -1196,8 +1188,6 @@ normalize_superscript_replace_map_0, normalize_superscript_replace_map_32, }; -static us0 *normalize_superscript_expand_table[0] = { -}; static unsigned short *normalize_superscript_transpose_table[1] = { normalize_superscript_transpose_map_32, }; @@ -1334,8 +1324,6 @@ static unsigned short *normalize_subscript_map_table[1] = { normalize_subscript_replace_map_32, }; -static us0 *normalize_subscript_expand_table[0] = { -}; static unsigned short *normalize_subscript_transpose_table[1] = { normalize_subscript_transpose_map_32, }; http://cvs.php.net/diff.php/pecl/translit/data/special_decompose.c?r1=1.1&r2=1.2&ty=u Index: pecl/translit/data/special_decompose.c diff -u pecl/translit/data/special_decompose.c:1.1 pecl/translit/data/special_decompose.c:1.2 --- pecl/translit/data/special_decompose.c:1.1 Tue Nov 9 05:14:31 2004 +++ pecl/translit/data/special_decompose.c Thu Nov 11 11:28:20 2004 @@ -62,13 +62,9 @@ static unsigned char *decompose_special_jump_table[1] = { decompose_special_jump_map_0, }; -static unsigned short *decompose_special_map_table[0] = { -}; static us5 *decompose_special_expand_table[1] = { decompose_special_expand_map_0, }; -static unsigned short *decompose_special_transpose_table[0] = { -}; int decompose_special_convert(unsigned short *in, unsigned int in_length, unsigned short **out, unsigned int *out_length) @@ -260,8 +256,6 @@ static us3 *decompose_currency_signs_expand_table[1] = { decompose_currency_signs_expand_map_32, }; -static unsigned short *decompose_currency_signs_transpose_table[0] = { -}; int decompose_currency_signs_convert(unsigned short *in, unsigned int in_length, unsigned short **out, unsigned int *out_length) @@ -490,8 +484,6 @@ decompose_expand_map_0, decompose_expand_map_32, }; -static unsigned short *decompose_transpose_table[0] = { -}; int decompose_convert(unsigned short *in, unsigned int in_length, unsigned short **out, unsigned int *out_length) http://cvs.php.net/diff.php/pecl/translit/data/translit_types.h?r1=1.3&r2=1.4&ty=u Index: pecl/translit/data/translit_types.h diff -u pecl/translit/data/translit_types.h:1.3 pecl/translit/data/translit_types.h:1.4 --- pecl/translit/data/translit_types.h:1.3 Wed Nov 10 17:44:24 2004 +++ pecl/translit/data/translit_types.h Thu Nov 11 11:28:20 2004 @@ -1,6 +1,4 @@ -#ifdef PHP_WIN32 #include <malloc.h> -#endif typedef unsigned short us0[1]; typedef unsigned short us1[2]; http://cvs.php.net/diff.php/pecl/translit/data/uppercase_cyrillic.c?r1=1.3&r2=1.4&ty=u Index: pecl/translit/data/uppercase_cyrillic.c diff -u pecl/translit/data/uppercase_cyrillic.c:1.3 pecl/translit/data/uppercase_cyrillic.c:1.4 --- pecl/translit/data/uppercase_cyrillic.c:1.3 Tue Nov 9 05:14:31 2004 +++ pecl/translit/data/uppercase_cyrillic.c Thu Nov 11 11:28:20 2004 @@ -85,10 +85,6 @@ uppercase_cyrillic_jump_map_4, uppercase_cyrillic_jump_map_5, }; -static unsigned short *uppercase_cyrillic_map_table[0] = { -}; -static us0 *uppercase_cyrillic_expand_table[0] = { -}; static unsigned short *uppercase_cyrillic_transpose_table[2] = { uppercase_cyrillic_transpose_map_4, uppercase_cyrillic_transpose_map_5, http://cvs.php.net/diff.php/pecl/translit/data/uppercase_greek.c?r1=1.3&r2=1.4&ty=u Index: pecl/translit/data/uppercase_greek.c diff -u pecl/translit/data/uppercase_greek.c:1.3 pecl/translit/data/uppercase_greek.c:1.4 --- pecl/translit/data/uppercase_greek.c:1.3 Tue Nov 9 05:14:31 2004 +++ pecl/translit/data/uppercase_greek.c Thu Nov 11 11:28:21 2004 @@ -68,8 +68,6 @@ static unsigned short *uppercase_greek_map_table[1] = { uppercase_greek_replace_map_3, }; -static us0 *uppercase_greek_expand_table[0] = { -}; static unsigned short *uppercase_greek_transpose_table[1] = { uppercase_greek_transpose_map_3, }; http://cvs.php.net/diff.php/pecl/translit/data/uppercase_latin.c?r1=1.3&r2=1.4&ty=u Index: pecl/translit/data/uppercase_latin.c diff -u pecl/translit/data/uppercase_latin.c:1.3 pecl/translit/data/uppercase_latin.c:1.4 --- pecl/translit/data/uppercase_latin.c:1.3 Tue Nov 9 05:14:31 2004 +++ pecl/translit/data/uppercase_latin.c Thu Nov 11 11:28:21 2004 @@ -163,10 +163,6 @@ uppercase_latin_jump_map_2, uppercase_latin_jump_map_30, }; -static unsigned short *uppercase_latin_map_table[0] = { -}; -static us0 *uppercase_latin_expand_table[0] = { -}; static unsigned short *uppercase_latin_transpose_table[4] = { uppercase_latin_transpose_map_0, uppercase_latin_transpose_map_1,