Ticket #3539: mc-3539-fix-gcc46-warning.patch

File mc-3539-fix-gcc46-warning.patch, 1.9 KB (added by and, 8 years ago)
  • src/filemanager/dir.c

    fix reported -Wshadow warning with gcc 4.6.x (this not occur with gcc 4.7 or higher)
    
    ../../../src/filemanager/dir.c: In function ‘dir_list_grow’:
    ../../../src/filemanager/dir.c:263:14: warning: declaration of ‘clear’ shadows a global declaration [-Wshadow]
    
    ../../../src/viewer/datasource.c: In function ‘mcview_load_command_output’:
    ../../../src/viewer/datasource.c:398:16: warning: declaration of ‘pipe’ shadows a global declaration [-Wshadow]
    
    patch against 52fd328042a426e885da891c8ce8218cda3a1cf7
    compile test with GCC 4.6.4
    
    Signed-off-by: Andreas Mohr <and@gmx.li>
    
    a b  
    260260dir_list_grow (dir_list * list, int delta) 
    261261{ 
    262262    int size; 
    263     gboolean clear = FALSE; 
     263    gboolean clear_flag = FALSE; 
    264264 
    265265    if (list == NULL) 
    266266        return FALSE; 
     
    272272    if (size <= 0) 
    273273    { 
    274274        size = DIR_LIST_MIN_SIZE; 
    275         clear = TRUE; 
     275        clear_flag = TRUE; 
    276276    } 
    277277 
    278278    if (size != list->size) 
     
    287287        list->size = size; 
    288288    } 
    289289 
    290     list->len = clear ? 0 : min (list->len, size); 
     290    list->len = clear_flag ? 0 : min (list->len, size); 
    291291 
    292292    return TRUE; 
    293293} 
  • src/viewer/datasource.c

    a b  
    395395gboolean 
    396396mcview_load_command_output (mcview_t * view, const char *command) 
    397397{ 
    398     mc_pipe_t *pipe; 
     398    mc_pipe_t *pipe_flag; 
    399399    GError *error = NULL; 
    400400 
    401401    mcview_close_datasource (view); 
    402402 
    403     pipe = mc_popen (command, &error); 
    404     if (pipe == NULL) 
     403    pipe_flag = mc_popen (command, &error); 
     404    if (pipe_flag == NULL) 
    405405    { 
    406406        mcview_display (view); 
    407407        mcview_show_error (view, error->message); 
     
    410410    } 
    411411 
    412412    /* Check if filter produced any output */ 
    413     mcview_set_datasource_stdio_pipe (view, pipe); 
     413    mcview_set_datasource_stdio_pipe (view, pipe_flag); 
    414414    if (!mcview_get_byte (view, 0, NULL)) 
    415415    { 
    416416        mcview_close_datasource (view);