From: Peng Huang Date: Wed, 14 Apr 2010 03:19:09 +0000 (+0800) Subject: Use cheaders X-Git-Tag: 1.3.10~229 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b3ea7266a0b491dfe727e1ebfa3cedc70da30276;p=platform%2Fupstream%2Fibus-libpinyin.git Use cheaders --- diff --git a/src/Database.cc b/src/Database.cc index ba18e1b..cd35874 100644 --- a/src/Database.cc +++ b/src/Database.cc @@ -1,10 +1,10 @@ /* vim:set et sts=4: */ -#include +#include +#include +#include +#include #include #include -#include -#include -#include #include "Database.h" #include "Util.h" diff --git a/src/Engine.cc b/src/Engine.cc index f7e8851..5c16028 100644 --- a/src/Engine.cc +++ b/src/Engine.cc @@ -1,7 +1,7 @@ /* vim:set et sts=4: */ +#include #include -#include #include "Engine.h" #include "PinyinEngine.h" diff --git a/src/Phrase.h b/src/Phrase.h index 02f091f..1f1f067 100644 --- a/src/Phrase.h +++ b/src/Phrase.h @@ -2,7 +2,6 @@ #ifndef __PY_PHRASE_H_ #define __PY_PHRASE_H_ -#include #include "Types.h" namespace PY { diff --git a/src/PinyinEngine.cc b/src/PinyinEngine.cc index 27b2f8d..dd6d562 100644 --- a/src/PinyinEngine.cc +++ b/src/PinyinEngine.cc @@ -1,8 +1,7 @@ /* vim:set et sts=4: */ -#include -#include #include +#include #include "RawEditor.h" #include "ExtEditor.h" #include "FullPinyinEditor.h" diff --git a/src/PinyinParser.cc b/src/PinyinParser.cc index a28cb32..8d269c0 100644 --- a/src/PinyinParser.cc +++ b/src/PinyinParser.cc @@ -1,6 +1,6 @@ /* vim:set et sts=4: */ -#include -#include +#include +#include #include #include "PinyinParser.h" @@ -31,7 +31,7 @@ py_cmp (const void *p1, const void *p2) const gchar *str = (const gchar *) p1; const Pinyin *py = (const Pinyin *) p2; - return strcmp (str, py->text); + return std::strcmp (str, py->text); } static const Pinyin * @@ -50,9 +50,9 @@ is_pinyin (const gchar *p, return NULL; if (G_LIKELY (len > 0)) { - strncpy (buf, p, len); + std::strncpy (buf, p, len); buf[len] = 0; - result = (const Pinyin *) bsearch (buf, pinyin_table, G_N_ELEMENTS (pinyin_table), + result = (const Pinyin *) std::bsearch (buf, pinyin_table, G_N_ELEMENTS (pinyin_table), sizeof (Pinyin), py_cmp); if (check_flags (result, option)) return result; @@ -61,11 +61,11 @@ is_pinyin (const gchar *p, /* len < 0 */ len = MIN (6, end - p); - strncpy (buf, p, len); + std::strncpy (buf, p, len); for (; len > 0; len --) { buf[len] = 0; - result = (const Pinyin *) bsearch (buf, pinyin_table, G_N_ELEMENTS (pinyin_table), + result = (const Pinyin *) std::bsearch (buf, pinyin_table, G_N_ELEMENTS (pinyin_table), sizeof (Pinyin), py_cmp); if (G_UNLIKELY (check_flags (result, option))) { return result; @@ -95,7 +95,7 @@ need_resplit(const Pinyin *p1, { const Pinyin * pys[] = {p1, p2}; - return (const Pinyin **) bsearch (pys, special_table, G_N_ELEMENTS (special_table), + return (const Pinyin **) std::bsearch (pys, special_table, G_N_ELEMENTS (special_table), sizeof (special_table[0]), sp_cmp); } diff --git a/src/SimpTradConverter.cc b/src/SimpTradConverter.cc index c470afd..0bbb1e8 100644 --- a/src/SimpTradConverter.cc +++ b/src/SimpTradConverter.cc @@ -1,5 +1,5 @@ -#include -#include +#include +#include #include #include #include "SimpTradConverter.h" @@ -12,7 +12,7 @@ static int _cmp (const void *p1, const void *p2) const wchar_t *s1 = (const wchar_t *) p1; const wchar_t **s2 = (const wchar_t **) p2; - return wcscmp (s1, s2[0]); + return std::wcscmp (s1, s2[0]); } void @@ -37,9 +37,9 @@ SimpTradConverter::simpToTrad (const gchar *in, String &out) } for (; i > 0; i--) { buf[i] = 0; - result = (const gunichar **) bsearch (buf, simp_to_trad, - G_N_ELEMENTS (simp_to_trad), sizeof (simp_to_trad[0]), - _cmp); + result = (const gunichar **) std::bsearch (buf, simp_to_trad, + G_N_ELEMENTS (simp_to_trad), sizeof (simp_to_trad[0]), + _cmp); if (G_UNLIKELY (result != NULL)) break; }