From 29eba419627437fb6f20714bb553d39a58305c5e Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Tue, 26 Aug 2008 08:27:09 +0200 Subject: converted MpdTagItem.type to an enum Don't use CPP macros when you can use C enum... this also allows better type checking. --- src/tag.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/tag.c') 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]) { -- cgit v1.2.3