1
1

Code cleanup for avoid compiler warnings

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
Этот коммит содержится в:
Slava Zanko 2010-10-21 10:34:27 +03:00
родитель 3934c6fb8e
Коммит a0d69353e8
2 изменённых файлов: 11 добавлений и 12 удалений

Просмотреть файл

@ -114,9 +114,6 @@ load_codepages_list_from_file (GPtrArray **list, const char *fname)
}
else
{
guint i;
codepage_desc *desc;
/* whether id is already present in list */
/* if yes, overwrite description */
for (i = 0; i < (*list)->len; i++)
@ -154,7 +151,6 @@ load_codepages_list_from_file (GPtrArray **list, const char *fname)
void
load_codepages_list (void)
{
int result = -1;
char *fname;
/* 1: try load /usr/share/mc/mc.charsets */
@ -195,7 +191,7 @@ get_codepage_id (const int n)
int
get_codepage_index (const char *id)
{
int i;
size_t i;
if (strcmp (id, OTHER_8BIT) == 0)
return -1;
if (codepages == NULL)

Просмотреть файл

@ -60,7 +60,8 @@ get_hotkey (int n)
int
select_charset (int center_y, int center_x, int current_charset, gboolean seldisplay)
{
int i;
size_t i;
int listbox_result;
char buffer[255];
/* Create listbox */
@ -88,24 +89,26 @@ select_charset (int center_y, int center_x, int current_charset, gboolean seldis
/* Select the default entry */
i = (seldisplay)
? ((current_charset < 0) ? codepages->len : current_charset)
: (current_charset + 1);
? ((current_charset < 0) ? codepages->len : (size_t) current_charset)
: ((size_t)current_charset + 1);
listbox_select_entry (listbox->list, i);
i = run_listbox (listbox);
listbox_result = run_listbox (listbox);
if (i < 0) {
if (listbox_result < 0) {
/* Cancel dialog */
return SELECT_CHARSET_CANCEL;
} else {
/* some charset has been selected */
if (seldisplay) {
/* charset list is finished with "Other 8 bit" item */
return ((guint) i >= codepages->len) ? SELECT_CHARSET_OTHER_8BIT : i;
return (listbox_result >= (int) codepages->len)
? SELECT_CHARSET_OTHER_8BIT
: listbox_result;
} else {
/* charset list is began with "- < No translation >" item */
return (i - 1);
return (listbox_result - 1);
}
}
}