From 0730dce5abf5e43f8e3820a1d4e8754e61874a3d Mon Sep 17 00:00:00 2001 From: nicm Date: Mon, 18 Jan 2021 11:14:23 +0000 Subject: Hide some warnings on newer GCC versions, GitHUb issue 2525. --- window-copy.c | 37 +++++++++++++++++-------------------- 1 file changed, 17 insertions(+), 20 deletions(-) (limited to 'window-copy.c') diff --git a/window-copy.c b/window-copy.c index bfa94aed..889a536d 100644 --- a/window-copy.c +++ b/window-copy.c @@ -3453,10 +3453,10 @@ window_copy_synchronize_cursor_end(struct window_mode_entry *wme, int begin, struct window_copy_mode_data *data = wme->data; u_int xx, yy; + xx = data->cx; yy = screen_hsize(data->backing) + data->cy - data->oy; switch (data->selflag) { case SEL_WORD: - xx = data->cx; if (no_reset) break; begin = 0; @@ -3482,10 +3482,8 @@ window_copy_synchronize_cursor_end(struct window_mode_entry *wme, int begin, } break; case SEL_LINE: - if (no_reset) { - xx = data->cx; + if (no_reset) break; - } begin = 0; if (data->dy > yy) { /* Right to left selection. */ @@ -3505,7 +3503,6 @@ window_copy_synchronize_cursor_end(struct window_mode_entry *wme, int begin, } break; case SEL_CHAR: - xx = data->cx; break; } if (begin) { @@ -4784,22 +4781,22 @@ window_copy_start_drag(struct client *c, struct mouse_event *m) if (x < data->selrx || x > data->endselrx || yg != data->selry) data->selflag = SEL_CHAR; switch (data->selflag) { - case SEL_WORD: - if (data->ws != NULL) { - window_copy_update_cursor(wme, x, y); - window_copy_cursor_previous_word_pos(wme, - data->ws, 0, &x, &y); - y -= screen_hsize(data->backing) - data->oy; - } - window_copy_update_cursor(wme, x, y); - break; - case SEL_LINE: - window_copy_update_cursor(wme, 0, y); - break; - case SEL_CHAR: + case SEL_WORD: + if (data->ws != NULL) { window_copy_update_cursor(wme, x, y); - window_copy_start_selection(wme); - break; + window_copy_cursor_previous_word_pos(wme, data->ws, 0, + &x, &y); + y -= screen_hsize(data->backing) - data->oy; + } + window_copy_update_cursor(wme, x, y); + break; + case SEL_LINE: + window_copy_update_cursor(wme, 0, y); + break; + case SEL_CHAR: + window_copy_update_cursor(wme, x, y); + window_copy_start_selection(wme); + break; } window_copy_redraw_screen(wme); -- cgit