Ticket #3435: mc-cleanup-clang-warnings-03.patch

File mc-cleanup-clang-warnings-03.patch, 788 bytes (added by and, 9 years ago)
  • lib/timefmt.c

    fix clang 3.6 compiler warnings
    
    patch 01: -Wundef
    patch 02: -Wunused-function
    patch 03: -Wnon-literal-null-conversion
    patch 04: -Wmissing-field-initializers
    patch 05: -Wabsolute-value
    patch 06: -Wtautological-pointer-compare
    patch 07: -Wformat
    
    timefmt.c:123:33: error: expression which evaluates to zero treated as a null pointer constant of type 'time_t *' (aka 'long *') [-Wnon-literal-null-conversion]
    
    Signed-off-by: Andreas Mohr <and@gmx.li>
    
    a b  
    120120file_date (time_t when) 
    121121{ 
    122122    static char timebuf[MB_LEN_MAX * MAX_I18NTIMELENGTH + 1]; 
    123     time_t current_time = time ((time_t) 0); 
     123    time_t current_time = time (NULL); 
    124124    const char *fmt; 
    125125 
    126126    if (current_time > when + 6L * 30L * 24L * 60L * 60L        /* Old. */