From 08491fcd86357ef9efdec75da6d49e85500f94c8 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Wed, 13 Oct 2021 10:35:07 +0200 Subject: [PATCH] tag/Format: use [[gnu::pure]] --- src/tag/Format.cxx | 4 ++-- src/tag/Format.hxx | 4 +--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/tag/Format.cxx b/src/tag/Format.cxx index 0d9a85bab..90bf9642a 100644 --- a/src/tag/Format.cxx +++ b/src/tag/Format.cxx @@ -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 { diff --git a/src/tag/Format.hxx b/src/tag/Format.hxx index b6ae786cc..01922912b 100644 --- a/src/tag/Format.hxx +++ b/src/tag/Format.hxx @@ -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;