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
+4 -5
View File
@@ -14,7 +14,6 @@
#include "fs/FileInfo.hxx"
#include "fs/Traits.hxx"
#include "thread/Mutex.hxx"
#include "util/Compiler.h"
#include "Log.hxx"
#include <cassert>
@@ -61,10 +60,10 @@ struct WatchDirectory {
void LoadExcludeList(Path directory_path) noexcept;
[[nodiscard]] gcc_pure
[[nodiscard]] [[gnu::pure]]
unsigned GetDepth() const noexcept;
[[nodiscard]] gcc_pure
[[nodiscard]] [[gnu::pure]]
AllocatedPath GetUriFS() const noexcept;
};
@@ -137,7 +136,7 @@ WatchDirectory::GetUriFS() const noexcept
}
/* we don't look at "." / ".." nor files with newlines in their name */
gcc_pure
[[gnu::pure]]
static bool
SkipFilename(Path name) noexcept
{
@@ -210,7 +209,7 @@ try {
LogError(std::current_exception());
}
gcc_pure
[[gnu::pure]]
unsigned
WatchDirectory::GetDepth() const noexcept
{
+3 -3
View File
@@ -7,7 +7,7 @@
#include "playlist/PlaylistRegistry.hxx"
#include "fs/Traits.hxx"
gcc_pure
[[gnu::pure]]
static bool
HaveArchivePluginForFilename(const char *filename) noexcept
{
@@ -21,7 +21,7 @@ HaveArchivePluginForFilename(const char *filename) noexcept
#endif
}
gcc_pure
[[gnu::pure]]
static bool
HaveContainerPluginForFilename(const char *filename) noexcept
{
@@ -31,7 +31,7 @@ HaveContainerPluginForFilename(const char *filename) noexcept
decoder_plugins_supports_suffix(suffix);
}
gcc_pure
[[gnu::pure]]
static bool
HavePlaylistPluginForFilename(const char *filename) noexcept
{
+2 -2
View File
@@ -215,14 +215,14 @@ try {
}
/* we don't look at files with newlines in their name */
gcc_pure
[[gnu::pure]]
static bool
skip_path(const char *name_utf8) noexcept
{
return std::strchr(name_utf8, '\n') != nullptr;
}
gcc_pure
[[gnu::pure]]
bool
UpdateWalk::SkipSymlink(const Directory *directory,
std::string_view utf8_name) const noexcept