From 6fbdc721d972d8c1f823acd5473a3dce8836d5fa Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Tue, 5 Feb 2008 10:17:33 +0000 Subject: fix -Wconst warnings [ew: cleaned up the dirty union hack a bit] Signed-off-by: Eric Wong git-svn-id: https://svn.musicpd.org/mpd/trunk@7180 09075e82-0dd4-0310-85a5-a0d7c8717e4f --- src/audioOutputs/audioOutput_shout.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'src/audioOutputs/audioOutput_shout.c') diff --git a/src/audioOutputs/audioOutput_shout.c b/src/audioOutputs/audioOutput_shout.c index 236e02b76..beacfeef9 100644 --- a/src/audioOutputs/audioOutput_shout.c +++ b/src/audioOutputs/audioOutput_shout.c @@ -116,7 +116,7 @@ static int myShout_initDriver(AudioOutput * audioOutput, ConfigParam * param) char *host; char *mount; char *passwd; - char *user; + const char *user; char *name; BlockParam *blockParam; int public; @@ -388,8 +388,13 @@ static void myShout_closeDevice(AudioOutput * audioOutput) audioOutput->open = 0; } -#define addTag(name, value) { \ - if(value) vorbis_comment_add_tag(&(sd->vc), name, value); \ +static void addTag(ShoutData *sd, const char *name, char *value) +{ + if (value) { + union const_hack u; + u.in = name; + vorbis_comment_add_tag(&(sd->vc), u.out, value); + } } static void copyTagToVorbisComment(ShoutData * sd) @@ -400,13 +405,13 @@ static void copyTagToVorbisComment(ShoutData * sd) for (i = 0; i < sd->tag->numOfItems; i++) { switch (sd->tag->items[i].type) { case TAG_ITEM_ARTIST: - addTag("ARTIST", sd->tag->items[i].value); + addTag(sd, "ARTIST", sd->tag->items[i].value); break; case TAG_ITEM_ALBUM: - addTag("ALBUM", sd->tag->items[i].value); + addTag(sd, "ALBUM", sd->tag->items[i].value); break; case TAG_ITEM_TITLE: - addTag("TITLE", sd->tag->items[i].value); + addTag(sd, "TITLE", sd->tag->items[i].value); break; } } -- cgit v1.2.3