From 421220b609dcf591507fb6e9724e6978fd4994fa Mon Sep 17 00:00:00 2001 From: Andre Noll Date: Tue, 10 Aug 2021 00:12:31 +0200 Subject: [PATCH] mp4: Kill pointless stricmp macro. Just call strcasecmp() directly. --- mp4.c | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/mp4.c b/mp4.c index 32871727..98bfc52b 100644 --- a/mp4.c +++ b/mp4.c @@ -1564,8 +1564,6 @@ struct membuffer { unsigned error; }; -#define stricmp strcasecmp - static struct membuffer *membuffer_create(void) { const unsigned initial_size = 256; @@ -1672,7 +1670,7 @@ static uint32_t meta_genre_to_index(const char *genrestr) { unsigned n; for (n = 0; n < sizeof (ID3v1GenreList) / sizeof (ID3v1GenreList[0]); n++) { - if (!stricmp(genrestr, ID3v1GenreList[n])) + if (!strcasecmp(genrestr, ID3v1GenreList[n])) return n + 1; } return 0; @@ -1700,7 +1698,7 @@ static const char *find_standard_meta(const char *name) //returns atom name if f { unsigned n; for (n = 0; n < sizeof (stdmetas) / sizeof (stdmetas[0]); n++) { - if (!stricmp(name, stdmetas[n].name)) + if (!strcasecmp(name, stdmetas[n].name)) return stdmetas[n].atom; } return 0; @@ -1801,28 +1799,28 @@ static uint32_t create_ilst(const struct mp4ff_metadata *data, void **out_buffer const char *genre_ptr = 0, *tempo_ptr = 0; for (metaptr = 0; metaptr < data->count; metaptr++) { struct mp4ff_tag *tag = &data->tags[metaptr]; - if (!stricmp(tag->item, "tracknumber") || !stricmp(tag->item, "track")) { + if (!strcasecmp(tag->item, "tracknumber") || !strcasecmp(tag->item, "track")) { if (tracknumber_ptr == 0) tracknumber_ptr = tag->value; mask[metaptr] = 1; - } else if (!stricmp(tag->item, "totaltracks")) { + } else if (!strcasecmp(tag->item, "totaltracks")) { if (totaltracks_ptr == 0) totaltracks_ptr = tag->value; mask[metaptr] = 1; - } else if (!stricmp(tag->item, "discnumber") - || !stricmp(tag->item, "disc")) { + } else if (!strcasecmp(tag->item, "discnumber") + || !strcasecmp(tag->item, "disc")) { if (discnumber_ptr == 0) discnumber_ptr = tag->value; mask[metaptr] = 1; - } else if (!stricmp(tag->item, "totaldiscs")) { + } else if (!strcasecmp(tag->item, "totaldiscs")) { if (totaldiscs_ptr == 0) totaldiscs_ptr = tag->value; mask[metaptr] = 1; - } else if (!stricmp(tag->item, "genre")) { + } else if (!strcasecmp(tag->item, "genre")) { if (genre_ptr == 0) genre_ptr = tag->value; mask[metaptr] = 1; - } else if (!stricmp(tag->item, "tempo")) { + } else if (!strcasecmp(tag->item, "tempo")) { if (tempo_ptr == 0) tempo_ptr = tag->value; mask[metaptr] = 1; @@ -2157,7 +2155,7 @@ static int32_t meta_find_by_name(const struct mp4ff *f, const char *item, uint32_t i; for (i = 0; i < f->tags.count; i++) { - if (!stricmp(f->tags.tags[i].item, item)) { + if (!strcasecmp(f->tags.tags[i].item, item)) { *value = para_strdup(f->tags.tags[i].value); return 1; } -- 2.39.5