Ticket #4179: mc-4179-editdraw.c-fix-deadcode.deadstores-warning.patch

File mc-4179-editdraw.c-fix-deadcode.deadstores-warning.patch, 1.6 KB (added by and, 3 years ago)
  • src/editor/editdraw.c

    From d40f3d89e780f60556c8fd0a0cd24e3a13e435ee Mon Sep 17 00:00:00 2001
    From: Andreas Mohr <and@gmx.li>
    Date: Tue, 18 May 2021 17:54:12 +0000
    Subject: [PATCH] (editdraw.c) fix deadcode.DeadStores warning
    
    editdraw.c:536:5: warning: Value stored to 'color' is never read [deadcode.DeadStores]
        color = edit_get_syntax_color (edit, b - 1);
        ^       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    Found by Clang-11 analyzer
    
    Signed-off-by: Andreas Mohr <and@gmx.li>
    ---
     src/editor/editdraw.c | 4 ++--
     1 file changed, 2 insertions(+), 2 deletions(-)
    
    diff --git a/src/editor/editdraw.c b/src/editor/editdraw.c
    index 521c2e63a..015fa66e9 100644
    a b edit_draw_this_line (WEdit * edit, off_t b, long row, long start_col, long end_c 
    507507    line_s *p = line; 
    508508    off_t q; 
    509509    int col, start_col_real; 
    510     int color; 
    511510    int abn_style; 
    512511    int book_mark = 0; 
    513512    char line_stat[LINE_STATE_WIDTH + 1] = "\0"; 
    edit_draw_this_line (WEdit * edit, off_t b, long row, long start_col, long end_c 
    533532            end_col--; 
    534533    } 
    535534 
    536     color = edit_get_syntax_color (edit, b - 1); 
    537535    q = edit_move_forward3 (edit, b, start_col - edit->start_col, 0); 
    538536    col = (int) edit_move_forward3 (edit, b, 0, q); 
    539537    start_col_real = col + edit->start_col; 
    edit_draw_this_line (WEdit * edit, off_t b, long row, long start_col, long end_c 
    623621                    p->style |= book_mark << 16; 
    624622                else 
    625623                { 
     624                    int color; 
     625 
    626626                    color = edit_get_syntax_color (edit, q); 
    627627                    p->style |= color << 16; 
    628628                }