Ticket #3430: mc-indroduct-wundef-check-02.patch

File mc-indroduct-wundef-check-02.patch, 1.6 KB (added by and, 9 years ago)
  • lib/filehighlight/get-color.c

    introduce -Wundef check to catch macro typos
    more infos about motivation at https://sourceware.org/glibc/wiki/Wundef
    
    TODO: better define mc_fhl_* as macros too
    
    patch 02/04: remove superfluous macro check
    
    Signed-off-by: Andreas Mohr <and@gmx.li>
    
    a b  
    4949inline static gboolean 
    5050mc_fhl_is_file (file_entry_t * fe) 
    5151{ 
    52 #if S_ISREG == 0 
    53     (void) fe; 
    54 #endif 
    5552    return S_ISREG (fe->st.st_mode); 
    5653} 
    5754 
     
    6461inline static gboolean 
    6562mc_fhl_is_dir (file_entry_t * fe) 
    6663{ 
    67 #if S_ISDIR == 0 
    68     (void) fe; 
    69 #endif 
    7064    return S_ISDIR (fe->st.st_mode); 
    7165} 
    7266 
    7367inline static gboolean 
    7468mc_fhl_is_link (file_entry_t * fe) 
    7569{ 
    76 #if S_ISLNK == 0 
    77     (void) fe; 
    78 #endif 
    7970    return S_ISLNK (fe->st.st_mode); 
    8071} 
    8172 
     
    10091inline static gboolean 
    10192mc_fhl_is_device_char (file_entry_t * fe) 
    10293{ 
    103 #if S_ISCHR == 0 
    104     (void) fe; 
    105 #endif 
    10694    return S_ISCHR (fe->st.st_mode); 
    10795} 
    10896 
    10997inline static gboolean 
    11098mc_fhl_is_device_block (file_entry_t * fe) 
    11199{ 
    112 #if S_ISBLK == 0 
    113     (void) fe; 
    114 #endif 
    115100    return S_ISBLK (fe->st.st_mode); 
    116101} 
    117102 
    118103inline static gboolean 
    119104mc_fhl_is_special_socket (file_entry_t * fe) 
    120105{ 
    121 #if S_ISSOCK == 0 
    122     (void) fe; 
    123 #endif 
    124106    return S_ISSOCK (fe->st.st_mode); 
    125107} 
    126108 
    127109inline static gboolean 
    128110mc_fhl_is_special_fifo (file_entry_t * fe) 
    129111{ 
    130 #if S_ISFIFO == 0 
    131     (void) fe; 
    132 #endif 
    133112    return S_ISFIFO (fe->st.st_mode); 
    134113} 
    135114 
    136115inline static gboolean 
    137116mc_fhl_is_special_door (file_entry_t * fe) 
    138117{ 
    139 #if S_ISDOOR == 0 
    140     (void) fe; 
    141 #endif 
    142  
    143118    return S_ISDOOR (fe->st.st_mode); 
    144119} 
    145120 
    146  
    147121inline static gboolean 
    148122mc_fhl_is_special (file_entry_t * fe) 
    149123{