From 678944ceb893148c5b1f145ed74213f4cec11c5f Mon Sep 17 00:00:00 2001 From: Vlad Zahorodnii Date: Wed, 29 Jul 2020 15:03:49 +0300 Subject: [PATCH] xwayland: Remove mysterious Q_FALLTHROUGH macros We cannot fall through to the next case because `reinterpret_cast`ing incompatible events is dangerous. --- xwl/selection.cpp | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/xwl/selection.cpp b/xwl/selection.cpp index cbcceed50a..51e817c17f 100644 --- a/xwl/selection.cpp +++ b/xwl/selection.cpp @@ -127,25 +127,13 @@ bool Selection::filterEvent(xcb_generic_event_t *event) { switch (event->response_type & XCB_EVENT_RESPONSE_TYPE_MASK) { case XCB_SELECTION_NOTIFY: - if (handleSelectionNotify(reinterpret_cast(event))) { - return true; - } - Q_FALLTHROUGH(); + return handleSelectionNotify(reinterpret_cast(event)); case XCB_PROPERTY_NOTIFY: - if (handlePropertyNotify(reinterpret_cast(event))) { - return true; - } - Q_FALLTHROUGH(); + return handlePropertyNotify(reinterpret_cast(event)); case XCB_SELECTION_REQUEST: - if (handleSelectionRequest(reinterpret_cast(event))) { - return true; - } - Q_FALLTHROUGH(); + return handleSelectionRequest(reinterpret_cast(event)); case XCB_CLIENT_MESSAGE: - if (handleClientMessage(reinterpret_cast(event))) { - return true; - } - Q_FALLTHROUGH(); + return handleClientMessage(reinterpret_cast(event)); default: return false; }