From aa9933c0b54d32ca31791240da2110b7b9baf95d Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Tue, 19 Oct 2021 08:58:47 +0200 Subject: [PATCH] output/pipewire: add `noexcept` --- src/mixer/plugins/PipeWireMixerPlugin.cxx | 4 ++-- src/output/plugins/PipeWireOutputPlugin.cxx | 18 +++++++++--------- src/output/plugins/PipeWireOutputPlugin.hxx | 4 ++-- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/mixer/plugins/PipeWireMixerPlugin.cxx b/src/mixer/plugins/PipeWireMixerPlugin.cxx index e8c95baee..7075d4a64 100644 --- a/src/mixer/plugins/PipeWireMixerPlugin.cxx +++ b/src/mixer/plugins/PipeWireMixerPlugin.cxx @@ -37,7 +37,7 @@ public: { } - ~PipeWireMixer() override; + ~PipeWireMixer() noexcept override; PipeWireMixer(const PipeWireMixer &) = delete; PipeWireMixer &operator=(const PipeWireMixer &) = delete; @@ -89,7 +89,7 @@ pipewire_mixer_init([[maybe_unused]] EventLoop &event_loop, AudioOutput &ao, return pm; } -PipeWireMixer::~PipeWireMixer() +PipeWireMixer::~PipeWireMixer() noexcept { pipewire_output_clear_mixer(output, *this); } diff --git a/src/output/plugins/PipeWireOutputPlugin.cxx b/src/output/plugins/PipeWireOutputPlugin.cxx index eedeeeb2a..ab9ecea4e 100644 --- a/src/output/plugins/PipeWireOutputPlugin.cxx +++ b/src/output/plugins/PipeWireOutputPlugin.cxx @@ -136,9 +136,9 @@ public: void SetVolume(float volume); - void SetMixer(PipeWireMixer &_mixer); + void SetMixer(PipeWireMixer &_mixer) noexcept; - void ClearMixer([[maybe_unused]] PipeWireMixer &old_mixer) { + void ClearMixer([[maybe_unused]] PipeWireMixer &old_mixer) noexcept { assert(mixer == &old_mixer); mixer = nullptr; @@ -178,7 +178,7 @@ private: o.Drained(); } - void ControlInfo(const struct pw_stream_control *control) { + void ControlInfo(const struct pw_stream_control *control) noexcept { float sum = 0; unsigned c; for (c = 0; c < control->n_values; c++) @@ -200,7 +200,7 @@ private: o.ControlInfo(control); } - void ParamChanged() { + void ParamChanged() noexcept { if (restore_volume) { SetVolume(volume); restore_volume = false; @@ -208,8 +208,8 @@ private: } static void ParamChanged(void *data, - uint32_t id, - const struct spa_pod *param) + uint32_t id, + const struct spa_pod *param) noexcept { if (id != SPA_PARAM_Format || param == NULL) return; @@ -643,7 +643,7 @@ PipeWireOutput::Pause() noexcept } inline void -PipeWireOutput::SetMixer(PipeWireMixer &_mixer) +PipeWireOutput::SetMixer(PipeWireMixer &_mixer) noexcept { assert(mixer == nullptr); @@ -653,13 +653,13 @@ PipeWireOutput::SetMixer(PipeWireMixer &_mixer) } void -pipewire_output_set_mixer(PipeWireOutput &po, PipeWireMixer &pm) +pipewire_output_set_mixer(PipeWireOutput &po, PipeWireMixer &pm) noexcept { po.SetMixer(pm); } void -pipewire_output_clear_mixer(PipeWireOutput &po, PipeWireMixer &pm) +pipewire_output_clear_mixer(PipeWireOutput &po, PipeWireMixer &pm) noexcept { po.ClearMixer(pm); } diff --git a/src/output/plugins/PipeWireOutputPlugin.hxx b/src/output/plugins/PipeWireOutputPlugin.hxx index 43125d767..15c5d122a 100644 --- a/src/output/plugins/PipeWireOutputPlugin.hxx +++ b/src/output/plugins/PipeWireOutputPlugin.hxx @@ -26,10 +26,10 @@ class PipeWireMixer; extern const struct AudioOutputPlugin pipewire_output_plugin; void -pipewire_output_set_mixer(PipeWireOutput &po, PipeWireMixer &pm); +pipewire_output_set_mixer(PipeWireOutput &po, PipeWireMixer &pm) noexcept; void -pipewire_output_clear_mixer(PipeWireOutput &po, PipeWireMixer &pm); +pipewire_output_clear_mixer(PipeWireOutput &po, PipeWireMixer &pm) noexcept; void pipewire_output_set_volume(PipeWireOutput &output, float volume);