ebview-0.3.6/srcだけに発見: #bmh.h# diff -ru ebview-0.3.6.orig/src/bmh.c ebview-0.3.6/src/bmh.c --- ebview-0.3.6.orig/src/bmh.c 2004-02-22 05:32:47.000000000 +0100 +++ ebview-0.3.6/src/bmh.c 2007-03-01 15:47:29.000000000 +0100 @@ -38,10 +38,10 @@ table = g_new(BMH_TABLE, 1); - table->pat = g_strdup(pat); + table->pat = (guchar *) g_strdup((gchar *) pat); table->u_pat = NULL; table->l_pat = NULL; - table->length = strlen(pat); + table->length = strlen((gchar *) pat); table->ignore_case = ignore_case; // skip[x] will be the length of chars after the occurrence of x in pat. @@ -122,7 +122,7 @@ { gint i, j, k, m; - m = strlen(pat); + m = strlen((gchar *) pat); if( m==0 ) return( text ); for( k=m-1; k < n; k ++) { diff -ru ebview-0.3.6.orig/src/defs.h ebview-0.3.6/src/defs.h --- ebview-0.3.6.orig/src/defs.h 2004-08-06 17:41:23.000000000 +0200 +++ ebview-0.3.6/src/defs.h 2007-03-01 16:10:54.000000000 +0100 @@ -36,6 +36,7 @@ #include #include #include +#include #ifdef __WIN32__ #define ENABLE_NLS 1 diff -ru ebview-0.3.6.orig/src/dictbar.c ebview-0.3.6/src/dictbar.c --- ebview-0.3.6.orig/src/dictbar.c 2004-02-22 06:35:18.000000000 +0100 +++ ebview-0.3.6/src/dictbar.c 2007-03-01 16:39:05.000000000 +0100 @@ -74,7 +74,7 @@ { gboolean active; gboolean button_active; - int i; + intptr_t i; GtkTreeIter parent_iter; GtkTreeIter child_iter; @@ -97,7 +97,7 @@ i = 0; if(gtk_tree_model_iter_children(GTK_TREE_MODEL(dict_store), &child_iter, &parent_iter) == TRUE){ do { - if(i == (int)data) { + if(i == (intptr_t)data) { gtk_tree_store_set(dict_store, &child_iter, DICT_ACTIVE_COLUMN, button_active, -1); @@ -123,7 +123,7 @@ { GtkWidget *toggle; GtkWidget *label; - int idx; + intptr_t idx; char name[64]; char buff[256]; diff -ru ebview-0.3.6.orig/src/eb.c ebview-0.3.6/src/eb.c --- ebview-0.3.6.orig/src/eb.c 2004-02-22 06:33:09.000000000 +0100 +++ ebview-0.3.6/src/eb.c 2007-03-02 12:24:05.000000000 +0100 @@ -674,7 +674,8 @@ EB_Error_Code error_code=EB_SUCCESS; EB_Position text_position; char data[EB_SIZE_PAGE+4]; - int i, length; + int i; + ssize_t length; int start_page; int end_page; @@ -809,8 +810,8 @@ guchar *jisbuf=NULL; guchar *jis_p; - euc_p = inbuf; - jis_p = jisbuf = malloc(strlen(euc_p)*2); + euc_p = (guchar *) inbuf; + jis_p = jisbuf = malloc(strlen((gchar *) euc_p)*2); while(*euc_p != '\0'){ if(( 0x20 <= *euc_p) && (*euc_p <= 0x7e) && (ascii_to_jisx2080_table[*euc_p] != 0x00)){ @@ -845,7 +846,7 @@ } *jis_p = '\0'; - return(jisbuf); + return((gchar *) jisbuf); } static gint ebook_full_search_old(BOOK_INFO *binfo, char *word, gint method, gchar *title) @@ -856,7 +857,8 @@ char data[EB_SIZE_PAGE]; char *jisword; char *word_p; - int i, length; + int i; + ssize_t length; char *p; char heading[MAXLEN_TEXT + 1]; RESULT *rp; @@ -1053,7 +1055,7 @@ char data[EB_SIZE_PAGE]; char *jisword; char *word_p; - int length; + ssize_t length; char *p; char heading[MAXLEN_TEXT + 1]; RESULT *rp; @@ -1086,7 +1088,7 @@ jisword = euc2jis(word); word_p = jisword; - bmh = bmh_prepare(jisword, TRUE); + bmh = bmh_prepare((guchar *) jisword, TRUE); word_len = strlen(jisword); memset(data, 0, word_len); @@ -1119,7 +1121,7 @@ start_p = data; while(start_p){ - start_p = bmh_search(bmh, start_p, EB_SIZE_PAGE + word_len - (start_p - data)); + start_p = (gchar *) bmh_search(bmh, (guchar *) start_p, EB_SIZE_PAGE + word_len - (start_p - data)); if(start_p == NULL) break; @@ -1405,7 +1407,7 @@ gint len; gchar *p; gchar *pp; - guchar body[65536]; + gchar body[65536]; gint i; gunichar ch; @@ -1679,7 +1681,8 @@ gint ebook_simple_search2(BOOK_INFO *binfo, char *word, gint method, gchar *title) { EB_Error_Code error_code=EB_SUCCESS; - int i, len, total_hits=0; + int i, total_hits=0; + ssize_t len; EB_Hit hits[MAX_HITS]; int hitcount; char heading[MAXLEN_HEADING + 1]; @@ -1814,7 +1817,7 @@ // If the keyword is Japanese, try Hiragana and Katakana - if(iseuc(word)){ + if(iseuc((guchar *) word)){ l_word = g_strdup(word); katakana_to_hiragana(l_word); error_code = ebook_simple_search2(binfo, l_word, method, title); @@ -1961,11 +1964,11 @@ // If there is no hit, try using only Kanji part. if((count_result(search_result) == 0) && - (iseuckanji(keywords[0]))){ + (iseuckanji((guchar *) keywords[0]))){ len_word = strlen(keywords[0]); strcpy(new_key, keywords[0]); for(i=0; iword, tmp, strlen(tmp), bignore_case); + here = (gchar *) simple_search((guchar *) rp->word, (guchar *) tmp, strlen(tmp), bignore_case); if(here != NULL){ p = here; for(i=0; i < additional_chars ; i ++){ @@ -215,7 +215,7 @@ // For higher performance, specially handle EUC and SJIS - code = guess_kanji(max_bytes_to_guess, contents); + code = guess_kanji(max_bytes_to_guess, (guchar *) contents); switch(code){ gchar *tmp; diff -ru ebview-0.3.6.orig/src/hook.c ebview-0.3.6/src/hook.c --- ebview-0.3.6.orig/src/hook.c 2004-02-22 05:06:27.000000000 +0100 +++ ebview-0.3.6/src/hook.c 2007-03-02 12:53:20.000000000 +0100 @@ -514,7 +514,7 @@ eb_write_text_string(book, ""); break; case EB_HOOK_END_WAVE: - sprintf (text, "", argv[2], argv[3], data_size); + sprintf (text, "", argv[2], argv[3], (long unsigned int) data_size); eb_write_text_string(book, text); break; } diff -ru ebview-0.3.6.orig/src/jcode.c ebview-0.3.6/src/jcode.c --- ebview-0.3.6.orig/src/jcode.c 2004-02-22 06:25:19.000000000 +0100 +++ ebview-0.3.6/src/jcode.c 2007-03-02 12:56:37.000000000 +0100 @@ -49,11 +49,11 @@ NULL, NULL, NULL, NULL // 13-89 - 92 }; -void replace_char(const guchar *icode, const guchar *ocode, guchar **inbuf, guchar **outbuf, gint *isize, gint *osize){ +void replace_char(const guchar *icode, const guchar *ocode, guchar **inbuf, guchar **outbuf, size_t *isize, size_t *osize){ guchar *in, *out; guchar *str; guchar *utf_str; - gint len; + size_t len; in = *inbuf; out = *outbuf; @@ -139,7 +139,7 @@ } cd = iconv_open( ocode, icode ); - if( (int)cd == -1 ) { + if(cd == (iconv_t) -1 ) { LOG(LOG_DEBUG, "OUT : iconv_convert() OUT3"); return(NULL); } @@ -228,7 +228,7 @@ } cd = iconv_open( ocode, icode ); - if( (int)cd == -1 ) { + if( cd == (iconv_t) -1 ) { return(NULL); } diff -ru ebview-0.3.6.orig/src/multi.c ebview-0.3.6/src/multi.c --- ebview-0.3.6.orig/src/multi.c 2004-02-22 06:55:07.000000000 +0100 +++ ebview-0.3.6/src/multi.c 2007-03-02 13:02:24.000000000 +0100 @@ -283,7 +283,7 @@ button = gtk_button_new_with_label(_("Candidates")); g_signal_connect(G_OBJECT (button), "pressed", G_CALLBACK(candidate_pressed), - (gpointer)i); + (gpointer)(intptr_t)i); gtk_table_attach(GTK_TABLE(entry_table), button, 2, 3, i, i+1, xoption, yoption, 5, 1); @@ -545,7 +545,7 @@ LOG(LOG_DEBUG, "IN : candidate_pressed()"); - global_entry_id = (gint)data; + global_entry_id = (gint)(intptr_t)data; error_code = eb_multi_entry_candidates(global_book_info->book, global_multi_code, global_entry_id, &position); if (error_code == EB_ERR_NO_CANDIDATES) { @@ -568,7 +568,7 @@ EB_Error_Code error_code; GtkTreeIter iter; GtkTreeIter parent; - gchar *dic_title; + gchar *dic_title = ""; gint i; #ifdef MULTI_HACK diff -ru ebview-0.3.6.orig/src/pref_color.c ebview-0.3.6/src/pref_color.c --- ebview-0.3.6.orig/src/pref_color.c 2004-02-15 14:59:42.000000000 +0100 +++ ebview-0.3.6/src/pref_color.c 2007-03-02 13:02:52.000000000 +0100 @@ -89,7 +89,7 @@ LOG(LOG_DEBUG, "IN : show_colorsel()"); - color_no = (gint)data; + color_no = (gint)(intptr_t)data; colorsel_dlg = gtk_color_selection_dialog_new(_("Choose Color")); diff -ru ebview-0.3.6.orig/src/pref_dictgroup.c ebview-0.3.6/src/pref_dictgroup.c --- ebview-0.3.6.orig/src/pref_dictgroup.c 2004-02-15 15:43:02.000000000 +0100 +++ ebview-0.3.6/src/pref_dictgroup.c 2007-03-02 13:03:16.000000000 +0100 @@ -1154,7 +1154,7 @@ LOG(LOG_DEBUG, "IN : show_colorsel()"); - color_no = (gint)data; + color_no = (gint)(intptr_t)data; colorsel_dlg = gtk_color_selection_dialog_new(_("Choose Color")); diff -ru ebview-0.3.6.orig/src/pref_font.c ebview-0.3.6/src/pref_font.c --- ebview-0.3.6.orig/src/pref_font.c 2004-02-22 06:59:03.000000000 +0100 +++ ebview-0.3.6/src/pref_font.c 2007-03-02 13:03:34.000000000 +0100 @@ -79,7 +79,7 @@ LOG(LOG_DEBUG, "IN : show_fontsel()"); - font_no = (gint)data; + font_no = (gint)(intptr_t)data; fontsel_dlg = gtk_font_selection_dialog_new("Please select font"); diff -ru ebview-0.3.6.orig/src/shortcut.c ebview-0.3.6/src/shortcut.c --- ebview-0.3.6.orig/src/shortcut.c 2004-08-06 17:12:12.000000000 +0200 +++ ebview-0.3.6/src/shortcut.c 2007-03-02 13:04:58.000000000 +0100 @@ -40,7 +40,7 @@ LOG(LOG_DEBUG, "IN : accel_handler()"); - event.keyval = user_data; + event.keyval = (intptr_t) user_data; event.state = arg3; ret = perform_shortcut_by_event(&event); @@ -93,7 +93,7 @@ if((state == 0) && (keyval == GDK_Return)) continue; - closure = g_cclosure_new(G_CALLBACK(accel_handler), (gpointer)keyval, NULL); + closure = g_cclosure_new(G_CALLBACK(accel_handler), (gpointer)(intptr_t)keyval, NULL); gtk_accel_group_connect(accel_group, keyval, state, GTK_ACCEL_VISIBLE, closure); diff -ru ebview-0.3.6.orig/src/log.c ebview-0.3.6/src/log.c --- ebview-0.3.6.orig/src/log.c 2007-03-02 16:51:02.000000000 +0100 +++ ebview-0.3.6/src/log.c 2007-03-02 19:01:16.000000000 +0100 @@ -63,16 +63,19 @@ strcat(format, message); - va_start(ap, message); + va_start(ap, format); g_vprintf(format, ap); g_printf("\n"); //g_logv(G_LOG_DOMAIN, level, format, ap); + va_end(ap); } // Show dialog box. if(level <= LOG_MESSAGE){ + va_start(ap, format); vsprintf(str, message, ap); + va_end(ap); switch(level){ case LOG_ERROR: @@ -87,7 +90,6 @@ break; } - va_end(ap); } }