diff options
-rw-r--r-- | tests/storage/test_phrase_index.cpp | 4 | ||||
-rw-r--r-- | tests/storage/test_phrase_table.cpp | 4 | ||||
-rw-r--r-- | tests/storage/test_pinyin_index.cpp | 8 | ||||
-rw-r--r-- | utils/storage/gen_binary_files.cpp | 8 | ||||
-rw-r--r-- | utils/storage/gen_pinyin_table.cpp | 5 |
5 files changed, 15 insertions, 14 deletions
diff --git a/tests/storage/test_phrase_index.cpp b/tests/storage/test_phrase_index.cpp index 12cc398..b48d92c 100644 --- a/tests/storage/test_phrase_index.cpp +++ b/tests/storage/test_phrase_index.cpp @@ -93,7 +93,7 @@ int main(int argc, char * argv[]){ FILE* infile = fopen("../../data/gb_char.table", "r"); if ( NULL == infile ){ - printf("open gb_char.table failed!\n"); + fprintf(stderr, "open gb_char.table failed!\n"); exit(ENOENT); } @@ -102,7 +102,7 @@ int main(int argc, char * argv[]){ infile = fopen("../../data/gbk_char.table", "r"); if ( NULL == infile ){ - printf("open gbk_char.table failed!\n"); + fprintf(stderr, "open gbk_char.table failed!\n"); exit(ENOENT); } diff --git a/tests/storage/test_phrase_table.cpp b/tests/storage/test_phrase_table.cpp index 66ed060..c81b472 100644 --- a/tests/storage/test_phrase_table.cpp +++ b/tests/storage/test_phrase_table.cpp @@ -28,7 +28,7 @@ int main(int argc, char * argv[]){ FILE * gbfile = fopen("../../data/gb_char.table", "r"); if ( gbfile == NULL ) { - printf("open gb_char.table failed!\n"); + fprintf(stderr, "open gb_char.table failed!\n"); return 1; } @@ -37,7 +37,7 @@ int main(int argc, char * argv[]){ FILE * gbkfile = fopen("../../data/gbk_char.table", "r"); if (gbkfile == NULL ) { - printf("open gbk_char.table failed!\n"); + fprintf(stderr, "open gbk_char.table failed!\n"); return 1; } diff --git a/tests/storage/test_pinyin_index.cpp b/tests/storage/test_pinyin_index.cpp index e0e42bf..5b54df6 100644 --- a/tests/storage/test_pinyin_index.cpp +++ b/tests/storage/test_pinyin_index.cpp @@ -30,7 +30,7 @@ int main( int argc, char * argv[]){ FILE * gbfile = fopen("../../data/gb_char.table", "r"); if ( gbfile == NULL ) { - printf("open gb_char.table failed!\n"); + fprintf(stderr, "open gb_char.table failed!\n"); return 1; } @@ -39,7 +39,7 @@ int main( int argc, char * argv[]){ FILE * gbkfile = fopen("../../data/gbk_char.table","r"); if ( gbkfile == NULL ) { - printf("open gb_char.table failed!\n"); + fprintf(stderr, "open gb_char.table failed!\n"); return 1; } @@ -50,7 +50,7 @@ int main( int argc, char * argv[]){ FILE* infile = fopen("../../data/gb_char.table", "r"); if ( NULL == infile ){ - printf("open gb_char.table failed!\n"); + fprintf(stderr, "open gb_char.table failed!\n"); exit(ENOENT); } @@ -59,7 +59,7 @@ int main( int argc, char * argv[]){ infile = fopen("../../data/gbk_char.table", "r"); if ( NULL == infile ){ - printf("open gbk_char.table failed!\n"); + fprintf(stderr, "open gbk_char.table failed!\n"); exit(ENOENT); } diff --git a/utils/storage/gen_binary_files.cpp b/utils/storage/gen_binary_files.cpp index f8d3c70..5d32b58 100644 --- a/utils/storage/gen_binary_files.cpp +++ b/utils/storage/gen_binary_files.cpp @@ -30,7 +30,7 @@ int main(int argc, char * argv[]){ FILE * gbfile = fopen("../../data/gb_char.table", "r"); if ( gbfile == NULL) { - printf("open gb_char.table failed!"); + fprintf(stderr, "open gb_char.table failed!"); return 1; } @@ -42,7 +42,7 @@ int main(int argc, char * argv[]){ FILE * gbkfile = fopen("../../data/gbk_char.table","r"); if ( gbkfile == NULL) { - printf("open gb_char.table failed!"); + fprintf(stderr, "open gb_char.table failed!"); return 1; } @@ -67,7 +67,7 @@ int main(int argc, char * argv[]){ FILE* infile = fopen("../../data/gb_char.table", "r"); if ( NULL == infile ){ - printf("open gb_char.table failed!\n"); + fprintf(stderr, "open gb_char.table failed!\n"); exit(ENOENT); } @@ -76,7 +76,7 @@ int main(int argc, char * argv[]){ infile = fopen("../../data/gbk_char.table", "r"); if ( NULL == infile ){ - printf("open gbk_char.table failed!\n"); + fprintf(stderr, "open gbk_char.table failed!\n"); exit(ENOENT); } diff --git a/utils/storage/gen_pinyin_table.cpp b/utils/storage/gen_pinyin_table.cpp index 1808162..149e492 100644 --- a/utils/storage/gen_pinyin_table.cpp +++ b/utils/storage/gen_pinyin_table.cpp @@ -138,7 +138,8 @@ void feed_line (const char * phrase, const char * pinyin, const guint32 freq){ * where is the code which I don't want to touch. :-) */ if (new_phrase_ptr->length >= MAX_PHRASE_LENGTH ) { - printf("too long phrase:%s\t%s\t%d\n", phrase, pinyin, freq); + fprintf(stderr, "too long phrase:%s\t%s\t%d\n", phrase, + pinyin, freq); free(new_phrase_ptr); return; } @@ -160,7 +161,7 @@ void feed_line (const char * phrase, const char * pinyin, const guint32 freq){ value_item.freq = freq; if(new_phrase_ptr->length != value_item.pinyin->len){ - printf("error:phrase:%s\tpinyin:%s\n", phrase, pinyin); + fprintf(stderr, "error:phrase:%s\tpinyin:%s\n", phrase, pinyin); return; } |