Ticket #3465: add -Wmissing-variable-declarations option...

...and fix relative warnings.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
Andreas Mohr 2015-05-10 17:55:54 +03:00 committed by Andrew Borodin
parent 156bf097e2
commit f1b73ffe6e
15 changed files with 28 additions and 23 deletions

View File

@ -54,7 +54,7 @@ typedef struct mc_tty_color_table_struct
/*** file scope variables ************************************************************************/
mc_tty_color_table_t const color_table[] = {
static mc_tty_color_table_t const color_table[] = {
{"black", COLOR_BLACK},
{"gray", COLOR_BLACK + COLOR_INTENSITY},
{"red", COLOR_RED},
@ -81,7 +81,7 @@ mc_tty_color_table_t const color_table[] = {
{NULL, 0}
};
mc_tty_color_table_t const attributes_table[] = {
static mc_tty_color_table_t const attributes_table[] = {
{"bold", A_BOLD},
#ifdef A_ITALIC /* available since ncurses-5.9-20130831 / slang-pre2.3.0-107 */
{"italic", A_ITALIC},

View File

@ -59,8 +59,10 @@
#include "gc.h"
#include "xdirentry.h"
/* TODO: move it to separate private .h */
extern GString *vfs_str_buffer;
extern struct vfs_class *current_vfs;
extern struct dirent *mc_readdir_result;
/*** global variables ****************************************************************************/

View File

@ -59,15 +59,18 @@
#include "utilvfs.h"
#include "gc.h"
/* TODO: move it to the separate .h */
extern struct dirent *mc_readdir_result;
extern GPtrArray *vfs__classes_list;
extern GString *vfs_str_buffer;
extern struct vfs_class *current_vfs;
/*** global variables ****************************************************************************/
GPtrArray *vfs__classes_list = NULL;
GString *vfs_str_buffer = NULL;
struct vfs_class *current_vfs = NULL;
/*** file scope macro definitions ****************************************************************/
#if defined(_AIX) && !defined(NAME_MAX)

View File

@ -66,6 +66,7 @@ dnl Sorted -W options:
MC_CHECK_ONE_CFLAG([-Wmissing-field-initializers])
MC_CHECK_ONE_CFLAG([-Wmissing-parameter-type])
MC_CHECK_ONE_CFLAG([-Wmissing-prototypes])
MC_CHECK_ONE_CFLAG([-Wmissing-variable-declarations])
MC_CHECK_ONE_CFLAG([-Wnested-externs])
MC_CHECK_ONE_CFLAG([-Wno-long-long])
MC_CHECK_ONE_CFLAG([-Wno-unreachable-code])

View File

@ -46,9 +46,6 @@
/*** global variables ****************************************************************************/
/* If true, show version info and exit */
gboolean mc_args__show_version = FALSE;
/* If true, assume we are running on an xterm terminal */
gboolean mc_args__force_xterm = FALSE;
@ -80,6 +77,9 @@ char *mc_run_param1 = NULL;
/*** file scope variables ************************************************************************/
/* If true, show version info and exit */
static gboolean mc_args__show_version = FALSE;
/* forward declarations */
static gboolean parse_mc_e_argument (const gchar * option_name, const gchar * value,
gpointer data, GError ** mcerror);
@ -193,7 +193,7 @@ static const GOptionEntry argument_main_table[] = {
/* *INDENT-ON* */
};
GOptionGroup *terminal_group;
static GOptionGroup *terminal_group;
#define ARGS_TERM_OPTIONS 0
static const GOptionEntry argument_terminal_table[] = {
/* *INDENT-OFF* */
@ -280,7 +280,7 @@ static const GOptionEntry argument_terminal_table[] = {
#undef ARGS_TERM_OPTIONS
GOptionGroup *color_group;
static GOptionGroup *color_group;
#define ARGS_COLOR_OPTIONS 0
/* #define ARGS_COLOR_OPTIONS G_OPTION_FLAG_IN_MAIN */
static const GOptionEntry argument_color_table[] = {

View File

@ -63,7 +63,7 @@ static int (*mc_aspell_config_replace) (struct AspellConfig * ths, const char *k
static struct AspellCanHaveError *(*mc_new_aspell_speller) (struct AspellConfig * config);
static unsigned int (*mc_aspell_error_number) (const struct AspellCanHaveError * ths);
static const char *(*mc_aspell_speller_error_message) (const struct AspellSpeller * ths);
const struct AspellError *(*mc_aspell_speller_error) (const struct AspellSpeller * ths);
static const struct AspellError *(*mc_aspell_speller_error) (const struct AspellSpeller * ths);
static struct AspellSpeller *(*mc_to_aspell_speller) (struct AspellCanHaveError * obj);
static int (*mc_aspell_speller_check) (struct AspellSpeller * ths, const char *word, int word_size);

View File

@ -93,7 +93,7 @@
/*** file scope variables ************************************************************************/
unsigned long configure_old_esc_mode_id, configure_time_out_id;
static unsigned long configure_old_esc_mode_id, configure_time_out_id;
/* Index in list_types[] for "brief" */
static const int panel_listing_brief_idx = 1;
@ -113,8 +113,8 @@ static int new_display_codepage;
static unsigned long ftpfs_always_use_proxy_id, ftpfs_proxy_host_id;
#endif /* ENABLE_VFS && ENABLE_VFS_FTP */
GPtrArray *skin_names;
gchar *current_skin_name;
static GPtrArray *skin_names;
static gchar *current_skin_name;
#ifdef ENABLE_BACKGROUND
static WListbox *bg_list = NULL;

View File

@ -243,7 +243,7 @@ typedef struct
/*** file scope variables ************************************************************************/
struct
static struct
{
Widget *w;
FileProgressStatus action;

View File

@ -192,7 +192,7 @@ static struct
/* *INDENT-ON* */
static const size_t fbuts_num = G_N_ELEMENTS (fbuts);
const size_t quit_button = 4; /* index of "Quit" button */
static const size_t quit_button = 4; /* index of "Quit" button */
static WListbox *find_list; /* Listbox with the file list */

View File

@ -48,6 +48,8 @@ extern gboolean xterm_title;
extern int free_space;
extern int nice_rotating_dash;
extern int ok_to_refresh;
extern panels_layout_t panels_layout;
/*** declarations of public functions ************************************************************/

View File

@ -88,9 +88,6 @@
#include "midnight.h"
/* TODO: merge content of layout.c here */
extern int ok_to_refresh;
/*** global variables ****************************************************************************/
/* When the modes are active, left_panel, right_panel and tree_panel */

View File

@ -310,8 +310,6 @@ panel_field_t panel_fields[] = {
mc_fhl_t *mc_filehighlight = NULL;
extern int saving_setup;
/*** file scope macro definitions ****************************************************************/
#define NORMAL 0

View File

@ -134,6 +134,8 @@ extern struct macro_action_t record_macro_buf[MAX_MACRO_LENGTH];
extern GArray *macros_list;
extern int saving_setup;
/*** declarations of public functions ************************************************************/
const char *setup_init (void);

View File

@ -66,8 +66,6 @@
/*** global variables ****************************************************************************/
GArray *extfs_plugins = NULL;
/*** file scope macro definitions ****************************************************************/
#undef ERRNOR
@ -135,6 +133,8 @@ typedef struct
/*** file scope variables ************************************************************************/
static GArray *extfs_plugins = NULL;
static gboolean errloop;
static gboolean notadir;

View File

@ -71,7 +71,7 @@ enum config_var_type
/*** file scope variables ************************************************************************/
/* *INDENT-OFF* */
struct
static struct
{
const char *pattern;
mc_search_t *pattern_regexp;