summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeng Wu <alexepico@gmail.com>2010-09-14 16:20:18 +0800
committerPeng Wu <alexepico@gmail.com>2010-09-14 16:20:18 +0800
commit0713adcf7919b32eb5af0b3a81c3384f209c84e2 (patch)
treee2de8cc5cf546ae2fc8bd5ca4d90907a60d7e896
parent32b04bf652dca5d8e4d9980a9066d6ada19c868c (diff)
downloadlibpinyin-0713adcf7919b32eb5af0b3a81c3384f209c84e2.tar.gz
libpinyin-0713adcf7919b32eb5af0b3a81c3384f209c84e2.tar.xz
libpinyin-0713adcf7919b32eb5af0b3a81c3384f209c84e2.zip
fixes compile warnings
-rw-r--r--src/storage/phrase_index.cpp2
-rw-r--r--src/storage/phrase_large_table.cpp2
-rw-r--r--src/storage/pinyin_large_table.cpp8
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<phrase_length>::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<phrase_length>::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) )