more [[gnu::...]] attributes

This commit is contained in:
Max Kellermann
2021-10-13 11:28:04 +02:00
parent 1c4b484a56
commit f510564d9d
135 changed files with 361 additions and 514 deletions

View File

@@ -33,7 +33,7 @@
/* this destructor exists here just so it won't get inlined */
UPnPDirContent::~UPnPDirContent() = default;
gcc_pure
[[gnu::pure]]
static UPnPDirObject::ItemClass
ParseItemClass(StringView name) noexcept
{
@@ -45,7 +45,7 @@ ParseItemClass(StringView name) noexcept
return UPnPDirObject::ItemClass::UNKNOWN;
}
gcc_pure
[[gnu::pure]]
static SignedSongTime
ParseDuration(const char *duration) noexcept
{
@@ -73,7 +73,7 @@ ParseDuration(const char *duration) noexcept
* elements. There is a very slight risk of collision in doing
* this. Twonky returns directory names (titles) like 'Artist/Album'.
*/
gcc_pure
[[gnu::pure]]
static std::string &&
TitleToPathSegment(std::string &&s) noexcept
{

View File

@@ -21,7 +21,6 @@
#define MPD_UPNP_DIRECTORY_HXX
#include "Object.hxx"
#include "util/Compiler.h"
#include <string>
#include <vector>
@@ -39,7 +38,7 @@ public:
~UPnPDirContent();
gcc_pure
[[gnu::pure]]
UPnPDirObject *FindObject(std::string_view name) noexcept {
for (auto &o : objects)
if (o.name == name)

View File

@@ -21,7 +21,6 @@
#define MPD_UPNP_OBJECT_HXX
#include "tag/Tag.hxx"
#include "util/Compiler.h"
#include <string>
@@ -89,12 +88,12 @@ public:
tag.Clear();
}
gcc_pure
[[gnu::pure]]
bool IsRoot() const noexcept {
return type == Type::CONTAINER && id == "0";
}
gcc_pure
[[gnu::pure]]
bool Check() const noexcept {
return !id.empty() &&
/* root nodes don't need a parent id and a