From 5a7b836ca7350cfee4da9d55c666a3294a6a665c Mon Sep 17 00:00:00 2001 From: Lorn Potter Date: Thu, 10 Feb 2022 06:32:21 +1000 Subject: [PATCH] wasm: make input callback returns consistent MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I43d9db1723d85eef69cfa2e51da4a6a640e8b3c5 Reviewed-by: David Skoland Reviewed-by: Morten Johan Sørvig --- src/plugins/platforms/wasm/qwasmcompositor.cpp | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/plugins/platforms/wasm/qwasmcompositor.cpp b/src/plugins/platforms/wasm/qwasmcompositor.cpp index 048dcfa2fc..f4284cc1cb 100644 --- a/src/plugins/platforms/wasm/qwasmcompositor.cpp +++ b/src/plugins/platforms/wasm/qwasmcompositor.cpp @@ -969,16 +969,13 @@ QOpenGLContext *QWasmCompositor::context() int QWasmCompositor::keyboard_cb(int eventType, const EmscriptenKeyboardEvent *keyEvent, void *userData) { QWasmCompositor *wasmCompositor = reinterpret_cast(userData); - bool accepted = wasmCompositor->processKeyboard(eventType, keyEvent); - - return accepted ? 1 : 0; + return static_cast(wasmCompositor->processKeyboard(eventType, keyEvent)); } int QWasmCompositor::mouse_cb(int eventType, const EmscriptenMouseEvent *mouseEvent, void *userData) { QWasmCompositor *compositor = (QWasmCompositor*)userData; - bool accepted = compositor->processMouse(eventType, mouseEvent); - return accepted; + return static_cast(compositor->processMouse(eventType, mouseEvent)); } int QWasmCompositor::focus_cb(int /*eventType*/, const EmscriptenFocusEvent */*focusEvent*/, void */*userData*/) @@ -989,14 +986,13 @@ int QWasmCompositor::focus_cb(int /*eventType*/, const EmscriptenFocusEvent */*f int QWasmCompositor::wheel_cb(int eventType, const EmscriptenWheelEvent *wheelEvent, void *userData) { QWasmCompositor *compositor = (QWasmCompositor *) userData; - bool accepted = compositor->processWheel(eventType, wheelEvent); - return accepted ? 1 : 0; + return static_cast(compositor->processWheel(eventType, wheelEvent)); } int QWasmCompositor::touchCallback(int eventType, const EmscriptenTouchEvent *touchEvent, void *userData) { auto compositor = reinterpret_cast(userData); - return compositor->handleTouch(eventType, touchEvent); + return static_cast(compositor->handleTouch(eventType, touchEvent)); } bool QWasmCompositor::processMouse(int eventType, const EmscriptenMouseEvent *mouseEvent)