From 7494db39ed4791d1c62189836ebedeb93b848f74 Mon Sep 17 00:00:00 2001 From: Ilia Maslakov Date: Mon, 20 Apr 2009 07:30:32 +0000 Subject: [PATCH] clear some build warnings --- edit/edit.c | 6 +++--- edit/edit.h | 2 ++ src/charsets.c | 19 ++++++------------- src/charsets.h | 5 ++++- src/strutil.c | 2 +- src/strutil.h | 2 +- 6 files changed, 17 insertions(+), 19 deletions(-) diff --git a/edit/edit.c b/edit/edit.c index 2e2a42443..f581d8f7e 100644 --- a/edit/edit.c +++ b/edit/edit.c @@ -1072,7 +1072,7 @@ void edit_insert_ahead (WEdit * edit, int c) int edit_delete (WEdit * edit) { - int p; + int p = 0; int cw = 1; if (!edit->curs2) @@ -1120,7 +1120,7 @@ int edit_delete (WEdit * edit) static int edit_backspace (WEdit * edit) { - int p; + int p = 0; int cw = 1; if (!edit->curs1) @@ -1274,7 +1274,7 @@ edit_move_backward_lots (WEdit *edit, long increment) void edit_cursor_move (WEdit * edit, long increment) { /* this is the same as a combination of two of the above routines, with only one push onto the undo stack */ - int c; + int c = 0; long curs1 = edit->curs1; long curs2 = edit->curs2; int cw = 1; diff --git a/edit/edit.h b/edit/edit.h index 9bb14d3bd..12b429cd0 100644 --- a/edit/edit.h +++ b/edit/edit.h @@ -153,6 +153,7 @@ long edit_eol (WEdit * edit, long current); void edit_update_curs_row (WEdit * edit); void edit_update_curs_col (WEdit * edit); void edit_find_bracket (WEdit * edit); +int edit_reload_line (WEdit *edit, const char *filename, long line); void edit_block_copy_cmd (WEdit * edit); void edit_block_move_cmd (WEdit * edit); @@ -183,6 +184,7 @@ void edit_push_markers (WEdit * edit); void edit_replace_cmd (WEdit * edit, int again); void edit_search_cmd (WEdit * edit, int again); void edit_complete_word_cmd (WEdit * edit); +void edit_get_match_keyword_cmd (WEdit *edit); int edit_save_block (WEdit * edit, const char *filename, long start, long finish); int edit_save_block_cmd (WEdit * edit); int edit_insert_file_cmd (WEdit * edit); diff --git a/src/charsets.c b/src/charsets.c index 5da8d127b..227fb68b9 100644 --- a/src/charsets.c +++ b/src/charsets.c @@ -130,7 +130,7 @@ free_codepages_list (void) #define OTHER_8BIT "Other_8_bit" const char * -get_codepage_id (int n) +get_codepage_id (const int n) { return (n < 0) ? OTHER_8BIT : codepages[n].id; } @@ -303,10 +303,9 @@ convert_from_utf_to_current (const char *str) unsigned char buf_ch[6 + 1]; unsigned char ch = '.'; - char *cp_to = NULL; GIConv conv; - cp_to = get_codepage_id ( source_codepage ); + const char *cp_to = get_codepage_id ( source_codepage ); conv = str_crt_conv_to ( cp_to ); if (conv != INVALID_CONV) { @@ -333,9 +332,7 @@ convert_from_utf_to_current_c (const int input_char) unsigned char buf_ch[6 + 1]; unsigned char ch = '.'; - char *cp_from = NULL; GIConv conv; - GString *translated_data; int res = 0; res = g_unichar_to_utf8 (input_char, str); @@ -344,8 +341,8 @@ convert_from_utf_to_current_c (const int input_char) } str[6] = '\0'; - cp_from = get_codepage_id ( source_codepage ); - conv = str_crt_conv_from (cp_from); + const char *cp_from = get_codepage_id ( source_codepage ); + conv = str_crt_conv_from ( cp_from ); if (conv != INVALID_CONV) { switch (str_translate_char (conv, str, -1, buf_ch, sizeof(buf_ch))) { @@ -353,15 +350,13 @@ convert_from_utf_to_current_c (const int input_char) ch = buf_ch[0]; break; case 1: - ch = '.'; - break; case 2: ch = '.'; + break; } str_close_conv (conv); } return ch; - } int @@ -371,14 +366,12 @@ convert_from_8bit_to_utf_c (const char input_char) unsigned char buf_ch[6 + 1]; int ch = '.'; int res = 0; - char *cp_from = NULL; GIConv conv; - GString *translated_data; str[0] = (unsigned char) input_char; str[1] = '\0'; - cp_from = get_codepage_id ( source_codepage ); + const char *cp_from = get_codepage_id ( source_codepage ); conv = str_crt_conv_from (cp_from); if (conv != INVALID_CONV) { diff --git a/src/charsets.h b/src/charsets.h index 04f0c0793..07650c573 100644 --- a/src/charsets.h +++ b/src/charsets.h @@ -18,7 +18,7 @@ struct codepage_desc { extern struct codepage_desc *codepages; -const char *get_codepage_id (int n); +const char *get_codepage_id (const int n); int get_codepage_index (const char *id); int load_codepages_list (void); void free_codepages_list (void); @@ -45,6 +45,9 @@ unsigned char convert_from_utf_to_current_c (const int input_char); */ int convert_from_8bit_to_utf_c (const char input_char); +GString *str_convert_from_input (char *str); +GString *str_convert_to_display (char *str); + /* Convert single characters */ static inline int convert_to_display_c (int c) diff --git a/src/strutil.c b/src/strutil.c index de29ca09a..d5ca6f95d 100644 --- a/src/strutil.c +++ b/src/strutil.c @@ -274,7 +274,7 @@ str_insert_replace_char (GString * buffer) } int -str_translate_char (GIConv conv, char *keys, size_t ch_size, +str_translate_char (GIConv conv, const char *keys, size_t ch_size, char *output, size_t out_size) { size_t left; diff --git a/src/strutil.h b/src/strutil.h index e76518546..a327ae65b 100644 --- a/src/strutil.h +++ b/src/strutil.h @@ -194,7 +194,7 @@ void str_uninit_strings (); * return 0 if conversion was successfully, ESTR_PROBLEM if ch contains only * part of characters, ESTR_FAILURE if conversion is not possible */ -int str_translate_char (GIConv conv, char *ch, size_t ch_size, +int str_translate_char (GIConv conv, const char *ch, size_t ch_size, char *output, size_t out_size); /* test, if text is valid in terminal encoding