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

File mc-3547-cleanup-conversion-warning-chmod_but.patch, 3.2 KB (added by and, 8 years ago)
  • src/filemanager/chmod.c

    fix -Wconversion warning at struct chmod_but
    
    patch will fix these warnings:
    chmod.c:245:41: warning: implicit conversion changes signedness: 'unsigned int' to 'int' [-Wsign-conversion]
    chmod.c:266:41: warning: implicit conversion changes signedness: 'unsigned int' to 'int' [-Wsign-conversion]
    chmod.c:321:49: warning: implicit conversion changes signedness: 'unsigned int' to 'int' [-Wsign-conversion]
    chmod.c:352:72: warning: implicit conversion changes signedness: 'int' to 'button_flags_t' [-Wsign-conversion]
    chmod.c:357:72: warning: implicit conversion changes signedness: 'int' to 'button_flags_t' [-Wsign-conversion]
    chmod.c:367:42: warning: implicit conversion changes signedness: 'int' to 'button_flags_t' [-Wsign-conversion]
    chmod.c:371:42: 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  
    9494    /* *INDENT-ON* */ 
    9595}; 
    9696 
    97 static const unsigned int check_perm_num = G_N_ELEMENTS (check_perm); 
     97static const int check_perm_num = G_N_ELEMENTS (check_perm); 
    9898static int check_perm_len = 0; 
    9999 
    100100static const char *file_info_labels[] = { 
     
    104104    N_("Group name:") 
    105105}; 
    106106 
    107 static const unsigned int file_info_labels_num = G_N_ELEMENTS (file_info_labels); 
     107static const int file_info_labels_num = G_N_ELEMENTS (file_info_labels); 
    108108static int file_info_labels_len = 0; 
    109109 
    110110static struct 
    111111{ 
    112112    int ret_cmd; 
    113     int flags; 
     113    button_flags_t flags; 
    114114    int y;                      /* vertical position relatively to dialog bottom boundary */ 
    115115    int len; 
    116116    const char *text; 
     
    126126    /* *INDENT-ON* */ 
    127127}; 
    128128 
    129 static const unsigned int chmod_but_num = G_N_ELEMENTS (chmod_but); 
     129static const int chmod_but_num = G_N_ELEMENTS (chmod_but); 
    130130 
    131131/* --------------------------------------------------------------------------------------------- */ 
    132132/*** file scope functions ************************************************************************/ 
     
    136136chmod_i18n (void) 
    137137{ 
    138138    static gboolean i18n = FALSE; 
    139     unsigned int i; 
    140     int len; 
     139    int i, len; 
    141140 
    142141    if (i18n) 
    143142        return; 
     
    224223    case MSG_ACTION: 
    225224        { 
    226225            /* handle checkboxes */ 
    227             unsigned int i; 
     226            int i; 
    228227 
    229228            /* close dialog due to SIGINT (ctrl-g) */ 
    230229            if (sender == NULL && parm == CK_Cancel) 
     
    253252    case MSG_KEY: 
    254253        if (parm == 'T' || parm == 't' || parm == KEY_IC) 
    255254        { 
    256             unsigned int i; 
     255            int i; 
    257256            unsigned long id; 
    258257 
    259258            id = dlg_get_current_widget_id (h); 
     
    287286{ 
    288287    WDialog *ch_dlg; 
    289288    int lines, cols; 
    290     int y; 
     289    int i, y; 
    291290    int perm_gb_len; 
    292291    int file_gb_len; 
    293     unsigned int i; 
    294292    const char *c_fname, *c_fown, *c_fgrp; 
    295293    char buffer[BUF_TINY]; 
    296294 
     
    460458        WDialog *ch_dlg; 
    461459        struct stat sf_stat; 
    462460        char *fname; 
    463         int result; 
    464         unsigned int i; 
     461        int i, result; 
    465462 
    466463        do_refresh (); 
    467464