Ticket #4270: mc-4270-remove-unused-macros.patch

File mc-4270-remove-unused-macros.patch, 3.3 KB (added by and, 2 years ago)
  • lib/tty/key.c

    From a4f82cdc371261cbedefa6df320c64b61d6ad743 Mon Sep 17 00:00:00 2001
    From: Andreas Mohr <and@gmx.li>
    Date: Wed, 22 Dec 2021 21:46:58 +0000
    Subject: [PATCH] (key.c,utilunix.c,ftpfs_parse_ls.c) remove unused macros
    
    key.c:223: warning: macro "MC_MSEC_PER_SEC" is not used []8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wunused-macros-Wunused-macros]8;;]
      223 | #define MC_MSEC_PER_SEC  1000
    
    utilunix.c:85: warning: macro "MAX_PIPE_SIZE" is not used []8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wunused-macros-Wunused-macros]8;;]
       85 | #define MAX_PIPE_SIZE 4096
    
    ftpfs_parse_ls.c:66: warning: macro "NO_DATE_YET" is not used []8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wunused-macros-Wunused-macros]8;;]
       66 | #define NO_DATE_YET ((time_t) (-2L))
          | 
    ftpfs_parse_ls.c:64: warning: macro "NO_SIZE_YET" is not used []8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wunused-macros-Wunused-macros]8;;]
       64 | #define NO_SIZE_YET ((off_t) (-2L))
          | 
    ftpfs_parse_ls.c:60: warning: macro "HOUR" is not used []8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wunused-macros-Wunused-macros]8;;]
       60 | #define HOUR   (60 * MINUTE)
          | 
    ftpfs_parse_ls.c:59: warning: macro "MINUTE" is not used []8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wunused-macros-Wunused-macros]8;;]
       59 | #define MINUTE (60)
          | 
    ftpfs_parse_ls.c:61: warning: macro "DAY" is not used []8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wunused-macros-Wunused-macros]8;;]
       61 | #define DAY    (24 * HOUR)
          | 
    
    Found by gcc 11
    
    Signed-off-by: Andreas Mohr <and@gmx.li>
    ---
     lib/tty/key.c                  | 1 -
     lib/utilunix.c                 | 4 ----
     src/vfs/ftpfs/ftpfs_parse_ls.c | 6 ------
     3 files changed, 11 deletions(-)
    
    diff --git a/lib/tty/key.c b/lib/tty/key.c
    index 7651da999..930e086df 100644
    a b const key_code_name_t key_name_conv_tab[] = { 
    220220 
    221221/*** file scope macro definitions ****************************************************************/ 
    222222 
    223 #define MC_MSEC_PER_SEC  1000 
    224223#define MC_USEC_PER_MSEC 1000 
    225224 
    226225/* The maximum sequence length (32 + null terminator) */ 
  • lib/utilunix.c

    diff --git a/lib/utilunix.c b/lib/utilunix.c
    index f8d4dc366..3f4e14781 100644
    a b struct sigaction startup_handler; 
    8080#define UID_CACHE_SIZE 200 
    8181#define GID_CACHE_SIZE 30 
    8282 
    83 /* Pipes are guaranteed to be able to hold at least 4096 bytes */ 
    84 /* More than that would be unportable */ 
    85 #define MAX_PIPE_SIZE 4096 
    86  
    8783/*** file scope type declarations ****************************************************************/ 
    8884 
    8985typedef struct 
  • src/vfs/ftpfs/ftpfs_parse_ls.c

    diff --git a/src/vfs/ftpfs/ftpfs_parse_ls.c b/src/vfs/ftpfs/ftpfs_parse_ls.c
    index 595131600..f452f3e4b 100644
    a b  
    5656 
    5757#define number_of_parsers 7 
    5858 
    59 #define MINUTE (60) 
    60 #define HOUR   (60 * MINUTE) 
    61 #define DAY    (24 * HOUR) 
    62  
    6359#define NO_SIZE     ((off_t) (-1L)) 
    64 #define NO_SIZE_YET ((off_t) (-2L)) 
    6560#define NO_DATE     ((time_t) (-1L)) 
    66 #define NO_DATE_YET ((time_t) (-2L)) 
    6761 
    6862#define FIRST_TOKEN strtok (line, " \t") 
    6963#define NEXT_TOKEN  strtok (NULL, " \t")