Commit aa5c5bf1 authored by Max Kellermann's avatar Max Kellermann

neighbor/smbclient: add `noexcept`

parent 2e804772
......@@ -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");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment