*: add "noexcept" to many, many function prototypes

This eliminates some overhead, because the compiler doesn't need to
consider these functions throwing.
This commit is contained in:
Max Kellermann
2017-05-08 14:44:49 +02:00
parent ac2e4e593d
commit 71f0ed8b74
272 changed files with 873 additions and 846 deletions

View File

@@ -93,7 +93,7 @@ NeighborGlue::Close()
}
NeighborGlue::List
NeighborGlue::GetList() const
NeighborGlue::GetList() const noexcept
{
List result;

View File

@@ -71,7 +71,7 @@ public:
* plugins.
*/
gcc_pure
List GetList() const;
List GetList() const noexcept;
};
#endif

View File

@@ -36,7 +36,7 @@ const NeighborPlugin *const neighbor_plugins[] = {
};
const NeighborPlugin *
GetNeighborPluginByName(const char *name)
GetNeighborPluginByName(const char *name) noexcept
{
for (auto i = neighbor_plugins; *i != nullptr; ++i)
if (strcmp((*i)->name, name) == 0)

View File

@@ -32,6 +32,6 @@ extern const NeighborPlugin *const neighbor_plugins[];
gcc_pure
const NeighborPlugin *
GetNeighborPluginByName(const char *name);
GetNeighborPluginByName(const char *name) noexcept;
#endif

View File

@@ -169,7 +169,7 @@ ReadServers(NeighborExplorer::List &list, const char *uri)
gcc_pure
static NeighborExplorer::List
DetectServers()
DetectServers() noexcept
{
NeighborExplorer::List list;
const std::lock_guard<Mutex> protect(smbclient_mutex);
@@ -181,7 +181,7 @@ gcc_pure
static NeighborExplorer::List::const_iterator
FindBeforeServerByURI(NeighborExplorer::List::const_iterator prev,
NeighborExplorer::List::const_iterator end,
const std::string &uri)
const std::string &uri) noexcept
{
for (auto i = std::next(prev); i != end; prev = i, i = std::next(prev))
if (i->uri == uri)