aboutsummaryrefslogtreecommitdiffstats
path: root/src/tag.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2008-08-26 08:27:09 +0200
committerEric Wong <normalperson@yhbt.net>2008-08-30 18:36:18 -0700
commit29eba419627437fb6f20714bb553d39a58305c5e (patch)
tree88e8987dfc3582cfff15d76637cf63716d7237eb /src/tag.c
parent554c708450dd5008c310902f67702b9727b944d3 (diff)
downloadmpd-29eba419627437fb6f20714bb553d39a58305c5e.tar.gz
mpd-29eba419627437fb6f20714bb553d39a58305c5e.tar.xz
mpd-29eba419627437fb6f20714bb553d39a58305c5e.zip
converted MpdTagItem.type to an enum
Don't use CPP macros when you can use C enum... this also allows better type checking.
Diffstat (limited to '')
-rw-r--r--src/tag.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/tag.c b/src/tag.c
index 5023a58cb..fc85a6ff9 100644
--- a/src/tag.c
+++ b/src/tag.c
@@ -606,7 +606,7 @@ static void deleteItem(MpdTag * tag, int idx)
}
}
-void clearItemsFromMpdTag(MpdTag * tag, int type)
+void clearItemsFromMpdTag(MpdTag * tag, enum tag_type type)
{
int i;
@@ -697,7 +697,8 @@ int mpdTagsAreEqual(MpdTag * tag1, MpdTag * tag2)
} \
}
-static void appendToTagItems(MpdTag * tag, int type, char *value, int len)
+static void appendToTagItems(MpdTag * tag, enum tag_type type,
+ char *value, int len)
{
int i = tag->numOfItems;
char *duplicated = xmalloc(len + 1);
@@ -717,7 +718,8 @@ static void appendToTagItems(MpdTag * tag, int type, char *value, int len)
free(duplicated);
}
-void addItemToMpdTagWithLen(MpdTag * tag, int itemType, char *value, int len)
+void addItemToMpdTagWithLen(MpdTag * tag, enum tag_type itemType,
+ char *value, int len)
{
if (ignoreTagItems[itemType])
{