diff options
author | Max Kellermann <max@musicpd.org> | 2020-09-21 11:42:07 +0200 |
---|---|---|
committer | Max Kellermann <max@musicpd.org> | 2020-09-21 11:43:18 +0200 |
commit | 07e524509f4623e0859eb869b13833344b49fbc5 (patch) | |
tree | afc2e2984e28d321232796fd16cc045db3383b33 | |
parent | 2c05752071cd3d6e7939de6590eafe02ff9e09f5 (diff) |
input/Plugin: add `noexcept`
-rw-r--r-- | src/input/InputPlugin.cxx | 3 | ||||
-rw-r--r-- | src/input/InputPlugin.hxx | 7 | ||||
-rw-r--r-- | src/input/plugins/CurlInputPlugin.cxx | 3 | ||||
-rw-r--r-- | src/input/plugins/FfmpegInputPlugin.cxx | 3 | ||||
-rw-r--r-- | src/input/plugins/QobuzInputPlugin.cxx | 2 | ||||
-rw-r--r-- | src/input/plugins/TidalInputPlugin.cxx | 2 |
6 files changed, 12 insertions, 8 deletions
diff --git a/src/input/InputPlugin.cxx b/src/input/InputPlugin.cxx index a1070a58d..514f72aa9 100644 --- a/src/input/InputPlugin.cxx +++ b/src/input/InputPlugin.cxx @@ -63,7 +63,8 @@ constexpr static const char *whitelist[] = { }; bool -protocol_is_whitelisted(const char *proto) { +protocol_is_whitelisted(const char *proto) noexcept +{ auto begin = std::begin(whitelist); auto end = std::end(whitelist); return std::binary_search(begin, end, proto, [](const char* a, const char* b) { diff --git a/src/input/InputPlugin.hxx b/src/input/InputPlugin.hxx index 5a0dbe9a3..e4bc3bec6 100644 --- a/src/input/InputPlugin.hxx +++ b/src/input/InputPlugin.hxx @@ -56,7 +56,7 @@ struct InputPlugin { * Global deinitialization. Called once before MPD shuts * down (only if init() has returned true). */ - void (*finish)(); + void (*finish)() noexcept; /** * Attempt to open the given URI. Returns nullptr if the @@ -69,7 +69,7 @@ struct InputPlugin { /** * return a set of supported protocols */ - std::set<std::string> (*protocols)(); + std::set<std::string> (*protocols)() noexcept; /** * Prepare a #RemoteTagScanner. The operation must be started @@ -103,7 +103,8 @@ struct InputPlugin { } }; +gcc_pure bool -protocol_is_whitelisted(const char *proto); +protocol_is_whitelisted(const char *proto) noexcept; #endif diff --git a/src/input/plugins/CurlInputPlugin.cxx b/src/input/plugins/CurlInputPlugin.cxx index 60d3df8c1..3cdab5653 100644 --- a/src/input/plugins/CurlInputPlugin.cxx +++ b/src/input/plugins/CurlInputPlugin.cxx @@ -516,7 +516,8 @@ input_curl_open(const char *url, Mutex &mutex) } static std::set<std::string> -input_curl_protocols() { +input_curl_protocols() noexcept +{ std::set<std::string> protocols; auto version_info = curl_version_info(CURLVERSION_FIRST); for (auto proto_ptr = version_info->protocols; *proto_ptr != nullptr; proto_ptr++) { diff --git a/src/input/plugins/FfmpegInputPlugin.cxx b/src/input/plugins/FfmpegInputPlugin.cxx index a897abd95..f0c0d4ad8 100644 --- a/src/input/plugins/FfmpegInputPlugin.cxx +++ b/src/input/plugins/FfmpegInputPlugin.cxx @@ -73,7 +73,8 @@ input_ffmpeg_init(EventLoop &, const ConfigBlock &) } static std::set<std::string> -input_ffmpeg_protocols() { +input_ffmpeg_protocols() noexcept +{ void *opaque = nullptr; const char* protocol; std::set<std::string> protocols; diff --git a/src/input/plugins/QobuzInputPlugin.cxx b/src/input/plugins/QobuzInputPlugin.cxx index 3936cb371..ee2fa95ed 100644 --- a/src/input/plugins/QobuzInputPlugin.cxx +++ b/src/input/plugins/QobuzInputPlugin.cxx @@ -158,7 +158,7 @@ InitQobuzInput(EventLoop &event_loop, const ConfigBlock &block) } static void -FinishQobuzInput() +FinishQobuzInput() noexcept { delete qobuz_client; } diff --git a/src/input/plugins/TidalInputPlugin.cxx b/src/input/plugins/TidalInputPlugin.cxx index b0c3bf9dc..1a007791f 100644 --- a/src/input/plugins/TidalInputPlugin.cxx +++ b/src/input/plugins/TidalInputPlugin.cxx @@ -189,7 +189,7 @@ InitTidalInput(EventLoop &event_loop, const ConfigBlock &block) } static void -FinishTidalInput() +FinishTidalInput() noexcept { delete tidal_session; } |