From 1ac609f1ff80d3c98e32d925152e1b46f66caef8 Mon Sep 17 00:00:00 2001 From: cg2121 Date: Sun, 26 Feb 2023 23:41:56 -0600 Subject: [PATCH] UI, libobs: Fix not handled in switch warnings These warnings were being spit out by GCC on Linux. --- UI/qt-wrappers.cpp | 6 +++++- libobs/obs-nix.c | 2 ++ plugins/linux-v4l2/v4l2-decoder.c | 2 ++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/UI/qt-wrappers.cpp b/UI/qt-wrappers.cpp index 030ecbeae..b876a0dc4 100644 --- a/UI/qt-wrappers.cpp +++ b/UI/qt-wrappers.cpp @@ -135,14 +135,18 @@ bool QTToGSWindow(QWindow *window, gs_window &gswindow) gswindow.display = obs_get_nix_platform_display(); break; #ifdef ENABLE_WAYLAND - case OBS_NIX_PLATFORM_WAYLAND: + case OBS_NIX_PLATFORM_WAYLAND: { QPlatformNativeInterface *native = QGuiApplication::platformNativeInterface(); gswindow.display = native->nativeResourceForWindow("surface", window); success = gswindow.display != nullptr; break; + } #endif + default: + success = false; + break; } #endif return success; diff --git a/libobs/obs-nix.c b/libobs/obs-nix.c index 8b02bda2b..36aac7097 100644 --- a/libobs/obs-nix.c +++ b/libobs/obs-nix.c @@ -416,6 +416,8 @@ bool obs_hotkeys_platform_init(struct obs_core_hotkeys *hotkeys) hotkeys_vtable = obs_nix_wayland_get_hotkeys_vtable(); break; #endif + default: + break; } return hotkeys_vtable->init(hotkeys); diff --git a/plugins/linux-v4l2/v4l2-decoder.c b/plugins/linux-v4l2/v4l2-decoder.c index dc3db4fc2..f2fa23e98 100644 --- a/plugins/linux-v4l2/v4l2-decoder.c +++ b/plugins/linux-v4l2/v4l2-decoder.c @@ -116,6 +116,8 @@ int v4l2_decode_frame(struct obs_source_frame *out, uint8_t *data, case AV_PIX_FMT_YUV444P: out->format = VIDEO_FORMAT_I444; break; + default: + break; } return 0;