tag_ape: converted apeItems and tagItems to global vars
Don't initialize those arrays each time tag_ape_load() is called.
This commit is contained in:
parent
65ad298460
commit
c7e89ea3a3
@ -25,6 +25,26 @@
|
||||
#include <assert.h>
|
||||
#include <stdio.h>
|
||||
|
||||
static const char *const apeItems[7] = {
|
||||
"title",
|
||||
"artist",
|
||||
"album",
|
||||
"comment",
|
||||
"genre",
|
||||
"track",
|
||||
"year"
|
||||
};
|
||||
|
||||
static const int tagItems[7] = {
|
||||
TAG_ITEM_TITLE,
|
||||
TAG_ITEM_ARTIST,
|
||||
TAG_ITEM_ALBUM,
|
||||
TAG_ITEM_COMMENT,
|
||||
TAG_ITEM_GENRE,
|
||||
TAG_ITEM_TRACK,
|
||||
TAG_ITEM_DATE,
|
||||
};
|
||||
|
||||
struct tag *
|
||||
tag_ape_load(const char *file)
|
||||
{
|
||||
@ -48,26 +68,6 @@ tag_ape_load(const char *file)
|
||||
unsigned char reserved[8];
|
||||
} footer;
|
||||
|
||||
const char *apeItems[7] = {
|
||||
"title",
|
||||
"artist",
|
||||
"album",
|
||||
"comment",
|
||||
"genre",
|
||||
"track",
|
||||
"year"
|
||||
};
|
||||
|
||||
int tagItems[7] = {
|
||||
TAG_ITEM_TITLE,
|
||||
TAG_ITEM_ARTIST,
|
||||
TAG_ITEM_ALBUM,
|
||||
TAG_ITEM_COMMENT,
|
||||
TAG_ITEM_GENRE,
|
||||
TAG_ITEM_TRACK,
|
||||
TAG_ITEM_DATE,
|
||||
};
|
||||
|
||||
fp = fopen(file, "r");
|
||||
if (!fp)
|
||||
return NULL;
|
||||
|
Loading…
Reference in New Issue
Block a user