fixes compile warnings
authorPeng Wu <alexepico@gmail.com>
Tue, 14 Sep 2010 08:20:18 +0000 (16:20 +0800)
committerPeng Wu <alexepico@gmail.com>
Tue, 14 Sep 2010 08:20:18 +0000 (16:20 +0800)
src/storage/phrase_index.cpp
src/storage/phrase_large_table.cpp
src/storage/pinyin_large_table.cpp

index b4ffa7f..8bd65f6 100644 (file)
@@ -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;
index 53db455..7a7dfd0 100644 (file)
@@ -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) )
index 97f1f19..d24533c 100644 (file)
@@ -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) )