diff options
author | Peng Wu <alexepico@gmail.com> | 2010-09-27 16:00:09 +0800 |
---|---|---|
committer | Peng Wu <alexepico@gmail.com> | 2010-09-27 16:00:09 +0800 |
commit | 55d80b5ff7702b90fbe80ad1a65c2eb0797e1844 (patch) | |
tree | 3e42c6170831de1584a8b3d20fcb0aecf60d3a59 /utils | |
parent | 0091f1c5cc535e0a4cf5bdd564d62544be847962 (diff) | |
download | libpinyin-55d80b5ff7702b90fbe80ad1a65c2eb0797e1844.tar.gz libpinyin-55d80b5ff7702b90fbe80ad1a65c2eb0797e1844.tar.xz libpinyin-55d80b5ff7702b90fbe80ad1a65c2eb0797e1844.zip |
fixes compile warnings
Diffstat (limited to 'utils')
-rw-r--r-- | utils/storage/gen_pinyin_table.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/utils/storage/gen_pinyin_table.cpp b/utils/storage/gen_pinyin_table.cpp index 547ff87..50b2ef2 100644 --- a/utils/storage/gen_pinyin_table.cpp +++ b/utils/storage/gen_pinyin_table.cpp @@ -169,7 +169,7 @@ void feed_line (const char * phrase, const char * pinyin, const guint32 freq){ return; } bool found = false; - for ( int i = 0; i < array->len ; ++i){ + for ( size_t i = 0; i < array->len ; ++i){ pinyin_and_freq_item * old_value_item = &g_array_index(array, pinyin_and_freq_item, i); int result = pinyin_exact_compare((PinyinKey *)value_item.pinyin->data, (PinyinKey *)old_value_item->pinyin->data , value_item.pinyin->len); @@ -233,10 +233,10 @@ void gen_phrase_file(const char * outfilename, int phrase_index){ phrase_token_t token = 1; char pinyin_buffer[4096]; //phrase length - for ( int i = 1; i < MAX_PHRASE_LENGTH + 1; ++i){ + for ( size_t i = 1; i < MAX_PHRASE_LENGTH + 1; ++i){ GArray * item_array = g_item_array[i]; //item array - for( int m = 0; m < item_array->len; ++m){ + for( size_t m = 0; m < item_array->len; ++m){ item* oneitem = & g_array_index(item_array, item, m); phrase_item * phrase = oneitem->phrase; GArray * pinyin_and_freqs = oneitem->pinyin_and_freq_array; @@ -244,7 +244,7 @@ void gen_phrase_file(const char * outfilename, int phrase_index){ phrase->length, NULL, NULL, NULL); //each pinyin - for( int n = 0 ; n < pinyin_and_freqs->len; ++n){ + for( size_t n = 0 ; n < pinyin_and_freqs->len; ++n){ pinyin_and_freq_item * pinyin_and_freq = &g_array_index(pinyin_and_freqs, pinyin_and_freq_item, n); GArray * pinyin = pinyin_and_freq->pinyin; PinyinKey * key = &g_array_index(pinyin, PinyinKey, 0); |