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

See commit 71f0ed8b74
This commit is contained in:
Max Kellermann 2017-05-15 23:05:45 +02:00
parent cde5a07981
commit c5996c0593
11 changed files with 20 additions and 20 deletions

View File

@ -31,7 +31,7 @@ DetachedSong::DetachedSong(const LightSong &other)
start_time(other.start_time), start_time(other.start_time),
end_time(other.end_time) {} end_time(other.end_time) {}
DetachedSong::operator LightSong() const DetachedSong::operator LightSong() const noexcept
{ {
LightSong result; LightSong result;
result.directory = nullptr; result.directory = nullptr;

View File

@ -108,7 +108,7 @@ public:
DetachedSong &operator=(DetachedSong &&) = default; DetachedSong &operator=(DetachedSong &&) = default;
gcc_pure gcc_pure
explicit operator LightSong() const; explicit operator LightSong() const noexcept;
gcc_pure gcc_pure
const char *GetURI() const noexcept { const char *GetURI() const noexcept {

View File

@ -40,7 +40,7 @@ Instance::Instance()
} }
Partition * Partition *
Instance::FindPartition(const char *name) Instance::FindPartition(const char *name) noexcept
{ {
for (auto &partition : partitions) for (auto &partition : partitions)
if (partition.name == name) if (partition.name == name)

View File

@ -111,7 +111,7 @@ struct Instance final
* no such partition was found. * no such partition was found.
*/ */
gcc_pure gcc_pure
Partition *FindPartition(const char *name); Partition *FindPartition(const char *name) noexcept;
#ifdef ENABLE_DATABASE #ifdef ENABLE_DATABASE
/** /**

View File

@ -26,19 +26,19 @@
const Domain client_domain("client"); const Domain client_domain("client");
Instance & Instance &
Client::GetInstance() Client::GetInstance() noexcept
{ {
return partition->instance; return partition->instance;
} }
playlist & playlist &
Client::GetPlaylist() Client::GetPlaylist() noexcept
{ {
return partition->playlist; return partition->playlist;
} }
PlayerControl & PlayerControl &
Client::GetPlayerControl() Client::GetPlayerControl() noexcept
{ {
return partition->pc; return partition->pc;
} }

View File

@ -188,24 +188,24 @@ public:
*/ */
void AllowFile(Path path_fs) const; void AllowFile(Path path_fs) const;
Partition &GetPartition() { Partition &GetPartition() noexcept {
return *partition; return *partition;
} }
void SetPartition(Partition &new_partition) { void SetPartition(Partition &new_partition) noexcept {
partition = &new_partition; partition = &new_partition;
// TODO: set various idle flags? // TODO: set various idle flags?
} }
gcc_pure gcc_pure
Instance &GetInstance(); Instance &GetInstance() noexcept;
gcc_pure gcc_pure
playlist &GetPlaylist(); playlist &GetPlaylist() noexcept;
gcc_pure gcc_pure
PlayerControl &GetPlayerControl(); PlayerControl &GetPlayerControl() noexcept;
/** /**
* Wrapper for Instance::GetDatabase(). * Wrapper for Instance::GetDatabase().

View File

@ -23,7 +23,7 @@
gcc_pure gcc_pure
static uint_least32_t static uint_least32_t
ParseAlsaVersion(const char *p) ParseAlsaVersion(const char *p) noexcept
{ {
char *endptr; char *endptr;
unsigned long major, minor = 0, subminor = 0; unsigned long major, minor = 0, subminor = 0;
@ -42,7 +42,7 @@ ParseAlsaVersion(const char *p)
} }
uint_least32_t uint_least32_t
GetRuntimeAlsaVersion() GetRuntimeAlsaVersion() noexcept
{ {
const char *version = snd_asoundlib_version(); const char *version = snd_asoundlib_version();
if (version == nullptr) if (version == nullptr)

View File

@ -37,6 +37,6 @@ MakeAlsaVersion(uint_least32_t major, uint_least32_t minor,
*/ */
gcc_const gcc_const
uint_least32_t uint_least32_t
GetRuntimeAlsaVersion(); GetRuntimeAlsaVersion() noexcept;
#endif #endif

View File

@ -38,7 +38,7 @@ nfs_init(EventLoop &event_loop)
} }
void void
nfs_finish() nfs_finish() noexcept
{ {
assert(in_use > 0); assert(in_use > 0);
@ -49,7 +49,7 @@ nfs_finish()
} }
EventLoop & EventLoop &
nfs_get_event_loop() nfs_get_event_loop() noexcept
{ {
assert(in_use > 0); assert(in_use > 0);

View File

@ -30,14 +30,14 @@ void
nfs_init(EventLoop &event_loop); nfs_init(EventLoop &event_loop);
void void
nfs_finish(); nfs_finish() noexcept;
/** /**
* Return the EventLoop that was passed to nfs_init(). * Return the EventLoop that was passed to nfs_init().
*/ */
gcc_const gcc_const
EventLoop & EventLoop &
nfs_get_event_loop(); nfs_get_event_loop() noexcept;
gcc_pure gcc_pure
NfsConnection & NfsConnection &

View File

@ -1009,7 +1009,7 @@ MaybeDmix(snd_pcm_type_t type)
gcc_pure gcc_pure
static bool static bool
MaybeDmix(snd_pcm_t *pcm) MaybeDmix(snd_pcm_t *pcm) noexcept
{ {
return MaybeDmix(snd_pcm_type(pcm)); return MaybeDmix(snd_pcm_type(pcm));
} }