Skip to content

Commit

Permalink
gtktextview: Add a missing g_assert_not_reached() for switch default
Browse files Browse the repository at this point in the history
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 <[email protected]>

https://bugzilla.gnome.org/show_bug.cgi?id=788787
  • Loading branch information
pwithnall committed Oct 11, 2017
1 parent 1c232ed commit 7e8831d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions gtk/gtktextview.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 7e8831d

Please sign in to comment.