Merge tag 'v0.20.7'

release v0.20.7
This commit is contained in:
Max Kellermann
2017-05-15 23:01:49 +02:00
289 changed files with 914 additions and 924 deletions

View File

@@ -153,7 +153,7 @@ TagBuilder::CommitNew()
}
bool
TagBuilder::HasType(TagType type) const
TagBuilder::HasType(TagType type) const noexcept
{
for (auto i : items)
if (i->type == type)
@@ -237,7 +237,7 @@ TagBuilder::AddEmptyItem(TagType type)
}
void
TagBuilder::RemoveAll()
TagBuilder::RemoveAll() noexcept
{
tag_pool_lock.lock();
for (auto i : items)
@@ -248,7 +248,7 @@ TagBuilder::RemoveAll()
}
void
TagBuilder::RemoveType(TagType type)
TagBuilder::RemoveType(TagType type) noexcept
{
const auto begin = items.begin(), end = items.end();

View File

@@ -124,7 +124,7 @@ public:
* the specified type.
*/
gcc_pure
bool HasType(TagType type) const;
bool HasType(TagType type) const noexcept;
/**
* Copy attributes and items from the other object that do not
@@ -161,12 +161,12 @@ public:
/**
* Removes all tag items.
*/
void RemoveAll();
void RemoveAll() noexcept;
/**
* Removes all tag items of the specified type.
*/
void RemoveType(TagType type);
void RemoveType(TagType type) noexcept;
private:
gcc_nonnull_all

View File

@@ -29,7 +29,7 @@
gcc_pure
static const char *
FindInvalidUTF8(const char *p, const char *const end)
FindInvalidUTF8(const char *p, const char *const end) noexcept
{
while (p < end) {
const size_t s = SequenceLengthUTF8(*p);

View File

@@ -54,7 +54,7 @@ IsUnsafeChar(char ch)
gcc_pure
static bool
HasUnsafeChar(const char *s)
HasUnsafeChar(const char *s) noexcept
{
for (; *s; ++s)
if (IsUnsafeChar(*s))
@@ -64,7 +64,7 @@ HasUnsafeChar(const char *s)
}
static const char *
SanitizeString(const char *s, char *buffer, size_t buffer_size)
SanitizeString(const char *s, char *buffer, size_t buffer_size) noexcept
{
/* skip leading dots to avoid generating "../" sequences */
while (*s == '.')
@@ -80,7 +80,7 @@ SanitizeString(const char *s, char *buffer, size_t buffer_size)
gcc_pure gcc_nonnull_all
static const char *
TagGetter(const void *object, const char *name)
TagGetter(const void *object, const char *name) noexcept
{
const auto &_ctx = *(const FormatTagContext *)object;
auto &ctx = const_cast<FormatTagContext &>(_ctx);
@@ -127,7 +127,7 @@ TagGetter(const void *object, const char *name)
}
char *
FormatTag(const Tag &tag, const char *format)
FormatTag(const Tag &tag, const char *format) noexcept
{
FormatTagContext ctx(tag);
return format_object(format, &ctx, TagGetter);

View File

@@ -27,6 +27,6 @@ struct Tag;
gcc_malloc gcc_nonnull_all
char *
FormatTag(const Tag &tag, const char *format);
FormatTag(const Tag &tag, const char *format) noexcept;
#endif

View File

@@ -33,7 +33,7 @@ static constexpr size_t ID3V1_SIZE = 128;
gcc_pure
static inline bool
tag_is_id3v1(struct id3_tag *tag)
tag_is_id3v1(struct id3_tag *tag) noexcept
{
return (id3_tag_options(tag, 0, 0) & ID3_TAG_OPTION_ID3V1) != 0;
}

View File

@@ -61,7 +61,7 @@
gcc_pure
static id3_utf8_t *
tag_id3_getstring(const struct id3_frame *frame, unsigned i)
tag_id3_getstring(const struct id3_frame *frame, unsigned i) noexcept
{
id3_field *field = id3_frame_field(frame, i);
if (field == nullptr)
@@ -207,7 +207,7 @@ tag_id3_import_comment(struct id3_tag *tag, const char *id, TagType type,
*/
gcc_pure
static TagType
tag_id3_parse_txxx_name(const char *name)
tag_id3_parse_txxx_name(const char *name) noexcept
{
static constexpr struct tag_table txxx_tags[] = {
{ "ALBUMARTISTSORT", TAG_ALBUM_ARTIST_SORT },

View File

@@ -25,7 +25,7 @@
#include <string.h>
TagType
tag_name_parse(const char *name)
tag_name_parse(const char *name) noexcept
{
assert(name != nullptr);
@@ -40,7 +40,7 @@ tag_name_parse(const char *name)
}
TagType
tag_name_parse_i(const char *name)
tag_name_parse_i(const char *name) noexcept
{
assert(name != nullptr);

View File

@@ -29,7 +29,7 @@
*/
gcc_pure
TagType
tag_name_parse(const char *name);
tag_name_parse(const char *name) noexcept;
/**
* Parse the string, and convert it into a #TagType. Returns
@@ -39,6 +39,6 @@ tag_name_parse(const char *name);
*/
gcc_pure
TagType
tag_name_parse_i(const char *name);
tag_name_parse_i(const char *name) noexcept;
#endif

View File

@@ -28,14 +28,14 @@ extern TagMask global_tag_mask;
gcc_const
static inline bool
IsTagEnabled(TagType tag)
IsTagEnabled(TagType tag) noexcept
{
return global_tag_mask.Test(tag);
}
gcc_const
static inline bool
IsTagEnabled(unsigned tag)
IsTagEnabled(unsigned tag) noexcept
{
return IsTagEnabled(TagType(tag));
}

View File

@@ -28,7 +28,7 @@
* in the table.
*/
TagType
tag_table_lookup(const struct tag_table *table, const char *name)
tag_table_lookup(const struct tag_table *table, const char *name) noexcept
{
for (; table->name != nullptr; ++table)
if (strcmp(name, table->name) == 0)
@@ -43,7 +43,7 @@ tag_table_lookup(const struct tag_table *table, const char *name)
* in the table.
*/
TagType
tag_table_lookup_i(const struct tag_table *table, const char *name)
tag_table_lookup_i(const struct tag_table *table, const char *name) noexcept
{
for (; table->name != nullptr; ++table)
if (StringEqualsCaseASCII(name, table->name))
@@ -53,7 +53,7 @@ tag_table_lookup_i(const struct tag_table *table, const char *name)
}
const char *
tag_table_lookup(const tag_table *table, TagType type)
tag_table_lookup(const tag_table *table, TagType type) noexcept
{
for (; table->name != nullptr; ++table)
if (table->type == type)

View File

@@ -36,7 +36,7 @@ struct tag_table {
*/
gcc_pure
TagType
tag_table_lookup(const tag_table *table, const char *name);
tag_table_lookup(const tag_table *table, const char *name) noexcept;
/**
* Looks up a string in a tag translation table (case insensitive).
@@ -45,7 +45,7 @@ tag_table_lookup(const tag_table *table, const char *name);
*/
gcc_pure
TagType
tag_table_lookup_i(const tag_table *table, const char *name);
tag_table_lookup_i(const tag_table *table, const char *name) noexcept;
/**
* Looks up a #TagType in a tag translation table and returns its
@@ -54,6 +54,6 @@ tag_table_lookup_i(const tag_table *table, const char *name);
*/
gcc_pure
const char *
tag_table_lookup(const tag_table *table, TagType type);
tag_table_lookup(const tag_table *table, TagType type) noexcept;
#endif

View File

@@ -80,7 +80,7 @@ Tag::MergeReplace(Tag *base, Tag *add)
}
const char *
Tag::GetValue(TagType type) const
Tag::GetValue(TagType type) const noexcept
{
assert(type < TAG_NUM_OF_ITEM_TYPES);
@@ -92,7 +92,7 @@ Tag::GetValue(TagType type) const
}
bool
Tag::HasType(TagType type) const
Tag::HasType(TagType type) const noexcept
{
return GetValue(type) != nullptr;
}

View File

@@ -133,14 +133,14 @@ struct Tag {
* nullptr if none is present in this tag object.
*/
gcc_pure
const char *GetValue(TagType type) const;
const char *GetValue(TagType type) const noexcept;
/**
* Checks whether the tag contains one or more items with
* the specified type.
*/
gcc_pure
bool HasType(TagType type) const;
bool HasType(TagType type) const noexcept;
/**
* Returns a value for sorting on the specified type, with

View File

@@ -25,7 +25,7 @@
#include <string.h>
const char *
vorbis_comment_value(const char *entry, const char *name)
vorbis_comment_value(const char *entry, const char *name) noexcept
{
assert(entry != nullptr);
assert(name != nullptr);

View File

@@ -29,6 +29,6 @@
*/
gcc_pure
const char *
vorbis_comment_value(const char *entry, const char *name);
vorbis_comment_value(const char *entry, const char *name) noexcept;
#endif