summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPeng Wu <alexepico@gmail.com>2016-05-11 16:38:14 +0800
committerPeng Wu <alexepico@gmail.com>2016-05-11 16:38:14 +0800
commit5b487bd6d66f9a8f43260a9bec978ea8cf692995 (patch)
tree49dfb695ee6af317d81aa34f3835cc55a4e6ea0a /src
parent0d1aaf9cb0f4b53114422618cb61510560f4611d (diff)
downloadlibpinyin-5b487bd6d66f9a8f43260a9bec978ea8cf692995.tar.gz
libpinyin-5b487bd6d66f9a8f43260a9bec978ea8cf692995.tar.xz
libpinyin-5b487bd6d66f9a8f43260a9bec978ea8cf692995.zip
fixes compile
Diffstat (limited to 'src')
-rw-r--r--src/storage/phonetic_key_matrix.h15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/storage/phonetic_key_matrix.h b/src/storage/phonetic_key_matrix.h
index 8ad885b..99aeb11 100644
--- a/src/storage/phonetic_key_matrix.h
+++ b/src/storage/phonetic_key_matrix.h
@@ -35,6 +35,17 @@ protected:
GPtrArray * m_table_content;
public:
+ PhoneticTable() {
+ m_table_content = g_ptr_array_new();
+ }
+
+ ~PhoneticTable() {
+ clear_all();
+
+ g_ptr_array_free(m_table_content, TRUE);
+ m_table_content = NULL;
+ }
+
bool clear_all() {
for (size_t i = 0; i < m_table_content->len; ++i) {
GArray * column = (GArray *)
@@ -46,7 +57,7 @@ public:
return true;
}
- bool size() {
+ size_t size() {
return m_table_content->len;
}
@@ -99,7 +110,7 @@ public:
return m_keys.clear_all() && m_key_rests.clear_all();
}
- bool size() {
+ size_t size() {
assert(m_keys.size() == m_key_rests.size());
return m_keys.size();
}