aboutsummaryrefslogtreecommitdiffstats
path: root/src/inputPlugins/wavpack_plugin.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2008-09-07 19:14:39 +0200
committerEric Wong <normalperson@yhbt.net>2008-09-09 01:28:10 -0700
commitd5187ce694cca1c5bd05bd562d9494e7387a86d0 (patch)
tree39a98b79bf15922b0a5a0a8424350f1cca00db9e /src/inputPlugins/wavpack_plugin.c
parent56c11abbf5a5a6e7b53905f91fda1ba75b02b296 (diff)
downloadmpd-d5187ce694cca1c5bd05bd562d9494e7387a86d0.tar.gz
mpd-d5187ce694cca1c5bd05bd562d9494e7387a86d0.tar.xz
mpd-d5187ce694cca1c5bd05bd562d9494e7387a86d0.zip
fix -Wcast-qual -Wwrite-strings warnings
The previous patch enabled these warnings. In Eric's branch, they were worked around with a generic deconst_ptr() function. There are several places where we can add "const" to pointers, and in others, libraries want non-const strings. In the latter, convert string literals to "static char[]" variables - this takes the same space, and seems safer than deconsting a string literal.
Diffstat (limited to '')
-rw-r--r--src/inputPlugins/wavpack_plugin.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/inputPlugins/wavpack_plugin.c b/src/inputPlugins/wavpack_plugin.c
index 77339dabd..8bba8ae2b 100644
--- a/src/inputPlugins/wavpack_plugin.c
+++ b/src/inputPlugins/wavpack_plugin.c
@@ -224,34 +224,38 @@ static char *wavpack_tag(WavpackContext *wpc, char *key)
static ReplayGainInfo *wavpack_replaygain(WavpackContext *wpc)
{
+ static char replaygain_track_gain[] = "replaygain_track_gain";
+ static char replaygain_album_gain[] = "replaygain_album_gain";
+ static char replaygain_track_peak[] = "replaygain_track_peak";
+ static char replaygain_album_peak[] = "replaygain_album_peak";
ReplayGainInfo *replayGainInfo;
int found = 0;
char *value;
replayGainInfo = newReplayGainInfo();
- value = wavpack_tag(wpc, "replaygain_track_gain");
+ value = wavpack_tag(wpc, replaygain_track_gain);
if (value) {
replayGainInfo->trackGain = atof(value);
free(value);
found = 1;
}
- value = wavpack_tag(wpc, "replaygain_album_gain");
+ value = wavpack_tag(wpc, replaygain_album_gain);
if (value) {
replayGainInfo->albumGain = atof(value);
free(value);
found = 1;
}
- value = wavpack_tag(wpc, "replaygain_track_peak");
+ value = wavpack_tag(wpc, replaygain_track_peak);
if (value) {
replayGainInfo->trackPeak = atof(value);
free(value);
found = 1;
}
- value = wavpack_tag(wpc, "replaygain_album_peak");
+ value = wavpack_tag(wpc, replaygain_album_peak);
if (value) {
replayGainInfo->albumPeak = atof(value);
free(value);