From 5cb2ef30f35040f37b2f09f767e67233ab3421a0 Mon Sep 17 00:00:00 2001 From: Pavel Roskin Date: Fri, 15 Nov 2002 06:38:55 +0000 Subject: [PATCH] Fix duplicate declarations. --- edit/edit.h | 2 -- edit/syntax.c | 2 -- src/cmd.c | 20 ++++++++------------ src/dir.h | 1 - src/dlg.c | 2 -- src/file.h | 2 -- src/main.c | 3 +++ src/main.h | 6 ++---- src/menu.c | 1 - src/option.c | 2 -- src/panelize.c | 3 --- src/slint.c | 4 ---- src/view.h | 1 - vfs/ftpfs.c | 6 ++---- vfs/vfs.c | 6 +----- vfs/vfs.h | 3 +-- 16 files changed, 17 insertions(+), 47 deletions(-) diff --git a/edit/edit.h b/edit/edit.h index 028ab6e1c..6b393eb6c 100644 --- a/edit/edit.h +++ b/edit/edit.h @@ -315,8 +315,6 @@ int edit_execute_cmd (WEdit * edit, int command, int char_for_insertion); #define color_palette(x) win->color[x].pixel -extern char *home_dir; - #define NUM_SELECTION_HISTORY 64 #ifndef MAX_PATH_LEN diff --git a/edit/syntax.c b/edit/syntax.c index 68492aa4e..7cd564d8e 100644 --- a/edit/syntax.c +++ b/edit/syntax.c @@ -497,8 +497,6 @@ static void get_args (char *l, char **args, int *argc) #define check_a {if(!*a){result=line;break;}} #define check_not_a {if(*a){result=line;break;}} -int try_alloc_color_pair (char *fg, char *bg); - static int this_try_alloc_color_pair (char *fg, char *bg) { diff --git a/src/cmd.c b/src/cmd.c index e7cb218cd..838cf7730 100644 --- a/src/cmd.c +++ b/src/cmd.c @@ -83,19 +83,7 @@ int source_route = 0; /* If set, use the builtin editor */ int use_internal_edit = 1; -/* Ugly hack in order to distinguish between left and right panel in menubar */ -int is_right; -#define MENU_PANEL_IDX (is_right ? 1 : 0) - -/* view_file (filename, normal, internal) - * - * Inputs: - * filename: The file name to view - * plain_view: If set does not do any fancy pre-processing (no filtering) and - * always invokes the internal viewer. - * internal: If set uses the internal viewer, otherwise an external viewer. - */ int view_file_at_line (char *filename, int plain_view, int internal, int start_line) @@ -169,6 +157,14 @@ view_file_at_line (char *filename, int plain_view, int internal, return move_dir; } +/* view_file (filename, plain_view, internal) + * + * Inputs: + * filename: The file name to view + * plain_view: If set does not do any fancy pre-processing (no filtering) and + * always invokes the internal viewer. + * internal: If set uses the internal viewer, otherwise an external viewer. + */ int view_file (char *filename, int plain_view, int internal) { diff --git a/src/dir.h b/src/dir.h index 1c4a1c5e9..08d479662 100644 --- a/src/dir.h +++ b/src/dir.h @@ -83,7 +83,6 @@ int if_link_is_exe (char *full_name, file_entry *file); extern int show_backups; extern int show_dot_files; -extern int show_backups; extern int mix_all_files; #endif /* __DIR_H */ diff --git a/src/dlg.c b/src/dlg.c index b02f08ffe..8bfe4a180 100644 --- a/src/dlg.c +++ b/src/dlg.c @@ -59,8 +59,6 @@ static void slow_box (Dlg_head *h, int y, int x, int ys, int xs) /* draw box in window */ void draw_box (Dlg_head *h, int y, int x, int ys, int xs) { - extern int slow_terminal; - if (slow_terminal){ slow_box (h, y, x, ys, xs); return; diff --git a/src/file.h b/src/file.h index cd96ec674..3a304ac50 100644 --- a/src/file.h +++ b/src/file.h @@ -39,8 +39,6 @@ extern int file_op_compute_totals; /* Query routines */ -extern int background_wait; - int is_wildcarded (char *p); void compute_dir_size (char *dirname, off_t *ret_marked, double *ret_total); diff --git a/src/main.c b/src/main.c index f0abbf180..ae4fa9b38 100644 --- a/src/main.c +++ b/src/main.c @@ -118,6 +118,9 @@ struct WMenu *the_menubar; /* Pointers to the selected and unselected panel */ WPanel *current_panel = NULL; +/* Set if the command is being run from the "Right" menu */ +int is_right; + /* Set when main loop should be terminated */ volatile int quit = 0; diff --git a/src/main.h b/src/main.h index ce5936ece..30c2616b5 100644 --- a/src/main.h +++ b/src/main.h @@ -47,7 +47,6 @@ extern int clear_before_exec; extern int mou_auto_repeat; extern char *other_dir; extern int mouse_move_pages; -extern int mouse_move_pages_viewer; #ifdef HAVE_CHARSET extern int source_codepage; @@ -79,16 +78,16 @@ extern int searching; extern int vfs_use_limit; extern int alternate_plus_minus; extern int only_leading_plus_minus; -extern int ftpfs_directory_timeout; extern int output_starts_shell; extern int midnight_shutdown; extern char search_buffer [256]; extern char cmd_buf [512]; extern char *cmdline_geometry; -/* The menu panels */ +/* Ugly hack in order to distinguish between left and right panel in menubar */ extern int is_right; /* If the selected menu was the right */ #define MENU_PANEL (is_right ? right_panel : left_panel) +#define MENU_PANEL_IDX (is_right ? 1 : 0) #define SELECTED_IS_PANEL (get_display_type (is_right ? 1 : 0) == view_listing) typedef void (*key_callback) (); @@ -161,7 +160,6 @@ void edition_post_exec (void); void done_menu (void); void init_menu (void); -void exec_shell (void); #ifdef NATIVE_WIN32 # define MC_BASE "" diff --git a/src/menu.c b/src/menu.c index 1c45a997f..8fd36852e 100644 --- a/src/menu.c +++ b/src/menu.c @@ -31,7 +31,6 @@ #include "win.h" #include "key.h" /* For mi_getch() */ -extern int is_right; int menubar_visible = 1; /* This is the new default */ static void diff --git a/src/option.c b/src/option.c index ff73c0de7..55b32b25e 100644 --- a/src/option.c +++ b/src/option.c @@ -48,8 +48,6 @@ static int r_but; #define TOGGLE_VARIABLE 0 -extern int use_internal_edit; - static int first_width, second_width; static char *title1, *title2, *title3; diff --git a/src/panelize.c b/src/panelize.c index 83af892cd..6e56c1ec6 100644 --- a/src/panelize.c +++ b/src/panelize.c @@ -45,11 +45,8 @@ #include "panel.h" /* Needed for the externs */ #include "file.h" #include "main.h" -#include "../vfs/vfs.h" #include "panelize.h" -void do_external_panelize (char *command); - #define UX 5 #define UY 2 diff --git a/src/slint.c b/src/slint.c index b077f00bb..acade058d 100644 --- a/src/slint.c +++ b/src/slint.c @@ -71,7 +71,6 @@ static int slinterrupt; static int no_slang_delay; /* {{{ Copied from ../slang/slgetkey.c, removed the DEC_8Bit_HACK, */ -extern unsigned int SLang_Input_Buffer_Len; extern unsigned char SLang_Input_Buffer []; #if SLANG_VERSION >= 10000 extern unsigned int _SLsys_getkey (void); @@ -172,9 +171,6 @@ got_interrupt (void) void slang_init (void) { - extern int SLtt_Blink_Mode; - extern int SLtt_Has_Alt_Charset; - extern int force_ugly_line_drawing; struct sigaction act, oact; SLtt_get_terminfo (); diff --git a/src/view.h b/src/view.h index dd8839e12..15c97e65f 100644 --- a/src/view.h +++ b/src/view.h @@ -10,7 +10,6 @@ int view_init (WView *view, char *_command, const char *_file, int start_line); void view_update_bytes_per_line (WView *view); -int view_file (char *filename, int normal, int internal); /* Command: view a file, if _command != NULL we use popen on _command */ /* move direction should be apointer that will hold the direction in which the user */ diff --git a/vfs/ftpfs.c b/vfs/ftpfs.c index a93d4fda0..be695211e 100644 --- a/vfs/ftpfs.c +++ b/vfs/ftpfs.c @@ -107,8 +107,6 @@ int ftpfs_first_cd_then_ls; /* Use the ~/.netrc */ int use_netrc = 1; -extern char *home_dir; - /* Anonymous setup */ char *ftpfs_anonymous_passwd = NULL; int ftpfs_directory_timeout = 900; @@ -153,7 +151,7 @@ static char reply_str [80]; static char *ftpfs_get_current_directory (vfs *me, vfs_s_super *super); static int ftpfs_chdir_internal (vfs *me, vfs_s_super *super, char *remote_path); -static int command (vfs *me, vfs_s_super *super, int wait_reply, char *fmt, ...) +static int command (vfs *me, vfs_s_super *super, int wait_reply, const char *fmt, ...) __attribute__ ((format (printf, 4, 5))); static int ftpfs_open_socket (vfs *me, vfs_s_super *super); static int login_server (vfs *me, vfs_s_super *super, const char *netrcpass); @@ -313,7 +311,7 @@ reconnect (vfs *me, vfs_s_super *super) } static int -command (vfs *me, vfs_s_super *super, int wait_reply, char *fmt, ...) +command (vfs *me, vfs_s_super *super, int wait_reply, const char *fmt, ...) { va_list ap; char *str, *fmt_str; diff --git a/vfs/vfs.c b/vfs/vfs.c index 09c1a176b..1a537b6b9 100644 --- a/vfs/vfs.c +++ b/vfs/vfs.c @@ -54,13 +54,9 @@ # include "tcputil.h" #endif -extern int get_other_type (void); - int vfs_timeout = 60; /* VFS timeout in seconds */ static int vfs_flags = 0; /* Flags */ -extern int cd_symlinks; /* Defined in main.c */ - /* They keep track of the current directory */ static vfs *current_vfs = &vfs_local_ops; static char *current_dir = NULL; @@ -1794,7 +1790,7 @@ error: } void -vfs_die (char *m) +vfs_die (const char *m) { message_1s (1, _("Internal error:"), m); exit (1); diff --git a/vfs/vfs.h b/vfs/vfs.h index b21ca4873..ab10dd22a 100644 --- a/vfs/vfs.h +++ b/vfs/vfs.h @@ -203,7 +203,6 @@ int mc_link (const char *name1, const char *name2); int mc_mknod (char *, int, int); int mc_rename (const char *original, const char *target); - int mc_write (int fd, char *buf, int nbyte); int mc_rmdir (char *path); int mc_mkdir (char *path, mode_t mode); @@ -318,7 +317,7 @@ extern int vfs_parse_filetype (char c); extern int vfs_parse_filemode (const char *p); extern int vfs_parse_filedate(int idx, time_t *t); -extern void vfs_die (char *msg); +extern void vfs_die (const char *msg); extern char *vfs_get_password (char *msg); /* Flags for vfs_split_url() */