Ticket #3641: mc-3641-cleanup-compile-warning-unused_macro.patch

File mc-3641-cleanup-compile-warning-unused_macro.patch, 10.0 KB (added by and, 8 years ago)
  • lib/charsets.c

    From ffcccaf6a5e85a7d31c5a71880a85c5b895d6b7f Mon Sep 17 00:00:00 2001
    From: Andreas Mohr <and@gmx.li>
    Date: Sat, 16 Jul 2016 18:52:39 +0000
    Subject: [PATCH] Cleanup unused macro warnings
    
    Cleanup unused macro warnings.
    
    charsets.c:61:9: warning: macro is not used [-Wunused-macros]
    #define CP_ASCII 0
            ^
    
    strverscmp.c:41:10: warning: macro is not used [-Wunused-macros]
    #define  S_N    0x0
             ^
    strverscmp.c:42:10: warning: macro is not used [-Wunused-macros]
    #define  S_I    0x4
             ^
    strverscmp.c:43:10: warning: macro is not used [-Wunused-macros]
    #define  S_F    0x8
             ^
    strverscmp.c:44:10: warning: macro is not used [-Wunused-macros]
    #define  S_Z    0xC
             ^
    strverscmp.c:47:10: warning: macro is not used [-Wunused-macros]
    #define  CMP    2
             ^
    strverscmp.c:48:10: warning: macro is not used [-Wunused-macros]
    #define  LEN    3
             ^
    
    vfs.c:82:9: warning: macro is not used [-Wunused-macros]
    #define ISSLASH(a) (a == '\0' || IS_PATH_SEP (a))
            ^
    
    input_complete.c:74:9: warning: macro is not used [-Wunused-macros]
    #define cr_whitespace(c) (whitespace (c) || (c) == '\n' || (c) == '\r')
            ^
    
    editcmd.c:107:9: warning: macro is not used [-Wunused-macros]
    #define is_digit(x) ((x) >= '0' && (x) <= '9')
            ^
    editcmd.c:102:9: warning: macro is not used [-Wunused-macros]
    #define INPUT_INDEX 9
            ^
    
    syntax.c:82:9: warning: macro is not used [-Wunused-macros]
    #define MAX_CONTEXTS            128
            ^
    syntax.c:77:9: warning: macro is not used [-Wunused-macros]
    #define TRANSIENT_WORD_TIME_OUT 60
            ^
    syntax.c:79:9: warning: macro is not used [-Wunused-macros]
    #define UNKNOWN_FORMAT "unknown"
            ^
    syntax.c:81:9: warning: macro is not used [-Wunused-macros]
    #define MAX_WORDS_PER_CONTEXT   1024
            ^
    
    achown.c:69:9: warning: macro is not used [-Wunused-macros]
    #define B_OTH           (B_USER + 5)
            ^
    achown.c:68:9: warning: macro is not used [-Wunused-macros]
    #define B_GRP           (B_USER + 4)
            ^
    achown.c:71:9: warning: macro is not used [-Wunused-macros]
    #define B_OGROUP        (B_USER + 7)
            ^
    achown.c:67:9: warning: macro is not used [-Wunused-macros]
    #define B_OWN           (B_USER + 3)
            ^
    achown.c:70:9: warning: macro is not used [-Wunused-macros]
    #define B_OUSER         (B_USER + 6)
            ^
    
    cmd.c:102:9: warning: macro is not used [-Wunused-macros]
    #define MAP_FILE 0
            ^
    
    filegui.c:176:9: warning: macro is not used [-Wunused-macros]
    #define WITH_FULL_PATHS 1
            ^
    
    hotlist.c:77:9: warning: macro is not used [-Wunused-macros]
    #define LABELS          3
            ^
    hotlist.c:75:9: warning: macro is not used [-Wunused-macros]
    #define BY (LINES - 6)
            ^
    hotlist.c:74:9: warning: macro is not used [-Wunused-macros]
    #define BX UX
            ^
    
    layout.c:1144:9: warning: macro is not used [-Wunused-macros]
    #define panelswapstr(e) strcpy (panel.e, panel1->e); \
            ^
    
    panelize.c:66:9: warning: macro is not used [-Wunused-macros]
    #define LABELS   3
            ^
    
    ftpfs.c:155:9: warning: macro is not used [-Wunused-macros]
    #define UPLOAD_ZERO_LENGTH_FILE
            ^
    
    Signed-off-by: Andreas Mohr <and@gmx.li>
    ---
     lib/charsets.c              | 6 ------
     lib/strutil/strverscmp.c    | 4 ++++
     lib/vfs/vfs.c               | 2 --
     lib/widget/input_complete.c | 1 -
     src/editor/editcmd.c        | 7 -------
     src/editor/syntax.c         | 7 -------
     src/filemanager/achown.c    | 5 -----
     src/filemanager/cmd.c       | 2 ++
     src/filemanager/filegui.c   | 3 ---
     src/filemanager/hotlist.c   | 4 ----
     src/filemanager/layout.c    | 5 -----
     src/filemanager/panelize.c  | 1 -
     src/vfs/ftpfs/ftpfs.c       | 1 -
     13 files changed, 6 insertions(+), 42 deletions(-)
    
    diff --git a/lib/charsets.c b/lib/charsets.c
    index 148c691..9a08054 100644
    a b const char *cp_source = NULL; 
    5454 
    5555#define OTHER_8BIT "Other_8_bit" 
    5656 
    57 /* 
    58  * FIXME: This assumes that ASCII is always the first encoding 
    59  * in mc.charsets 
    60  */ 
    61 #define CP_ASCII 0 
    62  
    6357/*** file scope type declarations ****************************************************************/ 
    6458 
    6559/*** file scope variables ************************************************************************/ 
  • lib/strutil/strverscmp.c

    diff --git a/lib/strutil/strverscmp.c b/lib/strutil/strverscmp.c
    index a37131c..81f878a 100644
    a b  
    3636 
    3737/*** file scope macro definitions ****************************************************************/ 
    3838 
     39#ifndef HAVE_STRVERSCMP 
     40 
    3941/* states: S_N: normal, S_I: comparing integral part, S_F: comparing 
    4042   fractionnal parts, S_Z: idem but with leading Zeroes only */ 
    4143#define  S_N    0x0 
     
    4749#define  CMP    2 
    4850#define  LEN    3 
    4951 
     52#endif /* HAVE_STRVERSCMP */ 
     53 
    5054/*** file scope type declarations ****************************************************************/ 
    5155 
    5256/*** file scope variables ************************************************************************/ 
  • lib/vfs/vfs.c

    diff --git a/lib/vfs/vfs.c b/lib/vfs/vfs.c
    index 49a6762..ed8034a 100644
    a b vfs_class *current_vfs = NULL; 
    7979 
    8080#define VFS_FIRST_HANDLE 100 
    8181 
    82 #define ISSLASH(a) (a == '\0' || IS_PATH_SEP (a)) 
    83  
    8482/*** file scope type declarations ****************************************************************/ 
    8583 
    8684struct vfs_openfile 
  • lib/widget/input_complete.c

    diff --git a/lib/widget/input_complete.c b/lib/widget/input_complete.c
    index 1534531..ab46ad3 100644
    a b extern char **environ; 
    7171#endif /* DO_CMPLETION_DEBUG */ 
    7272 
    7373#define whitespace(c) ((c) == ' ' || (c) == '\t') 
    74 #define cr_whitespace(c) (whitespace (c) || (c) == '\n' || (c) == '\r') 
    7574 
    7675#define DO_INSERTION 1 
    7776#define DO_QUERY     2 
  • src/editor/editcmd.c

    diff --git a/src/editor/editcmd.c b/src/editor/editcmd.c
    index aee2013..e70ae17 100644
    a b int option_drop_selection_on_copy = 1; 
    9999 
    100100#define TEMP_BUF_LEN 1024 
    101101 
    102 #define INPUT_INDEX 9 
    103  
    104 /* thanks to  Liviu Daia <daia@stoilow.imar.ro>  for getting this 
    105    (and the above) routines to work properly - paul */ 
    106  
    107 #define is_digit(x) ((x) >= '0' && (x) <= '9') 
    108  
    109102#define MAX_WORD_COMPLETIONS 100        /* in listbox */ 
    110103 
    111104/*** file scope type declarations ****************************************************************/ 
  • src/editor/syntax.c

    diff --git a/src/editor/syntax.c b/src/editor/syntax.c
    index 3f4de4c..96f9ca4 100644
    a b int option_auto_syntax = 1; 
    7474/* bytes */ 
    7575#define SYNTAX_MARKER_DENSITY 512 
    7676 
    77 #define TRANSIENT_WORD_TIME_OUT 60 
    78  
    79 #define UNKNOWN_FORMAT "unknown" 
    80  
    81 #define MAX_WORDS_PER_CONTEXT   1024 
    82 #define MAX_CONTEXTS            128 
    83  
    8477#define RULE_ON_LEFT_BORDER 1 
    8578#define RULE_ON_RIGHT_BORDER 2 
    8679 
  • src/filemanager/achown.c

    diff --git a/src/filemanager/achown.c b/src/filemanager/achown.c
    index dd8a85c..a2199f8 100644
    a b  
    6464 
    6565#define B_SETALL        B_USER 
    6666#define B_SKIP          (B_USER + 1) 
    67 #define B_OWN           (B_USER + 3) 
    68 #define B_GRP           (B_USER + 4) 
    69 #define B_OTH           (B_USER + 5) 
    70 #define B_OUSER         (B_USER + 6) 
    71 #define B_OGROUP        (B_USER + 7) 
    7267 
    7368/*** file scope type declarations ****************************************************************/ 
    7469 
  • src/filemanager/cmd.c

    diff --git a/src/filemanager/cmd.c b/src/filemanager/cmd.c
    index 1884589..7d148c7 100644
    a b  
    9898 
    9999/*** file scope macro definitions ****************************************************************/ 
    100100 
     101#ifdef HAVE_MMAP 
    101102#ifndef MAP_FILE 
    102103#define MAP_FILE 0 
    103104#endif 
     105#endif /* HAVE_MMAP */ 
    104106 
    105107/*** file scope type declarations ****************************************************************/ 
    106108 
  • src/filemanager/filegui.c

    diff --git a/src/filemanager/filegui.c b/src/filemanager/filegui.c
    index 72fd3e3..2b6871a 100644
    a b int classic_progressbar = 1; 
    172172 
    173173/*** file scope macro definitions ****************************************************************/ 
    174174 
    175 /* Hack: the vfs code should not rely on this */ 
    176 #define WITH_FULL_PATHS 1 
    177  
    178175#define truncFileString(dlg, s)       str_trunc (s, WIDGET (dlg)->cols - 10) 
    179176#define truncFileStringSecure(dlg, s) path_trunc (s, WIDGET (dlg)->cols - 10) 
    180177 
  • src/filemanager/hotlist.c

    diff --git a/src/filemanager/hotlist.c b/src/filemanager/hotlist.c
    index f4e016e..b77e212 100644
    a b  
    7171#define UX 3 
    7272#define UY 2 
    7373 
    74 #define BX UX 
    75 #define BY (LINES - 6) 
    76  
    77 #define LABELS          3 
    7874#define B_ADD_CURRENT   B_USER 
    7975#define B_REMOVE        (B_USER + 1) 
    8076#define B_NEW_GROUP     (B_USER + 2) 
  • src/filemanager/layout.c

    diff --git a/src/filemanager/layout.c b/src/filemanager/layout.c
    index e4deb86..06022c8 100644
    a b swap_panels (void) 
    11401140        WPanel panel; 
    11411141 
    11421142#define panelswap(x) panel.x = panel1->x; panel1->x = panel2->x; panel2->x = panel.x; 
    1143  
    1144 #define panelswapstr(e) strcpy (panel.e, panel1->e); \ 
    1145                         strcpy (panel1->e, panel2->e); \ 
    1146                         strcpy (panel2->e, panel.e); 
    11471143        /* Change content and related stuff */ 
    11481144        panelswap (dir); 
    11491145        panelswap (active); 
    swap_panels (void) 
    11561152        panelswap (selected); 
    11571153        panelswap (is_panelized); 
    11581154        panelswap (dir_stat); 
    1159 #undef panelswapstr 
    11601155#undef panelswap 
    11611156 
    11621157        panel1->searching = FALSE; 
  • src/filemanager/panelize.c

    diff --git a/src/filemanager/panelize.c b/src/filemanager/panelize.c
    index b468695..9715b35 100644
    a b  
    6363#define UX 3 
    6464#define UY 2 
    6565 
    66 #define LABELS   3 
    6766#define B_ADD    B_USER 
    6867#define B_REMOVE (B_USER + 1) 
    6968 
  • src/vfs/ftpfs/ftpfs.c

    diff --git a/src/vfs/ftpfs/ftpfs.c b/src/vfs/ftpfs/ftpfs.c
    index 391bd55..e60b6ec 100644
    a b int ftpfs_ignore_chattr_errors = 1; 
    152152#define MAXHOSTNAMELEN 64 
    153153#endif 
    154154 
    155 #define UPLOAD_ZERO_LENGTH_FILE 
    156155#define SUP ((ftp_super_data_t *) super->data) 
    157156#define FH_SOCK ((ftp_fh_data_t *) fh->data)->sock 
    158157