From 0713adcf7919b32eb5af0b3a81c3384f209c84e2 Mon Sep 17 00:00:00 2001 From: Peng Wu Date: Tue, 14 Sep 2010 16:20:18 +0800 Subject: [PATCH] fixes compile warnings --- src/storage/phrase_index.cpp | 2 +- src/storage/phrase_large_table.cpp | 2 +- src/storage/pinyin_large_table.cpp | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/storage/phrase_index.cpp b/src/storage/phrase_index.cpp index b4ffa7f..8bd65f6 100644 --- a/src/storage/phrase_index.cpp +++ b/src/storage/phrase_index.cpp @@ -283,7 +283,7 @@ bool FacadePhraseIndex::load_text(guint8 phrase_index, FILE * infile){ while ( !feof(infile)){ fscanf(infile, "%s", pinyin); fscanf(infile, "%s", phrase); - fscanf(infile, "%ld", &token); + fscanf(infile, "%u", &token); fscanf(infile, "%ld", &freq); if ( feof(infile) ) break; diff --git a/src/storage/phrase_large_table.cpp b/src/storage/phrase_large_table.cpp index 53db455..7a7dfd0 100644 --- a/src/storage/phrase_large_table.cpp +++ b/src/storage/phrase_large_table.cpp @@ -321,7 +321,7 @@ bool PhraseLargeTable::load_text(FILE * infile){ while ( !feof(infile) ) { fscanf(infile, "%s", pinyin); fscanf(infile, "%s", phrase); - fscanf(infile, "%ld", &token); + fscanf(infile, "%u", &token); fscanf(infile, "%ld", &freq); if ( feof(infile) ) diff --git a/src/storage/pinyin_large_table.cpp b/src/storage/pinyin_large_table.cpp index 97f1f19..d24533c 100644 --- a/src/storage/pinyin_large_table.cpp +++ b/src/storage/pinyin_large_table.cpp @@ -206,7 +206,7 @@ PinyinLengthIndexLevel::~PinyinLengthIndexLevel(){ delete array; \ break; \ } - for ( int i = 0 ; i < m_pinyin_array_indexes->len; ++i){ + for ( size_t i = 0 ; i < m_pinyin_array_indexes->len; ++i){ switch (i){ CASE(0); CASE(1); @@ -312,7 +312,7 @@ int PinyinArrayIndexLevel::convert(PinyinCustomSettings * custom, result |= SEARCH_OK; - if ( cursor.m_range_begin == -1 ){ + if ( cursor.m_range_begin == (phrase_token_t) -1 ){ cursor.m_range_begin = token; cursor.m_range_end = token + 1; cursor_head = head; @@ -326,7 +326,7 @@ int PinyinArrayIndexLevel::convert(PinyinCustomSettings * custom, cursor_head = head; } } - if ( cursor.m_range_begin == -1 ) + if ( cursor.m_range_begin == (phrase_token_t) -1 ) return result; g_array_append_val(cursor_head, cursor); @@ -486,7 +486,7 @@ bool PinyinLargeTable::load_text(FILE * infile){ while ( !feof(infile) ) { fscanf(infile, "%s", pinyin); fscanf(infile, "%s", phrase); - fscanf(infile, "%ld", &token); + fscanf(infile, "%u", &token); fscanf(infile, "%ld", &freq); if ( feof(infile) ) -- 2.7.4