From aa5c5bf14f053960e357c33a90ba5ef37ef95c38 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Tue, 16 Apr 2019 20:05:01 +0200 Subject: [PATCH] neighbor/smbclient: add `noexcept` --- .../plugins/SmbclientNeighborPlugin.cxx | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/neighbor/plugins/SmbclientNeighborPlugin.cxx b/src/neighbor/plugins/SmbclientNeighborPlugin.cxx index 8e14ca0e4..909c56fc3 100644 --- a/src/neighbor/plugins/SmbclientNeighborPlugin.cxx +++ b/src/neighbor/plugins/SmbclientNeighborPlugin.cxx @@ -39,7 +39,7 @@ class SmbclientNeighborExplorer final : public NeighborExplorer { struct Server { const std::string name, comment; - Server(std::string &&_name, std::string &&_comment) + Server(std::string &&_name, std::string &&_comment) noexcept :name(std::move(_name)), comment(std::move(_comment)) {} @@ -66,7 +66,7 @@ class SmbclientNeighborExplorer final : public NeighborExplorer { bool quit; public: - SmbclientNeighborExplorer(NeighborListener &_listener) + SmbclientNeighborExplorer(NeighborListener &_listener) noexcept :NeighborExplorer(_listener), thread(BIND_THIS_METHOD(ThreadFunc)) {} @@ -76,8 +76,8 @@ public: List GetList() const noexcept override; private: - void Run(); - void ThreadFunc(); + void Run() noexcept; + void ThreadFunc() noexcept; }; void @@ -111,7 +111,7 @@ SmbclientNeighborExplorer::GetList() const noexcept } static void -ReadServer(NeighborExplorer::List &list, const smbc_dirent &e) +ReadServer(NeighborExplorer::List &list, const smbc_dirent &e) noexcept { const std::string name(e.name, e.namelen); const std::string comment(e.comment, e.commentlen); @@ -120,17 +120,17 @@ ReadServer(NeighborExplorer::List &list, const smbc_dirent &e) } static void -ReadServers(NeighborExplorer::List &list, const char *uri); +ReadServers(NeighborExplorer::List &list, const char *uri) noexcept; static void -ReadWorkgroup(NeighborExplorer::List &list, const std::string &name) +ReadWorkgroup(NeighborExplorer::List &list, const std::string &name) noexcept { std::string uri = "smb://" + name; ReadServers(list, uri.c_str()); } static void -ReadEntry(NeighborExplorer::List &list, const smbc_dirent &e) +ReadEntry(NeighborExplorer::List &list, const smbc_dirent &e) noexcept { switch (e.smbc_type) { case SMBC_WORKGROUP: @@ -144,7 +144,7 @@ ReadEntry(NeighborExplorer::List &list, const smbc_dirent &e) } static void -ReadServers(NeighborExplorer::List &list, int fd) +ReadServers(NeighborExplorer::List &list, int fd) noexcept { smbc_dirent *e; while ((e = smbc_readdir(fd)) != nullptr) @@ -154,7 +154,7 @@ ReadServers(NeighborExplorer::List &list, int fd) } static void -ReadServers(NeighborExplorer::List &list, const char *uri) +ReadServers(NeighborExplorer::List &list, const char *uri) noexcept { int fd = smbc_opendir(uri); if (fd >= 0) { @@ -189,7 +189,7 @@ FindBeforeServerByURI(NeighborExplorer::List::const_iterator prev, } inline void -SmbclientNeighborExplorer::Run() +SmbclientNeighborExplorer::Run() noexcept { List found = DetectServers(), lost; @@ -228,7 +228,7 @@ SmbclientNeighborExplorer::Run() } inline void -SmbclientNeighborExplorer::ThreadFunc() +SmbclientNeighborExplorer::ThreadFunc() noexcept { SetThreadName("smbclient");