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 <unistd.h>
#include <dirent.h>
#include <errno.h>
+#include <stdint.h>
#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; i<len_word; i+=2){
- if(!iseuckanji(&new_key[i])) {
+ if(!iseuckanji((guchar *) &new_key[i])) {
new_key[i] = '\0';
break;
}
@@ -1988,7 +1991,7 @@
gchar *ebook_get_heading(BOOK_INFO *binfo, int page, int offset)
{
EB_Error_Code error_code;
- int len;
+ ssize_t len;
char heading[MAXLEN_HEADING + 1];
EB_Position position;
gchar *p;
@@ -2021,7 +2024,7 @@
gchar *ebook_get_text(BOOK_INFO *binfo, int page, int offset){
EB_Error_Code error_code;
- int len;
+ ssize_t len;
char text[MAXLEN_TEXT + 1];
EB_Position position;
gchar *p;
@@ -2064,7 +2067,7 @@
gchar *ebook_get_candidate(BOOK_INFO *binfo, int page, int offset)
{
EB_Error_Code error_code;
- int len;
+ ssize_t len;
char text[MAXLEN_TEXT + 1];
EB_Position position;
gchar *p;
@@ -2374,7 +2377,7 @@
image_data = malloc(image_width * image_height / 8);
ebook_bitmap_to_xbm(bitmap_data, image_width,
- image_height, image_data, &image_size);
+ image_height, (char *) image_data, &image_size);
*width = image_width;
*height = image_height;
@@ -2400,13 +2403,13 @@
xpm[2] = g_strdup_printf(". c %s", color);
for (i = 0; i < gaiji_adjustment; i++) {
- xpm[i+3] = g_new(guchar, width + 1);
+ xpm[i+3] = (gchar *) g_new(guchar, width + 1);
memset(xpm[i+3], ' ', width);
xpm[i+3][width] = '\0';
}
for (;i < height + gaiji_adjustment; i++) {
- xpm[i+3] = g_new(guchar, width + 1);
+ xpm[i+3] = (gchar *) g_new(guchar, width + 1);
xpm_p = xpm[i+3];
for (j = 0; j + 7 < width; j += 8, bitmap_p++) {
*xpm_p++ = (*bitmap_p & 0x80) ? '.' : ' ';
@@ -2627,7 +2630,7 @@
int width;
int height;
char *gif;
- guint *gif_length;
+ size_t *gif_length;
guint fg;
guint bg;
{
@@ -2800,7 +2803,7 @@
ebook_bitmap_to_gif(bitmap_data, image_width,
- image_height, image_data, &image_size, fg, bg);
+ image_height, (char *) image_data, &image_size, fg, bg);
fp = fopen(fname, "wb");
@@ -3022,7 +3025,7 @@
ssize_t read_length;
gint data_size;
gchar *bmp_data;
- gint bmp_length;
+ size_t bmp_length;
#ifdef COLOR_HACK
diff -ru ebview-0.3.6.orig/src/filter.c ebview-0.3.6/src/filter.c
--- ebview-0.3.6.orig/src/filter.c 2004-02-22 06:45:19.000000000 +0100
+++ ebview-0.3.6/src/filter.c 2007-03-02 11:55:40.000000000 +0100
@@ -181,7 +181,7 @@
gint i;
gint r;
gchar *p;
- gint length;
+ size_t length;
GError *error=NULL;
gchar *contents;
gchar tmpout[512];
diff -ru ebview-0.3.6.orig/src/grep.c ebview-0.3.6/src/grep.c
--- ebview-0.3.6.orig/src/grep.c 2004-02-22 04:43:50.000000000 +0100
+++ ebview-0.3.6/src/grep.c 2007-03-02 12:41:47.000000000 +0100
@@ -137,7 +137,7 @@
// Extract 10 characters before/ after keyword
- here = simple_search(rp->word, 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, "<wave>");
break;
case EB_HOOK_END_WAVE:
- sprintf (text, "</wave page=0x%x offset=0x%x size=%d>", argv[2], argv[3], data_size);
+ sprintf (text, "</wave page=0x%x offset=0x%x size=%lu>", 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);
}
}