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

This commit is contained in:
Max Kellermann 2021-10-13 10:32:29 +02:00
parent 7caeb3b0d8
commit db2a9cb6d5
2 changed files with 3 additions and 11 deletions

View File

@ -236,11 +236,6 @@ TagBuilder::AddItem(TagType type, StringView value) noexcept
void void
TagBuilder::AddItem(TagType type, const char *value) noexcept TagBuilder::AddItem(TagType type, const char *value) noexcept
{ {
#if !CLANG_CHECK_VERSION(3,6)
/* disabled on clang due to -Wtautological-pointer-compare */
assert(value != nullptr);
#endif
AddItem(type, StringView(value)); AddItem(type, StringView(value));
} }

View File

@ -22,7 +22,6 @@
#include "Type.h" #include "Type.h"
#include "Chrono.hxx" #include "Chrono.hxx"
#include "util/Compiler.h"
#include <vector> #include <vector>
#include <memory> #include <memory>
@ -83,7 +82,7 @@ public:
/** /**
* Returns true if the object contains any information. * Returns true if the object contains any information.
*/ */
gcc_pure [[gnu::pure]]
bool IsDefined() const noexcept { bool IsDefined() const noexcept {
return !duration.IsNegative() || has_playlist || !empty(); return !duration.IsNegative() || has_playlist || !empty();
} }
@ -125,7 +124,7 @@ public:
* Checks whether the tag contains one or more items with * Checks whether the tag contains one or more items with
* the specified type. * the specified type.
*/ */
gcc_pure [[gnu::pure]]
bool HasType(TagType type) const noexcept; bool HasType(TagType type) const noexcept;
/** /**
@ -147,7 +146,6 @@ public:
* @param value the value of the tag item (not null-terminated) * @param value the value of the tag item (not null-terminated)
* @param length the length of #value * @param length the length of #value
*/ */
gcc_nonnull_all
void AddItem(TagType type, StringView value) noexcept; void AddItem(TagType type, StringView value) noexcept;
/** /**
@ -156,7 +154,7 @@ public:
* @param type the type of the new tag item * @param type the type of the new tag item
* @param value the value of the tag item (null-terminated) * @param value the value of the tag item (null-terminated)
*/ */
gcc_nonnull_all [[gnu::nonnull]]
void AddItem(TagType type, const char *value) noexcept; void AddItem(TagType type, const char *value) noexcept;
/** /**
@ -177,7 +175,6 @@ public:
void RemoveType(TagType type) noexcept; void RemoveType(TagType type) noexcept;
private: private:
gcc_nonnull_all
void AddItemInternal(TagType type, StringView value) noexcept; void AddItemInternal(TagType type, StringView value) noexcept;
}; };