use [[gnu::...]] attributes

This commit is contained in:
Max Kellermann
2023-03-06 15:57:36 +01:00
parent 3b9aab0684
commit 42f6a0441c
101 changed files with 167 additions and 234 deletions

View File

@@ -193,7 +193,7 @@ Directory::FindSong(std::string_view name_utf8) const noexcept
return nullptr;
}
gcc_pure
[[gnu::pure]]
static bool
directory_cmp(const Directory &a, const Directory &b) noexcept
{

View File

@@ -25,7 +25,7 @@
#define DIRECTORY_BEGIN "begin: "
#define DIRECTORY_END "end: "
gcc_const
[[gnu::const]]
static const char *
DeviceToTypeString(unsigned device) noexcept
{
@@ -44,7 +44,7 @@ DeviceToTypeString(unsigned device) noexcept
}
}
gcc_pure
[[gnu::pure]]
static unsigned
ParseTypeString(const char *type) noexcept
{

View File

@@ -248,7 +248,7 @@ SimpleDatabase::ReturnSong([[maybe_unused]] const LightSong *song) const noexcep
}
}
gcc_const
[[gnu::const]]
static DatabaseSelection
CheckSelection(DatabaseSelection selection) noexcept
{

View File

@@ -47,7 +47,7 @@ Song::GetURI() const noexcept
/**
* Path name traversal of a #Directory.
*/
gcc_pure
[[gnu::pure]]
static const Directory *
FindTargetDirectory(const Directory &base, std::string_view path) noexcept
{
@@ -69,7 +69,7 @@ FindTargetDirectory(const Directory &base, std::string_view path) noexcept
/**
* Path name traversal of a #Song.
*/
gcc_pure
[[gnu::pure]]
static const Song *
FindTargetSong(const Directory &_directory, std::string_view target) noexcept
{

View File

@@ -60,7 +60,7 @@ compare_tag_item(const Tag &a, const Tag &b, TagType type) noexcept
}
/* Only used for sorting/searchin a songvec, not general purpose compares */
gcc_pure
[[gnu::pure]]
static bool
song_cmp(const Song &a, const Song &b) noexcept
{