wavpack: removed NULL element from tagtypes
The number of tag types is known at compile time. Use the GLib macro G_N_ELEMENTS instead of having a NULL element at the end.
This commit is contained in:
parent
66eb3e90c3
commit
59c20e5afe
@ -44,7 +44,6 @@ static struct {
|
|||||||
{ "performer", TAG_ITEM_PERFORMER },
|
{ "performer", TAG_ITEM_PERFORMER },
|
||||||
{ "comment", TAG_ITEM_COMMENT },
|
{ "comment", TAG_ITEM_COMMENT },
|
||||||
{ "disc", TAG_ITEM_DISC },
|
{ "disc", TAG_ITEM_DISC },
|
||||||
{ NULL, 0 }
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -283,7 +282,7 @@ static struct tag *wavpack_tagdup(const char *fname)
|
|||||||
char error[ERRORLEN];
|
char error[ERRORLEN];
|
||||||
char *s;
|
char *s;
|
||||||
int ssize;
|
int ssize;
|
||||||
int i, j;
|
int j;
|
||||||
|
|
||||||
wpc = WavpackOpenFileInput(fname, error, OPEN_TAGS, 0);
|
wpc = WavpackOpenFileInput(fname, error, OPEN_TAGS, 0);
|
||||||
if (wpc == NULL) {
|
if (wpc == NULL) {
|
||||||
@ -299,7 +298,7 @@ static struct tag *wavpack_tagdup(const char *fname)
|
|||||||
ssize = 0;
|
ssize = 0;
|
||||||
s = NULL;
|
s = NULL;
|
||||||
|
|
||||||
for (i = 0; tagtypes[i].name != NULL; ++i) {
|
for (unsigned i = 0; i < G_N_ELEMENTS(tagtypes); ++i) {
|
||||||
j = WavpackGetTagItem(wpc, tagtypes[i].name, NULL, 0);
|
j = WavpackGetTagItem(wpc, tagtypes[i].name, NULL, 0);
|
||||||
if (j > 0) {
|
if (j > 0) {
|
||||||
++j;
|
++j;
|
||||||
|
Loading…
Reference in New Issue
Block a user