Ticket #4103: mc-4103-1-panel.c-fix-shadow-warning.patch

File mc-4103-1-panel.c-fix-shadow-warning.patch, 1.3 KB (added by and, 21 months ago)
  • src/filemanager/panel.c

    From 1444d26b4d6a6af780035b7d88640909c1ceb66e Mon Sep 17 00:00:00 2001
    From: Andreas Mohr <and@gmx.li>
    Date: Sun, 29 Nov 2020 11:28:47 +0000
    Subject: (panel.c) fix shadow warning
    
    Found by clang 11
    
    panel.c:2960:15: error: declaration shadows a local variable [-Werror,-Wshadow]
            char *p;
                  ^
    panel.c:2939:13: note: previous declaration is here
        WPanel *p;
                ^
    
    Signed-off-by: Andreas Mohr <and@gmx.li>
    ---
     src/filemanager/panel.c | 6 +++---
     1 file changed, 3 insertions(+), 3 deletions(-)
    
    diff --git a/src/filemanager/panel.c b/src/filemanager/panel.c
    index 75a3fda20..c4e11a9d8 100644
    a b chdir_to_readlink (WPanel * panel) 
    29362936    struct stat st; 
    29372937    vfs_path_t *panel_fname_vpath; 
    29382938    gboolean ok; 
    2939     WPanel *p; 
     2939    WPanel *cpanel; 
    29402940 
    29412941    if (get_other_type () != view_listing) 
    29422942        return; 
    chdir_to_readlink (WPanel * panel) 
    29752975    else 
    29762976        new_dir_vpath = vfs_path_append_new (panel->cwd_vpath, buffer, (char *) NULL); 
    29772977 
    2978     p = change_panel (); 
    2979     do_cd (p, new_dir_vpath, cd_exact); 
     2978    cpanel = change_panel (); 
     2979    do_cd (cpanel, new_dir_vpath, cd_exact); 
    29802980    vfs_path_free (new_dir_vpath); 
    29812981    (void) change_panel (); 
    29822982