clear some build warnings

This commit is contained in:
Ilia Maslakov 2009-04-20 07:30:32 +00:00
parent 9d855b3253
commit 7494db39ed
6 changed files with 17 additions and 19 deletions

View File

@ -1072,7 +1072,7 @@ void edit_insert_ahead (WEdit * edit, int c)
int edit_delete (WEdit * edit) int edit_delete (WEdit * edit)
{ {
int p; int p = 0;
int cw = 1; int cw = 1;
if (!edit->curs2) if (!edit->curs2)
@ -1120,7 +1120,7 @@ int edit_delete (WEdit * edit)
static int static int
edit_backspace (WEdit * edit) edit_backspace (WEdit * edit)
{ {
int p; int p = 0;
int cw = 1; int cw = 1;
if (!edit->curs1) if (!edit->curs1)
@ -1274,7 +1274,7 @@ edit_move_backward_lots (WEdit *edit, long increment)
void edit_cursor_move (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 */ /* 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 curs1 = edit->curs1;
long curs2 = edit->curs2; long curs2 = edit->curs2;
int cw = 1; int cw = 1;

View File

@ -153,6 +153,7 @@ long edit_eol (WEdit * edit, long current);
void edit_update_curs_row (WEdit * edit); void edit_update_curs_row (WEdit * edit);
void edit_update_curs_col (WEdit * edit); void edit_update_curs_col (WEdit * edit);
void edit_find_bracket (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_copy_cmd (WEdit * edit);
void edit_block_move_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_replace_cmd (WEdit * edit, int again);
void edit_search_cmd (WEdit * edit, int again); void edit_search_cmd (WEdit * edit, int again);
void edit_complete_word_cmd (WEdit * edit); 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 (WEdit * edit, const char *filename, long start, long finish);
int edit_save_block_cmd (WEdit * edit); int edit_save_block_cmd (WEdit * edit);
int edit_insert_file_cmd (WEdit * edit); int edit_insert_file_cmd (WEdit * edit);

View File

@ -130,7 +130,7 @@ free_codepages_list (void)
#define OTHER_8BIT "Other_8_bit" #define OTHER_8BIT "Other_8_bit"
const char * const char *
get_codepage_id (int n) get_codepage_id (const int n)
{ {
return (n < 0) ? OTHER_8BIT : codepages[n].id; 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 buf_ch[6 + 1];
unsigned char ch = '.'; unsigned char ch = '.';
char *cp_to = NULL;
GIConv conv; 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 ); conv = str_crt_conv_to ( cp_to );
if (conv != INVALID_CONV) { 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 buf_ch[6 + 1];
unsigned char ch = '.'; unsigned char ch = '.';
char *cp_from = NULL;
GIConv conv; GIConv conv;
GString *translated_data;
int res = 0; int res = 0;
res = g_unichar_to_utf8 (input_char, str); 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'; str[6] = '\0';
cp_from = get_codepage_id ( source_codepage ); const char *cp_from = get_codepage_id ( source_codepage );
conv = str_crt_conv_from (cp_from); conv = str_crt_conv_from ( cp_from );
if (conv != INVALID_CONV) { if (conv != INVALID_CONV) {
switch (str_translate_char (conv, str, -1, buf_ch, sizeof(buf_ch))) { 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]; ch = buf_ch[0];
break; break;
case 1: case 1:
ch = '.';
break;
case 2: case 2:
ch = '.'; ch = '.';
break;
} }
str_close_conv (conv); str_close_conv (conv);
} }
return ch; return ch;
} }
int int
@ -371,14 +366,12 @@ convert_from_8bit_to_utf_c (const char input_char)
unsigned char buf_ch[6 + 1]; unsigned char buf_ch[6 + 1];
int ch = '.'; int ch = '.';
int res = 0; int res = 0;
char *cp_from = NULL;
GIConv conv; GIConv conv;
GString *translated_data;
str[0] = (unsigned char) input_char; str[0] = (unsigned char) input_char;
str[1] = '\0'; 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); conv = str_crt_conv_from (cp_from);
if (conv != INVALID_CONV) { if (conv != INVALID_CONV) {

View File

@ -18,7 +18,7 @@ struct codepage_desc {
extern struct codepage_desc *codepages; 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 get_codepage_index (const char *id);
int load_codepages_list (void); int load_codepages_list (void);
void free_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); 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 */ /* Convert single characters */
static inline int static inline int
convert_to_display_c (int c) convert_to_display_c (int c)

View File

@ -274,7 +274,7 @@ str_insert_replace_char (GString * buffer)
} }
int 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) char *output, size_t out_size)
{ {
size_t left; size_t left;

View File

@ -194,7 +194,7 @@ void str_uninit_strings ();
* return 0 if conversion was successfully, ESTR_PROBLEM if ch contains only * return 0 if conversion was successfully, ESTR_PROBLEM if ch contains only
* part of characters, ESTR_FAILURE if conversion is not possible * 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); char *output, size_t out_size);
/* test, if text is valid in terminal encoding /* test, if text is valid in terminal encoding