[geany/geany] fce586: Add 'fall through' comments and fix actual bug

Matthew Brush git-noreply at xxxxx
Fri Jan 12 22:09:38 UTC 2018


Branch:      refs/heads/master
Author:      Matthew Brush <matt at geany.org>
Committer:   Matthew Brush <matt at geany.org>
Date:        Thu, 21 Dec 2017 01:22:51 UTC
Commit:      fce58626b1605981655090fcea06824f29aaa823
             https://github.com/geany/geany/commit/fce58626b1605981655090fcea06824f29aaa823

Log Message:
-----------
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.


Modified Paths:
--------------
    src/highlighting.c
    src/keybindings.c
    src/search.c
    src/tools.c

Modified: src/highlighting.c
3 lines changed, 3 insertions(+), 0 deletions(-)
===================================================================
@@ -284,10 +284,13 @@ static void parse_keyfile_style(GKeyFile *kf, gchar **list,
 	{
 		case 4:
 			style->italic = utils_atob(list[3]);
+			/* fall through */
 		case 3:
 			style->bold = utils_atob(list[2]);
+			/* fall through */
 		case 2:
 			parse_color(kf, list[1], &style->background);
+			/* fall through */
 		case 1:
 			parse_color(kf, list[0], &style->foreground);
 	}


Modified: src/keybindings.c
2 lines changed, 1 insertions(+), 1 deletions(-)
===================================================================
@@ -2614,8 +2614,8 @@ static gboolean cb_func_document_action(guint key_id)
 			{
 				gint line = sci_get_current_line(doc->editor->sci);
 				editor_toggle_fold(doc->editor, line, 0);
-				break;
 			}
+			break;
 		case GEANY_KEYS_DOCUMENT_REMOVE_MARKERS:
 			on_remove_markers1_activate(NULL, NULL);
 			break;


Modified: src/search.c
1 lines changed, 1 insertions(+), 0 deletions(-)
===================================================================
@@ -1879,6 +1879,7 @@ static void search_finished(GPid child_pid, gint status, gpointer user_data)
 		}
 		case 1:
 			msg = _("No matches found.");
+			/* fall through */
 		default:
 			msgwin_msg_add_string(COLOR_BLUE, -1, NULL, msg);
 			ui_set_statusbar(FALSE, "%s", msg);


Modified: src/tools.c
1 lines changed, 1 insertions(+), 0 deletions(-)
===================================================================
@@ -648,6 +648,7 @@ static void word_count(gchar *text, guint *chars, guint *lines, guint *words)
 		{
 			case '\n':
 				(*lines)++;
+				/* fall through */
 			case '\r':
 			case '\f':
 			case '\t':



--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).


More information about the Commits mailing list