[gtk/wip/otte/warnings: 27/29] Convert fallthrough comments to G_GNUC_FALLTHROUGH
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip/otte/warnings: 27/29] Convert fallthrough comments to G_GNUC_FALLTHROUGH
- Date: Mon, 15 Apr 2019 12:41:02 +0000 (UTC)
commit 0791924bf7224825e213031727e4e2253aa4ebbc
Author: Benjamin Otte <otte redhat com>
Date: Sat Jan 26 15:05:06 2019 +0100
Convert fallthrough comments to G_GNUC_FALLTHROUGH
This way it's very obvious that fallthrough is indeed what we want.
Also bump the glib requirement to 2.59 which introduced
G_GNUC_FALLTHROUGH.
gdk/gdkframeclockidle.c | 15 ++++++++++-----
gdk/win32/gdkevents-win32.c | 2 +-
gdk/x11/gdkdevicemanager-core-x11.c | 2 +-
gtk/gtkcombobox.c | 4 ++--
gtk/gtkcssdimensionvalue.c | 2 +-
gtk/gtkfilechooserentry.c | 2 +-
gtk/gtkmain.c | 3 ++-
gtk/gtknotebook.c | 6 +++---
gtk/gtktextview.c | 4 ++--
gtk/gtkwindow.c | 2 +-
meson.build | 2 +-
11 files changed, 25 insertions(+), 19 deletions(-)
---
diff --git a/gdk/gdkframeclockidle.c b/gdk/gdkframeclockidle.c
index 0e9bc3b1b7..5a72624d76 100644
--- a/gdk/gdkframeclockidle.c
+++ b/gdk/gdkframeclockidle.c
@@ -386,7 +386,8 @@ gdk_frame_clock_paint_idle (void *data)
_gdk_frame_clock_emit_before_paint (clock);
priv->phase = GDK_FRAME_CLOCK_PHASE_UPDATE;
}
- /* fallthrough */
+ G_GNUC_FALLTHROUGH;
+
case GDK_FRAME_CLOCK_PHASE_UPDATE:
if (priv->freeze_count == 0)
{
@@ -397,7 +398,8 @@ gdk_frame_clock_paint_idle (void *data)
_gdk_frame_clock_emit_update (clock);
}
}
- /* fallthrough */
+ G_GNUC_FALLTHROUGH;
+
case GDK_FRAME_CLOCK_PHASE_LAYOUT:
if (priv->freeze_count == 0)
{
@@ -427,7 +429,8 @@ gdk_frame_clock_paint_idle (void *data)
if (iter == 5)
g_warning ("gdk-frame-clock: layout continuously requested, giving up after 4 tries");
}
- /* fallthrough */
+ G_GNUC_FALLTHROUGH;
+
case GDK_FRAME_CLOCK_PHASE_PAINT:
if (priv->freeze_count == 0)
{
@@ -447,7 +450,8 @@ gdk_frame_clock_paint_idle (void *data)
_gdk_frame_clock_emit_paint (clock);
}
}
- /* fallthrough */
+ G_GNUC_FALLTHROUGH;
+
case GDK_FRAME_CLOCK_PHASE_AFTER_PAINT:
if (priv->freeze_count == 0)
{
@@ -462,7 +466,8 @@ gdk_frame_clock_paint_idle (void *data)
timings->frame_end_time = g_get_monotonic_time ();
#endif /* G_ENABLE_DEBUG */
}
- /* fallthrough */
+ G_GNUC_FALLTHROUGH;
+
case GDK_FRAME_CLOCK_PHASE_RESUME_EVENTS:
default:
;
diff --git a/gdk/win32/gdkevents-win32.c b/gdk/win32/gdkevents-win32.c
index 4e4b3aaef8..5e1910534c 100644
--- a/gdk/win32/gdkevents-win32.c
+++ b/gdk/win32/gdkevents-win32.c
@@ -2830,8 +2830,8 @@ gdk_event_translate (MSG *msg,
{
generate_grab_broken_event (_gdk_device_manager, keyboard_grab->surface, TRUE, NULL);
}
+ G_GNUC_FALLTHROUGH;
- /* fallthrough */
case WM_SETFOCUS:
if (keyboard_grab != NULL &&
!keyboard_grab->owner_events)
diff --git a/gdk/x11/gdkdevicemanager-core-x11.c b/gdk/x11/gdkdevicemanager-core-x11.c
index 305bec3d6f..280510efdc 100644
--- a/gdk/x11/gdkdevicemanager-core-x11.c
+++ b/gdk/x11/gdkdevicemanager-core-x11.c
@@ -775,8 +775,8 @@ _gdk_device_manager_core_handle_focus (GdkSurface *surface,
#endif /* XINPUT_2 */
mode != NotifyUngrab)
toplevel->has_pointer_focus = (focus_in) ? FALSE : TRUE;
+ G_GNUC_FALLTHROUGH;
- /* fall through */
case NotifyNonlinear:
case NotifyNonlinearVirtual:
if (mode != NotifyGrab &&
diff --git a/gtk/gtkcombobox.c b/gtk/gtkcombobox.c
index 2ddac29f0b..70963db2f2 100644
--- a/gtk/gtkcombobox.c
+++ b/gtk/gtkcombobox.c
@@ -2238,7 +2238,7 @@ gtk_combo_box_real_move_active (GtkComboBox *combo_box,
&iter, &new_iter);
break;
}
- /* else fall through */
+ G_GNUC_FALLTHROUGH;
case GTK_SCROLL_PAGE_FORWARD:
case GTK_SCROLL_PAGE_DOWN:
@@ -2256,7 +2256,7 @@ gtk_combo_box_real_move_active (GtkComboBox *combo_box,
&iter, &new_iter);
break;
}
- /* else fall through */
+ G_GNUC_FALLTHROUGH;
case GTK_SCROLL_PAGE_BACKWARD:
case GTK_SCROLL_PAGE_UP:
diff --git a/gtk/gtkcssdimensionvalue.c b/gtk/gtkcssdimensionvalue.c
index feaaf9a991..0e423e43b4 100644
--- a/gtk/gtkcssdimensionvalue.c
+++ b/gtk/gtkcssdimensionvalue.c
@@ -104,7 +104,7 @@ gtk_css_value_dimension_compute (GtkCssValue *number,
{
default:
g_assert_not_reached();
- /* fall through */
+ G_GNUC_FALLTHROUGH;
case GTK_CSS_PERCENT:
/* percentages for font sizes are computed, other percentages aren't */
if (property_id == GTK_CSS_PROPERTY_FONT_SIZE)
diff --git a/gtk/gtkfilechooserentry.c b/gtk/gtkfilechooserentry.c
index 7175ccb77d..6d016863b1 100644
--- a/gtk/gtkfilechooserentry.c
+++ b/gtk/gtkfilechooserentry.c
@@ -605,7 +605,7 @@ completion_store_set (GtkFileSystemModel *model,
{
case FULL_PATH_COLUMN:
prefix = chooser_entry->dir_part;
- /* fall through */
+ G_GNUC_FALLTHROUGH;
case DISPLAY_NAME_COLUMN:
if (_gtk_file_info_consider_as_directory (info))
suffix = G_DIR_SEPARATOR_S;
diff --git a/gtk/gtkmain.c b/gtk/gtkmain.c
index bf58cb9453..2960f878e3 100644
--- a/gtk/gtkmain.c
+++ b/gtk/gtkmain.c
@@ -1981,7 +1981,8 @@ gtk_main_do_event (GdkEvent *event)
gtk_window_set_mnemonics_visible (GTK_WINDOW (window), FALSE);
}
}
- /* else fall through */
+ G_GNUC_FALLTHROUGH;
+
case GDK_SCROLL:
case GDK_BUTTON_PRESS:
case GDK_TOUCH_BEGIN:
diff --git a/gtk/gtknotebook.c b/gtk/gtknotebook.c
index 0b1d8f7391..05b5b5ad89 100644
--- a/gtk/gtknotebook.c
+++ b/gtk/gtknotebook.c
@@ -3027,7 +3027,7 @@ update_arrow_nodes (GtkNotebook *notebook)
next_widget = priv->arrow_widget[1];
break;
}
- /* fall through */
+ G_GNUC_FALLTHROUGH;
case 1:
if (priv->children)
{
@@ -3040,14 +3040,14 @@ update_arrow_nodes (GtkNotebook *notebook)
next_widget = priv->arrow_widget[2];
break;
}
- /* fall through */
+ G_GNUC_FALLTHROUGH;
case 2:
if (priv->arrow_widget[3])
{
next_widget = priv->arrow_widget[3];
break;
}
- /* fall through */
+ G_GNUC_FALLTHROUGH;
case 3:
next_widget = NULL;
break;
diff --git a/gtk/gtktextview.c b/gtk/gtktextview.c
index b0fb9880fc..8eff8f634f 100644
--- a/gtk/gtktextview.c
+++ b/gtk/gtktextview.c
@@ -5861,7 +5861,7 @@ gtk_text_view_move_cursor (GtkTextView *text_view,
{
case GTK_MOVEMENT_VISUAL_POSITIONS:
leave_direction = count > 0 ? GTK_DIR_RIGHT : GTK_DIR_LEFT;
- /* fall through */
+ G_GNUC_FALLTHROUGH;
case GTK_MOVEMENT_LOGICAL_POSITIONS:
case GTK_MOVEMENT_WORDS:
scroll_step = GTK_SCROLL_HORIZONTAL_STEPS;
@@ -5871,7 +5871,7 @@ gtk_text_view_move_cursor (GtkTextView *text_view,
break;
case GTK_MOVEMENT_DISPLAY_LINES:
leave_direction = count > 0 ? GTK_DIR_DOWN : GTK_DIR_UP;
- /* fall through */
+ G_GNUC_FALLTHROUGH;
case GTK_MOVEMENT_PARAGRAPHS:
case GTK_MOVEMENT_PARAGRAPH_ENDS:
scroll_step = GTK_SCROLL_STEPS;
diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c
index ce1ab54dc0..936457692c 100644
--- a/gtk/gtkwindow.c
+++ b/gtk/gtkwindow.c
@@ -1434,7 +1434,7 @@ multipress_gesture_pressed_cb (GtkGestureMultiPress *gesture,
sequence, GTK_EVENT_SEQUENCE_DENIED);
return;
}
- /* fall through */
+ G_GNUC_FALLTHROUGH;
case GTK_WINDOW_REGION_TITLE:
if (n_press == 2)
diff --git a/meson.build b/meson.build
index 711b1cbbaa..9ef5483912 100644
--- a/meson.build
+++ b/meson.build
@@ -11,7 +11,7 @@ project('gtk', 'c',
license: 'LGPLv2.1+')
glib_major_req = 2
-glib_minor_req = 55
+glib_minor_req = 59
glib_micro_req = 0
if glib_minor_req.is_odd()
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]