Fix the implicit-fallthrough stuff in code
authorKlaus Ethgen <Klaus@Ethgen.de>
Sun, 17 Sep 2017 14:53:47 +0000 (15:53 +0100)
committerKlaus Ethgen <Klaus@Ethgen.de>
Sun, 17 Sep 2017 14:53:47 +0000 (15:53 +0100)
First, this flag was not supported by older gcc.

And second and more important, there _was_ a bug with a lost break in
9643a2546bcc. Combined with a unreachable code segment.

configure.in
src/ui_bookmark.c
src/ui_pathsel.c
src/utilops.c

index 506debb..f9e76b9 100644 (file)
@@ -18,7 +18,7 @@ AC_PREREQ(2.57)
 AC_INIT([geeqie], m4_esyscmd_s(git rev-parse --quiet --verify --short HEAD), [geeqie-devel@lists.sourceforge.net], [], [http://www.geeqie.org/])
 
 # Add -Werror to the default CFLAGS
-CFLAGS+=" -Werror -Wno-error=deprecated-declarations -Wno-error=sign-compare -Wno-error=implicit-fallthrough -Wno-error=return-type"
+CFLAGS+=" -Werror -Wno-error=deprecated-declarations -Wno-error=sign-compare -Wno-error=return-type"
 
 # Check for rightly dirs
 AC_CONFIG_SRCDIR([src/main.c])
index 4afad63..91ee6ba 100644 (file)
@@ -450,6 +450,7 @@ static gboolean bookmark_keypress_cb(GtkWidget *button, GdkEventKey *event, gpoi
                {
                case GDK_KEY_F10:
                        if (!(event->state & GDK_CONTROL_MASK)) return FALSE;
+                       /* fall through */
                case GDK_KEY_Menu:
                        bookmark_menu_popup(bm, button, 0, event->time, TRUE);
                        return TRUE;
index ccd5249..73568cd 100644 (file)
@@ -698,6 +698,7 @@ static gboolean dest_keypress_cb(GtkWidget *view, GdkEventKey *event, gpointer d
                {
                case GDK_KEY_F10:
                        if (!(event->state & GDK_CONTROL_MASK)) return FALSE;
+                       /* fall through */
                case GDK_KEY_Menu:
                        dest_view_store_selection(dd, GTK_TREE_VIEW(view));
                        dest_popup_menu(dd, GTK_TREE_VIEW(view), 0, event->time, TRUE);
index f2d5ed0..8e40f11 100644 (file)
@@ -1106,6 +1106,7 @@ static void file_util_dest_folder_update_path(UtilityData *ud)
                {
                case UTILITY_TYPE_COPY:
                        file_data_sc_update_ci_copy_list(ud->flist, ud->dest_path);
+                       break;
                case UTILITY_TYPE_MOVE:
                        file_data_sc_update_ci_move_list(ud->flist, ud->dest_path);
                        break;
@@ -1845,8 +1846,6 @@ void file_util_dialog_run(UtilityData *ud)
                case UTILITY_PHASE_ENTERING:
                        file_util_check_ci(ud);
                        break;
-
-                       ud->phase = UTILITY_PHASE_CHECKED;
                case UTILITY_PHASE_CHECKED:
                        file_util_perform_ci(ud);
                        break;