summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeng Wu <alexepico@gmail.com>2016-07-01 14:39:28 +0800
committerPeng Wu <alexepico@gmail.com>2016-07-01 14:39:28 +0800
commit63cca4dd16a7d2156689e28f4027d069ab5ea33b (patch)
tree2df66c810fe6e2656731d68a8b621407eb682965
parent2dda741858ffdcc6d10b0fa1256beccd7bf06b85 (diff)
downloadlibpinyin-63cca4dd16a7d2156689e28f4027d069ab5ea33b.tar.gz
libpinyin-63cca4dd16a7d2156689e28f4027d069ab5ea33b.tar.xz
libpinyin-63cca4dd16a7d2156689e28f4027d069ab5ea33b.zip
fixes warnings
-rw-r--r--src/storage/phrase_index.cpp11
-rw-r--r--src/storage/phrase_index_logger.h1
2 files changed, 8 insertions, 4 deletions
diff --git a/src/storage/phrase_index.cpp b/src/storage/phrase_index.cpp
index 4b03285..217bf4f 100644
--- a/src/storage/phrase_index.cpp
+++ b/src/storage/phrase_index.cpp
@@ -337,7 +337,7 @@ bool SubPhraseIndex::load(MemoryChunk * chunk,
char * buf_begin = (char *)chunk->begin();
chunk->get_content(offset, &m_total_freq, sizeof(guint32));
offset += sizeof(guint32);
- table_offset_t index_one, index_two, index_three;
+ table_offset_t index_one = 0, index_two = 0, index_three = 0;
chunk->get_content(offset, &index_one, sizeof(table_offset_t));
offset += sizeof(table_offset_t);
chunk->get_content(offset, &index_two, sizeof(table_offset_t));
@@ -430,7 +430,8 @@ bool SubPhraseIndex::diff(SubPhraseIndex * oldone, PhraseIndexLogger * logger){
}
bool SubPhraseIndex::merge(PhraseIndexLogger * logger){
- LOG_TYPE log_type; phrase_token_t token;
+ LOG_TYPE log_type = LOG_INVALID_RECORD;
+ phrase_token_t token = null_token;
MemoryChunk oldchunk, newchunk;
PhraseItem olditem, newitem, item, * tmpitem;
@@ -739,7 +740,8 @@ bool _compute_new_header(PhraseIndexLogger * logger,
phrase_token_t value,
guint32 & new_total_freq) {
- LOG_TYPE log_type; phrase_token_t token;
+ LOG_TYPE log_type = LOG_INVALID_RECORD;
+ phrase_token_t token = null_token;
MemoryChunk oldchunk, newchunk;
PhraseItem olditem, newitem;
@@ -804,7 +806,8 @@ static bool _mask_out_records(PhraseIndexLogger * oldlogger,
phrase_token_t mask,
phrase_token_t value,
PhraseIndexLogger * newlogger) {
- LOG_TYPE log_type; phrase_token_t token;
+ LOG_TYPE log_type = LOG_INVALID_RECORD;
+ phrase_token_t token = null_token;
MemoryChunk oldchunk, newchunk;
while(oldlogger->has_next_record()) {
diff --git a/src/storage/phrase_index_logger.h b/src/storage/phrase_index_logger.h
index 06f933e..ae00009 100644
--- a/src/storage/phrase_index_logger.h
+++ b/src/storage/phrase_index_logger.h
@@ -42,6 +42,7 @@
namespace pinyin{
enum LOG_TYPE{
+ LOG_INVALID_RECORD = 0,
LOG_ADD_RECORD = 1,
LOG_REMOVE_RECORD,
LOG_MODIFY_RECORD,