From 61bbc658069d3ca90ca97f0347be74c082fb17e7 Mon Sep 17 00:00:00 2001 From: Martin Pulec Date: Mon, 29 Jul 2024 11:48:34 +0200 Subject: [PATCH] wasapi: suppress warnings Suppress warnings for missing braces: src/audio/capture/wasapi.cpp:61:41: warning: suggest braces around initialization of subobject [-Wmissing-braces] 61 | const GUID KSDATAFORMAT_SUBTYPE_PCM = { STATIC_KSDATAFORMAT_SUBTYPE_PCM }; The macro is actually defined with Mingw-w64. --- src/audio/capture/wasapi.cpp | 3 +++ src/audio/playback/wasapi.cpp | 3 +++ 2 files changed, 6 insertions(+) diff --git a/src/audio/capture/wasapi.cpp b/src/audio/capture/wasapi.cpp index 7329f29c06..91afb72a3f 100644 --- a/src/audio/capture/wasapi.cpp +++ b/src/audio/capture/wasapi.cpp @@ -58,8 +58,11 @@ const IID IID_IAudioCaptureClient = __uuidof(IAudioCaptureClient); const static GUID IDevice_FriendlyName = { 0xa45c254e, 0xdf1c, 0x4efd, { 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0 } }; const static PROPERTYKEY PKEY_Device_FriendlyName = { IDevice_FriendlyName, 14 }; +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wmissing-braces" // not our issue - defined by Mingw-w64 const GUID KSDATAFORMAT_SUBTYPE_PCM = { STATIC_KSDATAFORMAT_SUBTYPE_PCM }; const GUID KSDATAFORMAT_SUBTYPE_IEEE_FLOAT = { STATIC_KSDATAFORMAT_SUBTYPE_IEEE_FLOAT }; +#pragma GCC diagnostic pop using std::cout; using std::ostringstream; diff --git a/src/audio/playback/wasapi.cpp b/src/audio/playback/wasapi.cpp index b454db1067..f65eeb926c 100644 --- a/src/audio/playback/wasapi.cpp +++ b/src/audio/playback/wasapi.cpp @@ -61,7 +61,10 @@ const IID IID_IAudioClient = __uuidof(IAudioClient); const IID IID_IAudioRenderClient = __uuidof(IAudioRenderClient); const static GUID IDevice_FriendlyName = { 0xa45c254e, 0xdf1c, 0x4efd, { 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0 } }; const static PROPERTYKEY PKEY_Device_FriendlyName = { IDevice_FriendlyName, 14 }; +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wmissing-braces" // not our issue - defined by Mingw-w64 const static GUID UG_KSDATAFORMAT_SUBTYPE_PCM = { STATIC_KSDATAFORMAT_SUBTYPE_PCM }; +#pragma GCC diagnostic pop using std::cout;