*: 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

@@ -54,7 +54,7 @@
gcc_const
static enum ack
ToAck(PlaylistResult result)
ToAck(PlaylistResult result) noexcept
{
switch (result) {
case PlaylistResult::SUCCESS:
@@ -90,7 +90,7 @@ ToAck(PlaylistResult result)
#ifdef ENABLE_DATABASE
gcc_const
static enum ack
ToAck(DatabaseErrorCode code)
ToAck(DatabaseErrorCode code) noexcept
{
switch (code) {
case DatabaseErrorCode::DISABLED:
@@ -107,7 +107,7 @@ ToAck(DatabaseErrorCode code)
gcc_pure
static enum ack
ToAck(std::exception_ptr ep)
ToAck(std::exception_ptr ep) noexcept
{
try {
std::rethrow_exception(ep);

View File

@@ -44,7 +44,7 @@
gcc_pure
static bool
SkipNameFS(PathTraitsFS::const_pointer_type name_fs)
SkipNameFS(PathTraitsFS::const_pointer_type name_fs) noexcept
{
return name_fs[0] == '.' &&
(name_fs[1] == 0 ||
@@ -53,7 +53,7 @@ SkipNameFS(PathTraitsFS::const_pointer_type name_fs)
gcc_pure
static bool
skip_path(Path name_fs)
skip_path(Path name_fs) noexcept
{
return name_fs.HasNewline();
}
@@ -107,7 +107,7 @@ handle_listfiles_local(Response &r, Path path_fs)
gcc_pure
static bool
IsValidName(const char *p)
IsValidName(const char *p) noexcept
{
if (!IsAlphaASCII(*p))
return false;
@@ -123,7 +123,7 @@ IsValidName(const char *p)
gcc_pure
static bool
IsValidValue(const char *p)
IsValidValue(const char *p) noexcept
{
while (*p) {
const char ch = *p++;

View File

@@ -30,7 +30,7 @@
#include <string>
bool
neighbor_commands_available(const Instance &instance)
neighbor_commands_available(const Instance &instance) noexcept
{
return instance.neighbors != nullptr;
}

View File

@@ -30,7 +30,7 @@ class Response;
gcc_pure
bool
neighbor_commands_available(const Instance &instance);
neighbor_commands_available(const Instance &instance) noexcept;
CommandResult
handle_listneighbors(Client &client, Request request, Response &response);

View File

@@ -39,7 +39,7 @@
#include "util/ConstBuffer.hxx"
bool
playlist_commands_available()
playlist_commands_available() noexcept
{
return !map_spl_path().IsNull();
}

View File

@@ -29,7 +29,7 @@ class Response;
gcc_const
bool
playlist_commands_available();
playlist_commands_available() noexcept;
CommandResult
handle_save(Client &client, Request request, Response &response);

View File

@@ -45,7 +45,7 @@
gcc_pure
static bool
skip_path(const char *name_utf8)
skip_path(const char *name_utf8) noexcept
{
return strchr(name_utf8, '\n') != nullptr;
}