diff --git a/src/client/Response.cxx b/src/client/Response.cxx index b21ac91b5..25f95c215 100644 --- a/src/client/Response.cxx +++ b/src/client/Response.cxx @@ -24,7 +24,7 @@ #include "util/AllocatedString.hxx" TagMask -Response::GetTagMask() const +Response::GetTagMask() const noexcept { return GetClient().tag_mask; } diff --git a/src/client/Response.hxx b/src/client/Response.hxx index a133e96a3..ffe4720f4 100644 --- a/src/client/Response.hxx +++ b/src/client/Response.hxx @@ -66,7 +66,7 @@ public: * to avoid including Client.hxx. */ gcc_pure - TagMask GetTagMask() const; + TagMask GetTagMask() const noexcept; void SetCommand(const char *_command) { command = _command; diff --git a/src/command/PartitionCommands.cxx b/src/command/PartitionCommands.cxx index 7929b5998..4bf3c641f 100644 --- a/src/command/PartitionCommands.cxx +++ b/src/command/PartitionCommands.cxx @@ -61,7 +61,7 @@ IsValidPartitionChar(char ch) gcc_pure static bool -IsValidPartitionName(const char *name) +IsValidPartitionName(const char *name) noexcept { do { if (!IsValidPartitionChar(*name)) @@ -73,7 +73,7 @@ IsValidPartitionName(const char *name) gcc_pure static bool -HasPartitionNamed(Instance &instance, const char *name) +HasPartitionNamed(Instance &instance, const char *name) noexcept { return instance.FindPartition(name) != nullptr; } diff --git a/src/net/StaticSocketAddress.cxx b/src/net/StaticSocketAddress.cxx index d96b5fff5..ceaee9d7c 100644 --- a/src/net/StaticSocketAddress.cxx +++ b/src/net/StaticSocketAddress.cxx @@ -53,7 +53,7 @@ StaticSocketAddress::operator=(SocketAddress other) noexcept #ifdef HAVE_TCP bool -StaticSocketAddress::SetPort(unsigned port) +StaticSocketAddress::SetPort(unsigned port) noexcept { switch (GetFamily()) { case AF_INET: diff --git a/src/net/StaticSocketAddress.hxx b/src/net/StaticSocketAddress.hxx index 6047ca2bd..50f6eb5a0 100644 --- a/src/net/StaticSocketAddress.hxx +++ b/src/net/StaticSocketAddress.hxx @@ -96,7 +96,7 @@ public: * Extract the port number. Returns 0 if not applicable. */ gcc_pure - unsigned GetPort() const { + unsigned GetPort() const noexcept { return ((SocketAddress)*this).GetPort(); } @@ -104,7 +104,7 @@ public: * @return true on success, false if this address cannot have * a port number */ - bool SetPort(unsigned port); + bool SetPort(unsigned port) noexcept; #endif gcc_pure diff --git a/src/pcm/PcmPack.cxx b/src/pcm/PcmPack.cxx index 72c18287e..47d59b32b 100644 --- a/src/pcm/PcmPack.cxx +++ b/src/pcm/PcmPack.cxx @@ -61,7 +61,7 @@ ConstructS24(uint8_t low, uint8_t mid, uint8_t high) */ gcc_pure static int32_t -ReadS24LE(const uint8_t *src) +ReadS24LE(const uint8_t *src) noexcept { return ConstructS24(src[0], src[1], src[2]); } @@ -71,7 +71,7 @@ ReadS24LE(const uint8_t *src) */ gcc_pure static int32_t -ReadS24BE(const uint8_t *src) +ReadS24BE(const uint8_t *src) noexcept { return ConstructS24(src[2], src[1], src[0]); } @@ -81,7 +81,7 @@ ReadS24BE(const uint8_t *src) */ gcc_pure static int32_t -ReadS24(const uint8_t *src) +ReadS24(const uint8_t *src) noexcept { return IsBigEndian() ? ReadS24BE(src) : ReadS24LE(src); } diff --git a/src/tag/Tag.cxx b/src/tag/Tag.cxx index f11134b7c..1f425ec6a 100644 --- a/src/tag/Tag.cxx +++ b/src/tag/Tag.cxx @@ -25,7 +25,7 @@ #include void -Tag::Clear() +Tag::Clear() noexcept { duration = SignedSongTime::Negative(); has_playlist = false; @@ -98,7 +98,7 @@ Tag::HasType(TagType type) const noexcept } static TagType -DecaySort(TagType type) +DecaySort(TagType type) noexcept { switch (type) { case TAG_ARTIST_SORT: @@ -116,7 +116,7 @@ DecaySort(TagType type) } static TagType -Fallback(TagType type) +Fallback(TagType type) noexcept { switch (type) { case TAG_ALBUM_ARTIST: @@ -131,7 +131,7 @@ Fallback(TagType type) } const char * -Tag::GetSortValue(TagType type) const +Tag::GetSortValue(TagType type) const noexcept { const char *value = GetValue(type); if (value != nullptr) diff --git a/src/tag/Tag.hxx b/src/tag/Tag.hxx index 3821a5c46..64b79e969 100644 --- a/src/tag/Tag.hxx +++ b/src/tag/Tag.hxx @@ -85,7 +85,7 @@ struct Tag { * Similar to the move operator, but move only the #TagItem * array. */ - void MoveItemsFrom(Tag &&other) { + void MoveItemsFrom(Tag &&other) noexcept { std::swap(items, other.items); std::swap(num_items, other.num_items); } @@ -94,21 +94,21 @@ struct Tag { * Returns true if the tag contains no items. This ignores * the "duration" attribute. */ - bool IsEmpty() const { + bool IsEmpty() const noexcept { return num_items == 0; } /** * Returns true if the tag contains any information. */ - bool IsDefined() const { + bool IsDefined() const noexcept { return !IsEmpty() || !duration.IsNegative(); } /** * Clear everything, as if this was a new Tag object. */ - void Clear(); + void Clear() noexcept; /** * Merges the data from two tags. If both tags share data for the @@ -149,7 +149,7 @@ struct Tag { * there is no such value, returns an empty string. */ gcc_pure - const char *GetSortValue(TagType type) const; + const char *GetSortValue(TagType type) const noexcept; class const_iterator { friend struct Tag; diff --git a/test/test_queue_priority.cxx b/test/test_queue_priority.cxx index 171585dec..42a5e7224 100644 --- a/test/test_queue_priority.cxx +++ b/test/test_queue_priority.cxx @@ -9,7 +9,7 @@ #include Tag::Tag(const Tag &) {} -void Tag::Clear() {} +void Tag::Clear() noexcept {} static void check_descending_priority(const Queue *queue,