From 832cc8c2697115e19015296e6580e40641e12357 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Mon, 18 Nov 2019 11:18:48 +0100 Subject: [PATCH] term: assert(false) on MOUSE_X10 This mouse mode is never enabled. I.e. we don't support it. Add asserts to catch usage of it, should we ever decide to implement it. --- terminal.c | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/terminal.c b/terminal.c index ba625fc5..e11ca371 100644 --- a/terminal.c +++ b/terminal.c @@ -1321,12 +1321,16 @@ term_mouse_down(struct terminal *term, int button, int row, int col, case MOUSE_NONE: break; - case MOUSE_X10: case MOUSE_CLICK: case MOUSE_DRAG: case MOUSE_MOTION: report_mouse_click(term, encoded, row, col, false); break; + + case MOUSE_X10: + /* Never enabled */ + assert(false && "unimplemented"); + break; } } @@ -1359,12 +1363,16 @@ term_mouse_up(struct terminal *term, int button, int row, int col, case MOUSE_NONE: break; - case MOUSE_X10: case MOUSE_CLICK: case MOUSE_DRAG: case MOUSE_MOTION: report_mouse_click(term, encoded, row, col, true); break; + + case MOUSE_X10: + /* Never enabled */ + assert(false && "unimplemented"); + break; } } @@ -1396,7 +1404,6 @@ term_mouse_motion(struct terminal *term, int button, int row, int col, switch (term->mouse_tracking) { case MOUSE_NONE: - case MOUSE_X10: case MOUSE_CLICK: return; @@ -1408,6 +1415,11 @@ term_mouse_motion(struct terminal *term, int button, int row, int col, case MOUSE_MOTION: report_mouse_motion(term, encoded, row, col); break; + + case MOUSE_X10: + /* Never enabled */ + assert(false && "unimplemented"); + break; } }