Ticket #3465: mc-3465-cleanup-missing_variable_declarations-warning-v2.patch

File mc-3465-cleanup-missing_variable_declarations-warning-v2.patch, 8.8 KB (added by and, 9 years ago)
  • m4.include/mc-cflags.m4

    fix -Wmissing-variable-declarations warnings and add to mc cflags
    
    color-internal.c:57:28: warning: no previous extern declaration for non-static variable 'color_table' [-Wmissing-variable-declarations]
    color-internal.c:84:28: warning: no previous extern declaration for non-static variable 'attributes_table' [-Wmissing-variable-declarations]
    vfs.c:65:12: warning: no previous extern declaration for non-static variable 'vfs__classes_list' [-Wmissing-variable-declarations]
    vfs.c:67:10: warning: no previous extern declaration for non-static variable 'vfs_str_buffer' [-Wmissing-variable-declarations]
    vfs.c:68:19: warning: no previous extern declaration for non-static variable 'current_vfs' [-Wmissing-variable-declarations]
    interface.c:67:16: warning: no previous extern declaration for non-static variable 'mc_readdir_result' [-Wmissing-variable-declarations]
    boxes.c:96:15: warning: no previous extern declaration for non-static variable 'configure_old_esc_mode_id' [-Wmissing-variable-declarations]
    boxes.c:96:42: warning: no previous extern declaration for non-static variable 'configure_time_out_id' [-Wmissing-variable-declarations]
    boxes.c:114:12: warning: no previous extern declaration for non-static variable 'skin_names' [-Wmissing-variable-declarations]
    boxes.c:115:8: warning: no previous extern declaration for non-static variable 'current_skin_name' [-Wmissing-variable-declarations]
    filegui.c:253:3: warning: no previous extern declaration for non-static variable 'progress_buttons' [-Wmissing-variable-declarations]
    find.c:195:14: warning: no previous extern declaration for non-static variable 'quit_button' [-Wmissing-variable-declarations]
    layout.c:105:5: warning: no previous extern declaration for non-static variable 'ok_to_refresh' [-Wmissing-variable-declarations]
    extfs.c:69:9: warning: no previous extern declaration for non-static variable 'extfs_plugins' [-Wmissing-variable-declarations]
    args.c:50:10: warning: no previous extern declaration for non-static variable 'mc_args__show_version' [-Wmissing-variable-declarations]
    args.c:195:15: warning: no previous extern declaration for non-static variable 'terminal_group' [-Wmissing-variable-declarations]
    args.c:282:15: warning: no previous extern declaration for non-static variable 'color_group' [-Wmissing-variable-declarations]
    setup.c:127:5: warning: no previous extern declaration for non-static variable 'saving_setup' [-Wmissing-variable-declarations]
    config_parser.c:80:3: error: no previous extern declaration for non-static variable 'config_variables' [-Werror,-Wmissing-variable-declarations]
    spell.c:66:29: error: no previous extern declaration for non-static variable 'mc_aspell_speller_error' [-Werror,-Wmissing-variable-declarations]
    
    Signed-off-by: Andreas Mohr <and@gmx.li>
    
    a b  
    6666    MC_CHECK_ONE_CFLAG([-Wmissing-field-initializers]) 
    6767    MC_CHECK_ONE_CFLAG([-Wmissing-parameter-type]) 
    6868    MC_CHECK_ONE_CFLAG([-Wmissing-prototypes]) 
     69    MC_CHECK_ONE_CFLAG([-Wmissing-variable-declarations]) 
    6970    MC_CHECK_ONE_CFLAG([-Wnested-externs]) 
    7071    MC_CHECK_ONE_CFLAG([-Wno-long-long]) 
    7172    MC_CHECK_ONE_CFLAG([-Wno-unreachable-code]) 
  • src/args.c

    a b  
    4747/*** global variables ****************************************************************************/ 
    4848 
    4949/* If true, show version info and exit */ 
    50 gboolean mc_args__show_version = FALSE; 
     50static gboolean mc_args__show_version = FALSE; 
    5151 
    5252/* If true, assume we are running on an xterm terminal */ 
    5353gboolean mc_args__force_xterm = FALSE; 
     
    192192    /* *INDENT-ON* */ 
    193193}; 
    194194 
    195 GOptionGroup *terminal_group; 
     195static GOptionGroup *terminal_group; 
    196196#define ARGS_TERM_OPTIONS 0 
    197197static const GOptionEntry argument_terminal_table[] = { 
    198198    /* *INDENT-OFF* */ 
     
    279279 
    280280#undef ARGS_TERM_OPTIONS 
    281281 
    282 GOptionGroup *color_group; 
     282static GOptionGroup *color_group; 
    283283#define ARGS_COLOR_OPTIONS 0 
    284284/* #define ARGS_COLOR_OPTIONS G_OPTION_FLAG_IN_MAIN */ 
    285285static const GOptionEntry argument_color_table[] = { 
  • lib/tty/color-internal.c

    a b  
    5454 
    5555/*** file scope variables ************************************************************************/ 
    5656 
    57 mc_tty_color_table_t const color_table[] = { 
     57static mc_tty_color_table_t const color_table[] = { 
    5858    {"black", COLOR_BLACK}, 
    5959    {"gray", COLOR_BLACK + COLOR_INTENSITY}, 
    6060    {"red", COLOR_RED}, 
     
    8181    {NULL, 0} 
    8282}; 
    8383 
    84 mc_tty_color_table_t const attributes_table[] = { 
     84static mc_tty_color_table_t const attributes_table[] = { 
    8585    {"bold", A_BOLD}, 
    8686#ifdef A_ITALIC                 /* available since ncurses-5.9-20130831 / slang-pre2.3.0-107 */ 
    8787    {"italic", A_ITALIC}, 
  • lib/vfs/interface.c

    a b  
    6161 
    6262extern GString *vfs_str_buffer; 
    6363extern struct vfs_class *current_vfs; 
    64  
     64extern struct dirent *mc_readdir_result; 
    6565/*** global variables ****************************************************************************/ 
    6666 
    6767struct dirent *mc_readdir_result = NULL; 
  • lib/vfs/vfs.c

    a b  
    6060#include "gc.h" 
    6161 
    6262extern struct dirent *mc_readdir_result; 
     63extern GPtrArray *vfs__classes_list; 
     64extern GString *vfs_str_buffer; 
     65extern struct vfs_class *current_vfs; 
    6366/*** global variables ****************************************************************************/ 
    6467 
    6568GPtrArray *vfs__classes_list = NULL; 
    6669 
    6770GString *vfs_str_buffer = NULL; 
    68 struct vfs_class *current_vfs = NULL; 
    6971 
     72struct vfs_class *current_vfs = NULL; 
    7073 
    7174/*** file scope macro definitions ****************************************************************/ 
    7275 
  • src/filemanager/boxes.c

    a b  
    9393 
    9494/*** file scope variables ************************************************************************/ 
    9595 
    96 unsigned long configure_old_esc_mode_id, configure_time_out_id; 
     96static unsigned long configure_old_esc_mode_id, configure_time_out_id; 
    9797 
    9898/* Index in list_types[] for "user defined" */ 
    9999static const int panel_listing_user_idx = 3; 
     
    111111static unsigned long ftpfs_always_use_proxy_id, ftpfs_proxy_host_id; 
    112112#endif /* ENABLE_VFS && ENABLE_VFS_FTP */ 
    113113 
    114 GPtrArray *skin_names; 
    115 gchar *current_skin_name; 
     114static GPtrArray *skin_names; 
     115static gchar *current_skin_name; 
    116116 
    117117#ifdef ENABLE_BACKGROUND 
    118118static WListbox *bg_list = NULL; 
  • src/filemanager/filegui.c

    a b  
    243243 
    244244/*** file scope variables ************************************************************************/ 
    245245 
    246 struct 
     246static struct 
    247247{ 
    248248    Widget *w; 
    249249    FileProgressStatus action; 
  • src/filemanager/find.c

    a b  
    192192/* *INDENT-ON* */ 
    193193 
    194194static const size_t fbuts_num = G_N_ELEMENTS (fbuts); 
    195 const size_t quit_button = 4;   /* index of "Quit" button */ 
     195static const size_t quit_button = 4;   /* index of "Quit" button */ 
    196196 
    197197static WListbox *find_list;     /* Listbox with the file list */ 
    198198 
  • src/filemanager/layout.c

    a b  
    6666#include "layout.h" 
    6767#include "info.h"               /* The Info widget */ 
    6868 
     69extern int ok_to_refresh; 
    6970/*** global variables ****************************************************************************/ 
    7071 
    7172panels_layout_t panels_layout = { 
  • src/setup.c

    a b  
    7878 
    7979#include "setup.h" 
    8080 
     81extern int saving_setup; 
    8182/*** global variables ****************************************************************************/ 
    8283 
    8384char *global_profile_name;      /* mc.lib */ 
  • src/vfs/extfs/extfs.c

    a b  
    6666 
    6767/*** global variables ****************************************************************************/ 
    6868 
    69 GArray *extfs_plugins = NULL; 
     69static GArray *extfs_plugins = NULL; 
    7070 
    7171/*** file scope macro definitions ****************************************************************/ 
    7272 
  • src/vfs/sftpfs/config_parser.c

    a b  
    7171/*** file scope variables ************************************************************************/ 
    7272 
    7373/* *INDENT-OFF* */ 
    74 struct 
     74static struct 
    7575{ 
    7676    const char *pattern; 
    7777    mc_search_t *pattern_regexp; 
  • src/editor/spell.c

    a b  
    6363static struct AspellCanHaveError *(*mc_new_aspell_speller) (struct AspellConfig * config); 
    6464static unsigned int (*mc_aspell_error_number) (const struct AspellCanHaveError * ths); 
    6565static const char *(*mc_aspell_speller_error_message) (const struct AspellSpeller * ths); 
    66 const struct AspellError *(*mc_aspell_speller_error) (const struct AspellSpeller * ths); 
     66static const struct AspellError *(*mc_aspell_speller_error) (const struct AspellSpeller * ths); 
    6767 
    6868static struct AspellSpeller *(*mc_to_aspell_speller) (struct AspellCanHaveError * obj); 
    6969static int (*mc_aspell_speller_check) (struct AspellSpeller * ths, const char *word, int word_size);