Kaydet (Commit) fce58626 authored tarafından Matthew Brush's avatar Matthew Brush

Add 'fall through' comments and fix actual bug

To document when switch cases fall through intentionally, hiding the
warning by GCC at the same time.

Moved the break statement outside of the if conditional in keybindings.c
as I believe this was an actual bug found by GCC's warnings.
üst 1b5deea6
...@@ -284,10 +284,13 @@ static void parse_keyfile_style(GKeyFile *kf, gchar **list, ...@@ -284,10 +284,13 @@ static void parse_keyfile_style(GKeyFile *kf, gchar **list,
{ {
case 4: case 4:
style->italic = utils_atob(list[3]); style->italic = utils_atob(list[3]);
/* fall through */
case 3: case 3:
style->bold = utils_atob(list[2]); style->bold = utils_atob(list[2]);
/* fall through */
case 2: case 2:
parse_color(kf, list[1], &style->background); parse_color(kf, list[1], &style->background);
/* fall through */
case 1: case 1:
parse_color(kf, list[0], &style->foreground); parse_color(kf, list[0], &style->foreground);
} }
......
...@@ -2614,8 +2614,8 @@ static gboolean cb_func_document_action(guint key_id) ...@@ -2614,8 +2614,8 @@ static gboolean cb_func_document_action(guint key_id)
{ {
gint line = sci_get_current_line(doc->editor->sci); gint line = sci_get_current_line(doc->editor->sci);
editor_toggle_fold(doc->editor, line, 0); editor_toggle_fold(doc->editor, line, 0);
break;
} }
break;
case GEANY_KEYS_DOCUMENT_REMOVE_MARKERS: case GEANY_KEYS_DOCUMENT_REMOVE_MARKERS:
on_remove_markers1_activate(NULL, NULL); on_remove_markers1_activate(NULL, NULL);
break; break;
......
...@@ -1879,6 +1879,7 @@ static void search_finished(GPid child_pid, gint status, gpointer user_data) ...@@ -1879,6 +1879,7 @@ static void search_finished(GPid child_pid, gint status, gpointer user_data)
} }
case 1: case 1:
msg = _("No matches found."); msg = _("No matches found.");
/* fall through */
default: default:
msgwin_msg_add_string(COLOR_BLUE, -1, NULL, msg); msgwin_msg_add_string(COLOR_BLUE, -1, NULL, msg);
ui_set_statusbar(FALSE, "%s", msg); ui_set_statusbar(FALSE, "%s", msg);
......
...@@ -648,6 +648,7 @@ static void word_count(gchar *text, guint *chars, guint *lines, guint *words) ...@@ -648,6 +648,7 @@ static void word_count(gchar *text, guint *chars, guint *lines, guint *words)
{ {
case '\n': case '\n':
(*lines)++; (*lines)++;
/* fall through */
case '\r': case '\r':
case '\f': case '\f':
case '\t': case '\t':
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment