[gtk/wip/otte/warnings: 1/6] 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: 1/6] Convert fallthrough comments to G_GNUC_FALLTHROUGH
- Date: Sat, 26 Jan 2019 14:20:24 +0000 (UTC)
commit 39d25dea741174838d3674389043abd4c65f6feb
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 911680fffd..bc3ada1ddb 100644
--- a/gdk/gdkframeclockidle.c
+++ b/gdk/gdkframeclockidle.c
@@ -399,7 +399,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)
{
@@ -410,7 +411,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)
{
@@ -440,7 +442,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)
{
@@ -460,7 +463,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)
{
@@ -475,7 +479,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 712115072a..6d1a27e52a 100644
--- a/gdk/win32/gdkevents-win32.c
+++ b/gdk/win32/gdkevents-win32.c
@@ -2818,8 +2818,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 ae71aa48a8..444d089e14 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 c9c378e0cf..2920506e2c 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 0ffc96f1e8..7edf1db6a0 100644
--- a/gtk/gtkfilechooserentry.c
+++ b/gtk/gtkfilechooserentry.c
@@ -603,7 +603,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 a26044b8cb..6e83c49ba8 100644
--- a/gtk/gtkmain.c
+++ b/gtk/gtkmain.c
@@ -1866,7 +1866,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 8c52b52012..9a2424cccf 100644
--- a/gtk/gtknotebook.c
+++ b/gtk/gtknotebook.c
@@ -2808,7 +2808,7 @@ update_arrow_nodes (GtkNotebook *notebook)
next_widget = priv->arrow_widget[1];
break;
}
- /* fall through */
+ G_GNUC_FALLTHROUGH;
case 1:
if (priv->children)
{
@@ -2821,14 +2821,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 bbdf7efb68..c85f7603e6 100644
--- a/gtk/gtktextview.c
+++ b/gtk/gtktextview.c
@@ -5862,7 +5862,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;
@@ -5872,7 +5872,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 b58610c341..37ff4b5671 100644
--- a/gtk/gtkwindow.c
+++ b/gtk/gtkwindow.c
@@ -1494,7 +1494,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 0385d15b07..e38f769cf2 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]