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

File mc-3547-cleanup-conversion-warning-mode_t.patch, 3.4 KB (added by and, 6 years ago)
  • lib/vfs/direntry.c

    fix -Wconversion warning for mask/mode values
    
    use mode_t definition
    
    patch will fix following warnings:
    direntry.c:994:15: warning: implicit conversion changes signedness: '__mode_t' (aka 'unsigned int') to 'int' [-Wsign-conversion]
    direntry.c:995:12: warning: implicit conversion changes signedness: 'int' to '__mode_t' (aka 'unsigned int') [-Wsign-conversion]
    direntry.c:996:13: warning: implicit conversion changes signedness: 'int' to 'unsigned int' [-Wsign-conversion]
    interface.c:211:57: warning: implicit conversion changes signedness: 'int' to 'mode_t' (aka 'unsigned int') [-Wsign-conversion]
    file.c:1593:59: warning: implicit conversion changes signedness: 'int' to 'unsigned int' [-Wsign-conversion]
    file.c:1620:76: warning: implicit conversion changes signedness: 'int' to 'unsigned int' [-Wsign-conversion]
    file.c:1973:62: warning: implicit conversion changes signedness: 'int' to 'unsigned int' [-Wsign-conversion]
    file.c:1993:55: warning: implicit conversion changes signedness: 'int' to 'unsigned int' [-Wsign-conversion]
    file.c:2150:58: warning: implicit conversion changes signedness: 'int' to 'unsigned int' [-Wsign-conversion]
    file.c:2259:50: warning: implicit conversion changes signedness: 'int' to 'unsigned int' [-Wsign-conversion]
    file.c:2269:50: warning: implicit conversion changes signedness: 'int' to 'unsigned int' [-Wsign-conversion]
    filegui.c:1294:18: warning: implicit conversion changes signedness: '__mode_t' (aka 'unsigned int') to 'int' [-Wsign-conversion]
    filegui.c:1295:20: warning: implicit conversion changes signedness: 'int' to '__mode_t' (aka 'unsigned int') [-Wsign-conversion]
    usermenu.c:165:55: warning: implicit conversion changes signedness: '__mode_t' (aka 'unsigned int') to 'int' [-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  
    987987vfs_s_default_stat (struct vfs_class *me, mode_t mode) 
    988988{ 
    989989    static struct stat st; 
    990     int myumask; 
     990    mode_t myumask; 
    991991 
    992992    (void) me; 
    993993 
  • lib/vfs/interface.c

    a b  
    188188int 
    189189mc_open (const vfs_path_t * vpath, int flags, ...) 
    190190{ 
    191     int mode = 0, result = -1; 
     191    int result = -1; 
     192    mode_t mode = 0; 
    192193    const vfs_path_element_t *path_element; 
    193194 
    194195    if (vpath == NULL) 
     
    199200    { 
    200201        va_list ap; 
    201202        va_start (ap, flags); 
    202         mode = va_arg (ap, int); 
     203        mode = va_arg (ap, mode_t); 
    203204        va_end (ap); 
    204205    } 
    205206 
  • src/filemanager/filegui.c

    a b  
    12881288        } 
    12891289        else 
    12901290        { 
    1291             int i2; 
     1291            mode_t i2; 
    12921292 
    12931293            ctx->preserve = ctx->preserve_uidgid = FALSE; 
    12941294            i2 = umask (0); 
  • src/filemanager/fileopctx.h

    a b  
    129129    gboolean preserve_uidgid; 
    130130 
    131131    /* The bits to preserve in created files' modes on file copy */ 
    132     int umask_kill; 
     132    mode_t umask_kill; 
    133133 
    134134    /* The mask of files to actually operate on */ 
    135135    char *dest_mask; 
  • src/filemanager/usermenu.c

    a b  
    162162test_type (WPanel * panel, char *arg) 
    163163{ 
    164164    int result = 0;             /* False by default */ 
    165     int st_mode = panel->dir.list[panel->selected].st.st_mode; 
     165    mode_t st_mode = panel->dir.list[panel->selected].st.st_mode; 
    166166 
    167167    for (; *arg != 0; arg++) 
    168168    {