Code cleanup for compile with new CFLAGS value.

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
This commit is contained in:
Slava Zanko 2009-10-27 13:56:49 +02:00
parent 3518f7c585
commit e7c6d59e63
13 changed files with 52 additions and 26 deletions

View File

@ -718,7 +718,7 @@ edit_purge_widget (WEdit *edit)
}
static void
edit_set_keymap (WEdit *edit)
edit_set_keymap (void)
{
editor_map = default_editor_keymap;
if (editor_keymap && editor_keymap->len > 0)
@ -839,7 +839,7 @@ edit_init (WEdit *edit, int lines, int columns, const char *filename,
edit_move_to_line (edit, line - 1);
}
edit_set_keymap (edit);
edit_set_keymap ();
return edit;
}

View File

@ -428,7 +428,6 @@ menu_save_mode_cmd (void)
size_t i;
size_t maxlen = 0;
int dlg_x;
size_t w0, w1, b_len, w3;
assert (option_backup_ext != NULL);
@ -438,7 +437,7 @@ menu_save_mode_cmd (void)
w1 = str_term_width1 (_(widgets[1].u.button.text)) + 5; /* default button */
b_len = w0 + w1 + 3;
maxlen = max (b_len, str_term_width1 (_(dialog.title)) + 2);
maxlen = max (b_len, (size_t) str_term_width1 (_(dialog.title)) + 2);
w3 = 0;
for (i = 0; i < 3; i++) {
@ -450,7 +449,7 @@ menu_save_mode_cmd (void)
maxlen = max (maxlen, w3 + 4);
dialog.xlen = min (COLS, maxlen + 8);
dialog.xlen = min ((size_t) COLS, maxlen + 8);
widgets[3].u.input.len = w3;
widgets[1].relative_x = (dialog.xlen - b_len)/2;

View File

@ -279,7 +279,7 @@ sort_box (const panel_field_t *sort_format, int *reverse, int *case_sensitive, i
{
int max_radio = 0, max_check = 0;
int ok_len, cancel_len;
int i;
gsize i;
QuickWidget quick_widgets[] =
{

View File

@ -923,7 +923,7 @@ file_mask_dialog (FileOpContext *ctx, FileOperation operation,
i18n = TRUE;
}
fmd_xlen = max (FMDX, COLS * 2/3);
fmd_xlen = max (FMDX, (size_t) COLS * 2/3);
/* buttons */
for (i = 0; i <= 2 - OFFSET; i++)
@ -950,7 +950,7 @@ file_mask_dialog (FileOpContext *ctx, FileOperation operation,
#endif
b0_len = str_term_width1 (fmd_widgets[0].u.button.text) + 4; /* Cancel */
len = b0_len + b1_len + b2_len;
fmd_xlen = min (max (fmd_xlen, len + 6), COLS);
fmd_xlen = min (max (fmd_xlen, len + 6), (size_t) COLS);
if (only_one) {
int flen;
@ -961,7 +961,7 @@ file_mask_dialog (FileOpContext *ctx, FileOperation operation,
format, str_trunc ((const char *) text, i));
} else {
g_snprintf (fmd_buf, sizeof (fmd_buf), format, *(const int *) text);
fmd_xlen = max (fmd_xlen, str_term_width1 (fmd_buf) + 6);
fmd_xlen = max (fmd_xlen, (size_t) str_term_width1 (fmd_buf) + 6);
}
for (i = sizeof (fmd_widgets) / sizeof (fmd_widgets[0]); i > 0; )

View File

@ -49,6 +49,9 @@
inline static gboolean
mc_fhl_is_file (file_entry * fe)
{
#if S_ISREG == 0
(void) fe;
#endif
return S_ISREG (fe->st.st_mode);
}
@ -61,12 +64,18 @@ mc_fhl_is_file_exec (file_entry * fe)
inline static gboolean
mc_fhl_is_dir (file_entry * fe)
{
#if S_ISDIR == 0
(void) fe;
#endif
return S_ISDIR (fe->st.st_mode);
}
inline static gboolean
mc_fhl_is_link (file_entry * fe)
{
#if S_ISLNK == 0
(void) fe;
#endif
return S_ISLNK (fe->st.st_mode);
}
@ -85,30 +94,46 @@ mc_fhl_is_stale_link (file_entry * fe)
inline static gboolean
mc_fhl_is_device_char (file_entry * fe)
{
#if S_ISCHR == 0
(void) fe;
#endif
return S_ISCHR (fe->st.st_mode);
}
inline static gboolean
mc_fhl_is_device_block (file_entry * fe)
{
#if S_ISBLK == 0
(void) fe;
#endif
return S_ISBLK (fe->st.st_mode);
}
inline static gboolean
mc_fhl_is_special_socket (file_entry * fe)
{
#if S_ISSOCK == 0
(void) fe;
#endif
return S_ISSOCK (fe->st.st_mode);
}
inline static gboolean
mc_fhl_is_special_fifo (file_entry * fe)
{
#if S_ISFIFO == 0
(void) fe;
#endif
return S_ISFIFO (fe->st.st_mode);
}
inline static gboolean
mc_fhl_is_special_door (file_entry * fe)
{
#if S_ISDOOR == 0
(void) fe;
#endif
return S_ISDOOR (fe->st.st_mode);
}

View File

@ -150,7 +150,7 @@ static struct {
{ N_("&Edit - F4"), 13, 38 }
};
static char *in_contents = NULL;
static const char *in_contents = NULL;
static char *in_start_dir = INPUT_LAST_TEXT;
static mc_search_t *search_file_handle = NULL;
@ -441,7 +441,7 @@ find_parameters (char **start_dir, char **pattern, char **content)
/* keep empty Content field */
/* if not empty, fill from history */
*content = NULL;
in_contents = "";
in_contents = "";
if (in_with->buffer[0] != '\0') {
*content = g_strdup (in_with->buffer);
in_contents = INPUT_LAST_TEXT;

View File

@ -134,7 +134,7 @@ menubar_paint_idx (WMenuBar *menubar, unsigned int idx, int color)
const int y = 2 + idx;
int x = menu->start_x;
if (x + menu->max_entry_len + 4 > menubar->widget.cols)
if (x + menu->max_entry_len + 4 > (gsize) menubar->widget.cols)
x = menubar->widget.cols - menu->max_entry_len - 4;
if (entry == NULL) {
@ -185,7 +185,7 @@ menubar_draw_drop (WMenuBar *menubar)
int column = menu->start_x - 1;
unsigned int i;
if (column + menu->max_entry_len + 5 > menubar->widget.cols)
if (column + menu->max_entry_len + 5 > (gsize) menubar->widget.cols)
column = menubar->widget.cols - menu->max_entry_len - 5;
tty_setcolor (MENU_ENTRY_COLOR);
@ -225,7 +225,7 @@ menubar_draw (WMenuBar *menubar)
/* Now each one of the entries */
for (i = menubar->menu; i != NULL; i = g_list_next (i)) {
Menu *menu = i->data;
gboolean is_selected = (menubar->selected == g_list_position (menubar->menu, i));
gboolean is_selected = (menubar->selected == (gsize) g_list_position (menubar->menu, i));
menubar_set_color (menubar, is_selected, FALSE);
widget_move (&menubar->widget, 0, menu->start_x);
@ -605,7 +605,7 @@ menubar_event (Gpm_Event *event, void *data)
menubar_right (menubar);
else {
const unsigned int len = g_list_length (menubar->menu);
int new_selection = 0;
unsigned int new_selection = 0;
while ((new_selection < len)
&& (event->x > ((Menu *) g_list_nth_data (menubar->menu,

View File

@ -62,7 +62,7 @@ typedef struct WMenuBar {
gboolean is_active; /* If the menubar is in use */
gboolean is_dropped; /* If the menubar has dropped */
GList *menu; /* The actual menus */
unsigned int selected; /* Selected menu on the top bar */
size_t selected; /* Selected menu on the top bar */
int previous_widget; /* Selected widget ID before activating menu */
} WMenuBar;

View File

@ -1158,11 +1158,10 @@ panel_update_cols (Widget *widget, int frame_size)
widget->x = origin;
}
extern int saving_setup;
static char *
panel_save_name (WPanel *panel)
{
extern int saving_setup;
/* If the program is shuting down */
if ((midnight_shutdown && auto_save_setup) || saving_setup)
return g_strdup (panel->panel_name);
@ -1394,7 +1393,7 @@ panel_get_title_without_hotkey(const char *title)
hkey = strchr(translated_title, '&');
if ((hkey != NULL) && (hkey[1] != '\0'))
memmove(hkey, hkey+1,strlen(hkey));
memmove((void *) hkey, (void *) hkey+1,strlen(hkey));
return translated_title;
}
@ -3372,7 +3371,7 @@ const panel_field_t *
panel_get_field_by_title(const char *name)
{
gsize index;
gchar *title;
gchar *title = NULL;
for(index=0; panel_fields[index].id != NULL; index ++) {
title = panel_get_title_without_hotkey(panel_fields[index].title_hotkey);

View File

@ -182,11 +182,12 @@ mcview_display_nroff (mcview_t * view)
}
col++;
#ifdef HAVE_CHARSET
if (view->utf8)
if (view->utf8) {
if (g_unichar_iswide(c))
col++;
else if (g_unichar_iszerowidth(c))
col--;
}
#endif
tty_setcolor (NORMAL_COLOR);
}

View File

@ -68,7 +68,7 @@ mcview_display_text (mcview_t * view)
screen_dimen row, col;
off_t from;
int cw = 1;
int c, prev_ch;
int c, prev_ch = 0;
gboolean read_res = TRUE;
struct hexedit_change_node *curr = view->change_list;
@ -153,11 +153,12 @@ mcview_display_text (mcview_t * view)
}
col++;
#ifdef HAVE_CHARSET
if (view->utf8)
if (view->utf8) {
if (g_unichar_iswide(c))
col++;
else if (g_unichar_iszerowidth(c))
col--;
}
#endif
tty_setcolor (NORMAL_COLOR);
}

View File

@ -288,11 +288,12 @@ smbfs_set_debug (int arg)
DEBUGLEVEL = arg;
}
extern pstring debugf;
extern FILE *dbf;
void
smbfs_set_debugf (const char *filename)
{
extern pstring debugf;
extern FILE *dbf;
if (DEBUGLEVEL > 0) {
FILE *outfile = fopen (filename, "w");
if (outfile) {

View File

@ -531,7 +531,7 @@ tar_read_header (struct vfs_class *me, struct vfs_s_super *archive,
} else {
struct stat st;
struct vfs_s_entry *entry;
struct vfs_s_inode *inode, *parent;
struct vfs_s_inode *inode = NULL, *parent;
long data_position;
char *q;
int len;