[gtk+] gtktextview: Add a missing g_assert_not_reached() for switch default



commit 7e8831d66890a425d1b4a02fab32aae7b01031dd
Author: Philip Withnall <withnall endlessm com>
Date:   Tue Oct 10 18:29:36 2017 +0100

    gtktextview: Add a missing g_assert_not_reached() for switch default
    
    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 <withnall endlessm com>
    
    https://bugzilla.gnome.org/show_bug.cgi?id=788787

 gtk/gtktextview.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
---
diff --git a/gtk/gtktextview.c b/gtk/gtktextview.c
index 64c4cfd..2ea2e85 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;
     }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]