Ticket #3547: mc-3547-cleanup-conversion-warning-chown_advanced_but.patch

File mc-3547-cleanup-conversion-warning-chown_advanced_but.patch, 1.8 KB (added by and, 6 years ago)
  • src/filemanager/achown.c

    fix -Wconversion warning at struct chown_advanced_but
    
    patch will fix these warnings:
    achown.c:480:10: warning: implicit conversion loses integer precision: 'unsigned long' to 'unsigned int' [-Wshorten-64-to-32]
    achown.c:687:28: warning: implicit conversion changes signedness: 'int' to 'button_flags_t' [-Wsign-conversion]
    achown.c:689:28: warning: implicit conversion changes signedness: 'int' to 'button_flags_t' [-Wsign-conversion]
    achown.c:691:28: warning: implicit conversion changes signedness: 'int' to 'button_flags_t' [-Wsign-conversion]
    achown.c:693:26: warning: implicit conversion changes signedness: 'int' to 'button_flags_t' [-Wsign-conversion]
    achown.c:695:27: warning: implicit conversion changes signedness: 'int' to 'button_flags_t' [-Wsign-conversion]
    achown.c:712:82: warning: implicit conversion changes signedness: 'int' to 'button_flags_t' [-Wsign-conversion]
    achown.c:718:82: warning: implicit conversion changes signedness: 'int' to 'button_flags_t' [-Wsign-conversion]
    achown.c:730:78: warning: implicit conversion changes signedness: 'int' to 'button_flags_t' [-Wsign-conversion]
    achown.c:736:78: warning: implicit conversion changes signedness: 'int' to 'button_flags_t' [-Wsign-conversion]
    
    patch against a5cd0093c5330ae6118cbf2830cf288dd4a68ed0
    compile test with gcc 4.6/4.9/5.2 and clang 3.7
    
    Signed-off-by: Andreas Mohr <and@gmx.li>
    
    a b  
    7979static struct 
    8080{ 
    8181    unsigned long id; 
    82     int ret_cmd, flags, x, len; 
     82    int ret_cmd, x, len; 
     83    button_flags_t flags; 
    8384    const char *text; 
    8485} chown_advanced_but[BUTTONS] = 
    8586{ 
     
    475476    WDialog *h = DIALOG (w); 
    476477    int i; 
    477478    int f_pos; 
    478     unsigned int id; 
     479    unsigned long id; 
    479480 
    480481    id = dlg_get_current_widget_id (h); 
    481482