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

@@ -204,7 +204,7 @@ static constexpr struct command commands[] = {
static constexpr unsigned num_commands = std::size(commands);
gcc_pure
[[gnu::pure]]
static bool
command_available([[maybe_unused]] const Partition &partition,
[[maybe_unused]] const struct command *cmd) noexcept
@@ -290,7 +290,7 @@ command_init() noexcept
#endif
}
gcc_pure
[[gnu::pure]]
static const struct command *
command_lookup(const char *name) noexcept
{

View File

@@ -34,14 +34,14 @@
#include <cassert>
#include <array>
gcc_pure
[[gnu::pure]]
static bool
SkipNameFS(PathTraitsFS::const_pointer name_fs) noexcept
{
return PathTraitsFS::IsSpecialFilename(name_fs);
}
gcc_pure
[[gnu::pure]]
static bool
skip_path(Path name_fs) noexcept
{
@@ -87,7 +87,7 @@ handle_listfiles_local(Response &r, Path path_fs)
#pragma GCC diagnostic pop
#endif
gcc_pure
[[gnu::pure]]
static bool
IsValidName(const std::string_view s) noexcept
{
@@ -99,7 +99,7 @@ IsValidName(const std::string_view s) noexcept
});
}
gcc_pure
[[gnu::pure]]
static bool
IsValidValue(const std::string_view s) noexcept
{

View File

@@ -101,7 +101,7 @@ GetChromaprintCommand::DecodeStream(InputStream &input_stream,
plugin.StreamDecode(*this, input_stream);
}
gcc_pure
[[gnu::pure]]
static bool
decoder_check_plugin_mime(const DecoderPlugin &plugin,
const InputStream &is) noexcept
@@ -113,7 +113,7 @@ decoder_check_plugin_mime(const DecoderPlugin &plugin,
plugin.SupportsMimeType(GetMimeTypeBase(mime_type));
}
gcc_pure
[[gnu::pure]]
static bool
decoder_check_plugin_suffix(const DecoderPlugin &plugin,
std::string_view suffix) noexcept
@@ -123,7 +123,7 @@ decoder_check_plugin_suffix(const DecoderPlugin &plugin,
return !suffix.empty() && plugin.SupportsSuffix(suffix);
}
gcc_pure
[[gnu::pure]]
static bool
decoder_check_plugin(const DecoderPlugin &plugin, const InputStream &is,
std::string_view suffix) noexcept

View File

@@ -71,7 +71,7 @@ IsValidAttributeNameChar(char ch) noexcept
return IsAlphaNumericASCII(ch) || ch == '_';
}
gcc_pure
[[gnu::pure]]
static bool
IsValidAttributeName(const char *s) noexcept
{

View File

@@ -44,7 +44,7 @@ IsValidPartitionChar(char ch)
return IsAlphaNumericASCII(ch) || ch == '-' || ch == '_';
}
gcc_pure
[[gnu::pure]]
static bool
IsValidPartitionName(const char *name) noexcept
{
@@ -56,7 +56,7 @@ IsValidPartitionName(const char *name) noexcept
return true;
}
gcc_pure
[[gnu::pure]]
static bool
HasPartitionNamed(Instance &instance, const char *name) noexcept
{

View File

@@ -22,7 +22,7 @@
#include <memory>
gcc_pure
[[gnu::pure]]
static bool
skip_path(const char *name_utf8) noexcept
{