From 7e8831d66890a425d1b4a02fab32aae7b01031dd Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Tue, 10 Oct 2017 18:29:36 +0100 Subject: [PATCH] gtktextview: Add a missing g_assert_not_reached() for switch default MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Clarifies the code and helps catch invalid enum values before they propagate further. Also add a comment about why two seemingly legitimate values are not handled there (they’re handled higher up in the file). Coverity CID: 1457700 Signed-off-by: Philip Withnall https://bugzilla.gnome.org/show_bug.cgi?id=788787 --- gtk/gtktextview.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/gtk/gtktextview.c b/gtk/gtktextview.c index 64c4cfdb61..2ea2e85160 100644 --- a/gtk/gtktextview.c +++ b/gtk/gtktextview.c @@ -6559,7 +6559,9 @@ gtk_text_view_move_cursor (GtkTextView *text_view, case GTK_MOVEMENT_PAGES: case GTK_MOVEMENT_HORIZONTAL_PAGES: + /* We handle these cases above and return early from them. */ default: + g_assert_not_reached (); break; }