summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/pinyin.cpp5
-rw-r--r--src/storage/phrase_index_logger.h3
2 files changed, 3 insertions, 5 deletions
diff --git a/src/pinyin.cpp b/src/pinyin.cpp
index 9ecbf6a..01dcb41 100644
--- a/src/pinyin.cpp
+++ b/src/pinyin.cpp
@@ -2463,7 +2463,6 @@ static bool _get_char_offset_recur(pinyin_instance_t * instance,
pinyin_context_t * context = instance->m_context;
PhoneticKeyMatrix & matrix = instance->m_matrix;
FacadePhraseIndex * phrase_index = context->m_phrase_index;
- const glong phrase_length = cached_tokens->len;
size_t length = *plength;
if (start > offset)
@@ -2520,8 +2519,6 @@ bool pinyin_get_character_offset(pinyin_instance_t * instance,
size_t * plength) {
pinyin_context_t * context = instance->m_context;
PhoneticKeyMatrix & matrix = instance->m_matrix;
- FacadePhraseIndex * phrase_index = context->m_phrase_index;
- FacadePhraseTable3 * phrase_table = context->m_phrase_table;
assert(offset < matrix.size());
_check_offset(matrix, offset);
@@ -2977,8 +2974,6 @@ bool pinyin_remember_user_input(pinyin_instance_t * instance,
const char * phrase,
gint count) {
pinyin_context_t * context = instance->m_context;
- FacadePhraseIndex * phrase_index = context->m_phrase_index;
- FacadePhraseTable3 * phrase_table = context->m_phrase_table;
if (NULL == phrase)
return false;
diff --git a/src/storage/phrase_index_logger.h b/src/storage/phrase_index_logger.h
index ae00009..a86ef50 100644
--- a/src/storage/phrase_index_logger.h
+++ b/src/storage/phrase_index_logger.h
@@ -158,6 +158,9 @@ public:
*/
bool next_record(LOG_TYPE & log_type, phrase_token_t & token,
MemoryChunk * oldone, MemoryChunk * newone){
+ log_type = LOG_INVALID_RECORD;
+ token = null_token;
+
size_t offset = m_offset;
m_chunk->get_content(offset, &log_type, sizeof(LOG_TYPE));
offset += sizeof(LOG_TYPE);