tag/Format: use [[gnu::pure]]

This commit is contained in:
Max Kellermann 2021-10-13 10:35:07 +02:00
parent abed633fcb
commit 08491fcd86
2 changed files with 3 additions and 5 deletions

View File

@ -52,7 +52,7 @@ IsUnsafeChar(char ch)
(unsigned char)ch < 0x20;
}
gcc_pure
[[gnu::pure]]
static bool
HasUnsafeChar(const char *s) noexcept
{
@ -78,7 +78,7 @@ SanitizeString(const char *s, char *buffer, size_t buffer_size) noexcept
return buffer;
}
gcc_pure gcc_nonnull_all
[[gnu::pure]] [[gnu::nonnull]]
static const char *
TagGetter(const void *object, const char *name) noexcept
{

View File

@ -20,11 +20,9 @@
#ifndef MPD_TAG_FORMAT_HXX
#define MPD_TAG_FORMAT_HXX
#include "util/Compiler.h"
struct Tag;
gcc_malloc gcc_nonnull_all
[[gnu::malloc]] [[gnu::nonnull]]
char *
FormatTag(const Tag &tag, const char *format) noexcept;