From bcc519e4eee3bc6b38d8c0da527a7b14eed7e125 Mon Sep 17 00:00:00 2001 From: Thomas Hindoe Paaboel Andersen Date: Tue, 12 Nov 2019 16:57:30 +0100 Subject: [PATCH] clutter: return correct enum type clutter_event_get_scroll_finish_flags() should return a ClutterScrollFinishFlags but due to what looks like a bad copy/paste it instead returns a ClutterScrollSource on asserts. The definitions of the enums are these: typedef enum { CLUTTER_SCROLL_SOURCE_UNKNOWN, CLUTTER_SCROLL_SOURCE_WHEEL, CLUTTER_SCROLL_SOURCE_FINGER, CLUTTER_SCROLL_SOURCE_CONTINUOUS } ClutterScrollSource; typedef enum { CLUTTER_SCROLL_FINISHED_NONE = 0, CLUTTER_SCROLL_FINISHED_HORIZONTAL = 1 << 0, CLUTTER_SCROLL_FINISHED_VERTICAL = 1 << 1 } ClutterScrollFinishFlags; The asserts would only return CLUTTER_SCROLL_SOURCE_UNKNOWN. This is equal to CLUTTER_SCROLL_FINISHED_NONE which this patch uses instead. Thus no functional change is intended. This only fixes a compile warning. https://gitlab.gnome.org/GNOME/mutter/merge_requests/931 --- clutter/clutter/clutter-event.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/clutter/clutter/clutter-event.c b/clutter/clutter/clutter-event.c index 975ba5707..9ccc0da1c 100644 --- a/clutter/clutter/clutter-event.c +++ b/clutter/clutter/clutter-event.c @@ -2161,9 +2161,9 @@ clutter_event_get_scroll_source (const ClutterEvent *event) ClutterScrollFinishFlags clutter_event_get_scroll_finish_flags (const ClutterEvent *event) { - g_return_val_if_fail (event != NULL, CLUTTER_SCROLL_SOURCE_UNKNOWN); + g_return_val_if_fail (event != NULL, CLUTTER_SCROLL_FINISHED_NONE); g_return_val_if_fail (event->type == CLUTTER_SCROLL, - CLUTTER_SCROLL_SOURCE_UNKNOWN); + CLUTTER_SCROLL_FINISHED_NONE); return event->scroll.finish_flags; }