diff options
author | Max Kellermann <max@musicpd.org> | 2018-01-01 19:23:01 +0100 |
---|---|---|
committer | Max Kellermann <max@musicpd.org> | 2018-01-01 19:23:01 +0100 |
commit | e387d94ff1262425bb24a25513eb74195b814f3c (patch) | |
tree | cdf03d4ce500cf182fe265df6afc14f2e4787afb /src/filter | |
parent | 3bb9c704de1d0dffe0a3d3f3dac42e59299b4cf6 (diff) |
filter/Filter: add "noexcept"
Diffstat (limited to 'src/filter')
-rw-r--r-- | src/filter/Filter.hxx | 8 | ||||
-rw-r--r-- | src/filter/plugins/AutoConvertFilterPlugin.cxx | 2 | ||||
-rw-r--r-- | src/filter/plugins/ChainFilterPlugin.cxx | 10 | ||||
-rw-r--r-- | src/filter/plugins/ConvertFilterPlugin.cxx | 2 |
4 files changed, 12 insertions, 10 deletions
diff --git a/src/filter/Filter.hxx b/src/filter/Filter.hxx index 54646d86c..6af002adc 100644 --- a/src/filter/Filter.hxx +++ b/src/filter/Filter.hxx @@ -30,25 +30,25 @@ class Filter { protected: AudioFormat out_audio_format; - explicit Filter(AudioFormat _out_audio_format) + explicit Filter(AudioFormat _out_audio_format) noexcept :out_audio_format(_out_audio_format) { assert(out_audio_format.IsValid()); } public: - virtual ~Filter() {} + virtual ~Filter() noexcept {} /** * Returns the #AudioFormat produced by FilterPCM(). */ - const AudioFormat &GetOutAudioFormat() const { + const AudioFormat &GetOutAudioFormat() const noexcept { return out_audio_format; } /** * Reset the filter's state, e.g. drop/flush buffers. */ - virtual void Reset() { + virtual void Reset() noexcept { } /** diff --git a/src/filter/plugins/AutoConvertFilterPlugin.cxx b/src/filter/plugins/AutoConvertFilterPlugin.cxx index 6b9b8cc13..02d045d90 100644 --- a/src/filter/plugins/AutoConvertFilterPlugin.cxx +++ b/src/filter/plugins/AutoConvertFilterPlugin.cxx @@ -49,7 +49,7 @@ public: :Filter(_filter->GetOutAudioFormat()), filter(std::move(_filter)), convert(std::move(_convert)) {} - void Reset() override { + void Reset() noexcept override { filter->Reset(); if (convert) diff --git a/src/filter/plugins/ChainFilterPlugin.cxx b/src/filter/plugins/ChainFilterPlugin.cxx index e1b6d6c2b..6fa273729 100644 --- a/src/filter/plugins/ChainFilterPlugin.cxx +++ b/src/filter/plugins/ChainFilterPlugin.cxx @@ -36,7 +36,8 @@ class ChainFilter final : public Filter { const char *name; std::unique_ptr<Filter> filter; - Child(const char *_name, std::unique_ptr<Filter> _filter) + Child(const char *_name, + std::unique_ptr<Filter> _filter) noexcept :name(_name), filter(std::move(_filter)) {} }; @@ -46,7 +47,8 @@ public: explicit ChainFilter(AudioFormat _audio_format) :Filter(_audio_format) {} - void Append(const char *name, std::unique_ptr<Filter> filter) { + void Append(const char *name, + std::unique_ptr<Filter> filter) noexcept { assert(out_audio_format.IsValid()); out_audio_format = filter->GetOutAudioFormat(); assert(out_audio_format.IsValid()); @@ -55,7 +57,7 @@ public: } /* virtual methods from class Filter */ - void Reset() override; + void Reset() noexcept override; ConstBuffer<void> FilterPCM(ConstBuffer<void> src) override; }; @@ -114,7 +116,7 @@ PreparedChainFilter::Open(AudioFormat &in_audio_format) } void -ChainFilter::Reset() +ChainFilter::Reset() noexcept { for (auto &child : children) child.filter->Reset(); diff --git a/src/filter/plugins/ConvertFilterPlugin.cxx b/src/filter/plugins/ConvertFilterPlugin.cxx index 40da165cd..5e640aaa0 100644 --- a/src/filter/plugins/ConvertFilterPlugin.cxx +++ b/src/filter/plugins/ConvertFilterPlugin.cxx @@ -50,7 +50,7 @@ public: void Set(const AudioFormat &_out_audio_format); - void Reset() override { + void Reset() noexcept override { state.Reset(); } |