aboutsummaryrefslogtreecommitdiffstats
path: root/src/tag.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2008-08-26 08:27:09 +0200
committerMax Kellermann <max@duempel.org>2008-08-26 08:27:09 +0200
commit0fc2422cd098223642f12eecfc3fcd93d9f495d2 (patch)
treece00468b373eb49f449c3743d9d240867daa7927 /src/tag.c
parente754ed01a77a0dfb5039148cd4990a669ea9024c (diff)
downloadmpd-0fc2422cd098223642f12eecfc3fcd93d9f495d2.tar.gz
mpd-0fc2422cd098223642f12eecfc3fcd93d9f495d2.tar.xz
mpd-0fc2422cd098223642f12eecfc3fcd93d9f495d2.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])
{