diff options
| author | Peng Wu <alexepico@gmail.com> | 2024-07-31 11:18:42 +0800 |
|---|---|---|
| committer | Peng Wu <alexepico@gmail.com> | 2024-07-31 11:18:42 +0800 |
| commit | b56d3375921238ac990b5251b220f292e6dfdd61 (patch) | |
| tree | a324d09e3405303b45d6c586d73a873330af527e /src | |
| parent | 23c1d14b771289deb6b19b6ce1a9788d6666a288 (diff) | |
| download | libpinyin-b56d3375921238ac990b5251b220f292e6dfdd61.tar.gz libpinyin-b56d3375921238ac990b5251b220f292e6dfdd61.tar.xz libpinyin-b56d3375921238ac990b5251b220f292e6dfdd61.zip | |
Fix warnings
Diffstat (limited to 'src')
| -rw-r--r-- | src/lookup/phonetic_lookup_heap.h | 2 | ||||
| -rw-r--r-- | src/pinyin.cpp | 8 | ||||
| -rw-r--r-- | src/storage/phrase_large_table2.cpp | 2 | ||||
| -rw-r--r-- | src/storage/pinyin_phrase3.h | 8 |
4 files changed, 10 insertions, 10 deletions
diff --git a/src/lookup/phonetic_lookup_heap.h b/src/lookup/phonetic_lookup_heap.h index 310f2b4..299dded 100644 --- a/src/lookup/phonetic_lookup_heap.h +++ b/src/lookup/phonetic_lookup_heap.h @@ -92,7 +92,7 @@ private: trellis_value_t m_element; public: - trellis_node <1> () : m_element(-FLT_MAX) {} + trellis_node () : m_element(-FLT_MAX) {} public: gint32 length() { return 1; } diff --git a/src/pinyin.cpp b/src/pinyin.cpp index d2f9090..b5a0466 100644 --- a/src/pinyin.cpp +++ b/src/pinyin.cpp @@ -823,26 +823,26 @@ bool pinyin_bigram_iterator_has_next_phrase(bigram_export_iterator_t * iter){ g_free(first_phrase); ChewingKey keys[MAX_PHRASE_LENGTH]; - for (int i = 0; i < first_num; ++i) { + for (size_t i = 0; i < first_num; ++i) { gchar * first_pinyin = NULL; guint32 freq = 0; first_item.get_nth_pronunciation(i, keys, freq); GPtrArray * pinyins = g_ptr_array_new(); - for (int k = 0; k < first_len; ++k) { + for (size_t k = 0; k < first_len; ++k) { g_ptr_array_add(pinyins, keys[k].get_pinyin_string()); } gchar ** strs = (gchar **)g_ptr_array_free(pinyins, FALSE); first_pinyin = g_strjoinv("'", strs); g_strfreev(strs); - for (int j = 0; j < second_num; ++j) { + for (size_t j = 0; j < second_num; ++j) { gchar * second_pinyin = NULL; guint32 freq = 0; second_item.get_nth_pronunciation(j, keys, freq); GPtrArray * pinyins = g_ptr_array_new(); - for (int k = 0; k < second_len; ++k) { + for (size_t k = 0; k < second_len; ++k) { g_ptr_array_add(pinyins, keys[k].get_pinyin_string()); } gchar ** strs = (gchar **)g_ptr_array_free(pinyins, FALSE); diff --git a/src/storage/phrase_large_table2.cpp b/src/storage/phrase_large_table2.cpp index 28eb313..202a69a 100644 --- a/src/storage/phrase_large_table2.cpp +++ b/src/storage/phrase_large_table2.cpp @@ -61,7 +61,7 @@ struct PhraseIndexItem2{ phrase_token_t m_token; ucs4_t m_phrase[phrase_length]; public: - PhraseIndexItem2<phrase_length>(const ucs4_t phrase[], phrase_token_t token){ + PhraseIndexItem2(const ucs4_t phrase[], phrase_token_t token){ memmove(m_phrase, phrase, sizeof(ucs4_t) * phrase_length); m_token = token; } diff --git a/src/storage/pinyin_phrase3.h b/src/storage/pinyin_phrase3.h index d23c657..e252b50 100644 --- a/src/storage/pinyin_phrase3.h +++ b/src/storage/pinyin_phrase3.h @@ -183,13 +183,13 @@ struct PinyinIndexItem2{ ChewingKey m_keys[phrase_length]; public: - PinyinIndexItem2<phrase_length> () { - memset(m_keys, 0, sizeof(ChewingKey) * phrase_length); + PinyinIndexItem2 () { + /* memset(m_keys, 0, sizeof(ChewingKey) * phrase_length); */ m_token = null_token; } - PinyinIndexItem2<phrase_length> (const ChewingKey * keys, - phrase_token_t token) { + PinyinIndexItem2 (const ChewingKey * keys, + phrase_token_t token) { memmove(m_keys, keys, sizeof(ChewingKey) * phrase_length); m_token = token; } |
