[Xfce4-commits] [xfce/xfce4-panel] 01/01: Add comments indicating intentional fall through
noreply at xfce.org
noreply at xfce.org
Wed Dec 5 22:25:28 CET 2018
This is an automated email from the git hooks/post-receive script.
a j b p u s h e d a c o m m i t t o b r a n c h m a s t e r
in repository xfce/xfce4-panel.
commit ea5d5b0929b1bc046a9f046642407e68a999171c
Author: Alistair Buxton <a.j.buxton at gmail.com>
Date: Tue Dec 4 22:24:12 2018 +0000
Add comments indicating intentional fall through
GCC 7 is actually smart enough to find these comments and disable
-Wimplicit-fallthrough so this silences some false positive warnings.
---
panel/panel-module.c | 4 +++-
panel/panel-tic-tac-toe.c | 3 +++
wrapper/main.c | 1 +
3 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/panel/panel-module.c b/panel/panel-module.c
index 76221ca..89e4d8f 100644
--- a/panel/panel-module.c
+++ b/panel/panel-module.c
@@ -490,7 +490,9 @@ panel_module_new_plugin (PanelModule *module,
}
/* fall-through (make wrapper plugin), probably a plugin with
- * preinit_func which is not supported for internal plugins */
+ * preinit_func which is not supported for internal plugins
+ * note: next comment tells GCC7 to ignore the fallthrough */
+ /* fall through */
case WRAPPER:
plugin = panel_plugin_external_wrapper_new (module, unique_id, arguments);
diff --git a/panel/panel-tic-tac-toe.c b/panel/panel-tic-tac-toe.c
index 9bd68de..9606ebd 100644
--- a/panel/panel-tic-tac-toe.c
+++ b/panel/panel-tic-tac-toe.c
@@ -459,17 +459,20 @@ panel_tic_tac_toe_get_move (gint state,
moves = panel_tic_tac_toe_best_opening (state, first_moves);
if (moves != 0)
break;
+ /* else fall through */
case LEVEL_INTERMEDIATE:
/* try to find a winning move */
moves = panel_tic_tac_toe_get_winner_move (state, PLAYER_X);
if (moves != 0)
break;
+ /* else fall through */
/* try to find a blocking move */
moves = panel_tic_tac_toe_get_winner_move (state, PLAYER_O);
if (moves != 0)
break;
+ /* else fall through */
case LEVEL_NOVICE:
moves = legal_moves;
diff --git a/wrapper/main.c b/wrapper/main.c
index 903c503..452e77c 100644
--- a/wrapper/main.c
+++ b/wrapper/main.c
@@ -129,6 +129,7 @@ wrapper_gproxy_set (XfcePanelPluginProvider *provider,
case PROVIDER_PROP_TYPE_ACTION_QUIT_FOR_RESTART:
retval = PLUGIN_EXIT_SUCCESS_AND_RESTART;
+ /* fall through */
case PROVIDER_PROP_TYPE_ACTION_QUIT:
gtk_main_quit ();
break;
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Xfce4-commits
mailing list