diff options
| author | 2024-02-19 16:00:46 +0100 | |
|---|---|---|
| committer | 2024-02-19 16:00:46 +0100 | |
| commit | 310c1f50beb77fc5c6f9075029973161d4e51a4a (patch) | |
| tree | 43a5699123e4930560fc5016faac7efb15b63f4e /src/audio_core | |
| parent | core/CMakeLists: Sort alphabetically (diff) | |
| download | yuzu-310c1f50beb77fc5c6f9075029973161d4e51a4a.tar.gz yuzu-310c1f50beb77fc5c6f9075029973161d4e51a4a.tar.xz yuzu-310c1f50beb77fc5c6f9075029973161d4e51a4a.zip | |
scope_exit: Make constexpr
Allows the use of the macro in constexpr-contexts.
Also avoids some potential problems when nesting braces inside it.
Diffstat (limited to 'src/audio_core')
| -rw-r--r-- | src/audio_core/sink/cubeb_sink.cpp | 4 | ||||
| -rw-r--r-- | src/audio_core/sink/sink_stream.cpp | 4 |
2 files changed, 5 insertions, 3 deletions
diff --git a/src/audio_core/sink/cubeb_sink.cpp b/src/audio_core/sink/cubeb_sink.cpp index d97ca2a40..49efae8e3 100644 --- a/src/audio_core/sink/cubeb_sink.cpp +++ b/src/audio_core/sink/cubeb_sink.cpp | |||
| @@ -357,7 +357,9 @@ bool IsCubebSuitable() { | |||
| 357 | return false; | 357 | return false; |
| 358 | } | 358 | } |
| 359 | 359 | ||
| 360 | SCOPE_EXIT({ cubeb_destroy(ctx); }); | 360 | SCOPE_EXIT { |
| 361 | cubeb_destroy(ctx); | ||
| 362 | }; | ||
| 361 | 363 | ||
| 362 | #ifdef _WIN32 | 364 | #ifdef _WIN32 |
| 363 | if (SUCCEEDED(com_init_result)) { | 365 | if (SUCCEEDED(com_init_result)) { |
diff --git a/src/audio_core/sink/sink_stream.cpp b/src/audio_core/sink/sink_stream.cpp index c047b0668..0a98eb31e 100644 --- a/src/audio_core/sink/sink_stream.cpp +++ b/src/audio_core/sink/sink_stream.cpp | |||
| @@ -20,10 +20,10 @@ | |||
| 20 | namespace AudioCore::Sink { | 20 | namespace AudioCore::Sink { |
| 21 | 21 | ||
| 22 | void SinkStream::AppendBuffer(SinkBuffer& buffer, std::span<s16> samples) { | 22 | void SinkStream::AppendBuffer(SinkBuffer& buffer, std::span<s16> samples) { |
| 23 | SCOPE_EXIT({ | 23 | SCOPE_EXIT { |
| 24 | queue.enqueue(buffer); | 24 | queue.enqueue(buffer); |
| 25 | ++queued_buffers; | 25 | ++queued_buffers; |
| 26 | }); | 26 | }; |
| 27 | 27 | ||
| 28 | if (type == StreamType::In) { | 28 | if (type == StreamType::In) { |
| 29 | return; | 29 | return; |