aboutsummaryrefslogtreecommitdiffstats
path: root/src/decoder/wavpack_plugin.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2008-10-30 08:38:54 +0100
committerMax Kellermann <max@duempel.org>2008-10-30 08:38:54 +0100
commit62d4fa9306fdb5dd0a1b592fd8dbdf1b679d92ca (patch)
tree565dd0a8c2c50a31dac369408e6b499eb7daafb5 /src/decoder/wavpack_plugin.c
parentd29bad441066919f808c4ad1657bc5600fd9bd45 (diff)
downloadmpd-62d4fa9306fdb5dd0a1b592fd8dbdf1b679d92ca.tar.gz
mpd-62d4fa9306fdb5dd0a1b592fd8dbdf1b679d92ca.tar.xz
mpd-62d4fa9306fdb5dd0a1b592fd8dbdf1b679d92ca.zip
decoder: use bool for return values and flags
Don't return 0/-1 on success/error, but true/false. Instead of int, use bool for storing flags.
Diffstat (limited to 'src/decoder/wavpack_plugin.c')
-rw-r--r--src/decoder/wavpack_plugin.c23
1 files changed, 12 insertions, 11 deletions
diff --git a/src/decoder/wavpack_plugin.c b/src/decoder/wavpack_plugin.c
index 73336e54d..9f28475cd 100644
--- a/src/decoder/wavpack_plugin.c
+++ b/src/decoder/wavpack_plugin.c
@@ -232,7 +232,7 @@ static ReplayGainInfo *wavpack_replaygain(WavpackContext *wpc)
static char replaygain_track_peak[] = "replaygain_track_peak";
static char replaygain_album_peak[] = "replaygain_album_peak";
ReplayGainInfo *replayGainInfo;
- int found = 0;
+ bool found = false;
char *value;
replayGainInfo = newReplayGainInfo();
@@ -241,28 +241,28 @@ static ReplayGainInfo *wavpack_replaygain(WavpackContext *wpc)
if (value) {
replayGainInfo->trackGain = atof(value);
free(value);
- found = 1;
+ found = true;
}
value = wavpack_tag(wpc, replaygain_album_gain);
if (value) {
replayGainInfo->albumGain = atof(value);
free(value);
- found = 1;
+ found = true;
}
value = wavpack_tag(wpc, replaygain_track_peak);
if (value) {
replayGainInfo->trackPeak = atof(value);
free(value);
- found = 1;
+ found = true;
}
value = wavpack_tag(wpc, replaygain_album_peak);
if (value) {
replayGainInfo->albumPeak = atof(value);
free(value);
- found = 1;
+ found = true;
}
@@ -496,7 +496,7 @@ static int wavpack_open_wvc(struct decoder *decoder,
/*
* Decodes a stream.
*/
-static int
+static bool
wavpack_streamdecode(struct decoder * decoder, struct input_stream *is)
{
char error[ERRORLEN];
@@ -516,7 +516,7 @@ wavpack_streamdecode(struct decoder * decoder, struct input_stream *is)
if (wpc == NULL) {
ERROR("failed to open WavPack stream: %s\n", error);
- return -1;
+ return false;
}
wavpack_decode(decoder, wpc, can_seek(&isp), NULL);
@@ -526,13 +526,14 @@ wavpack_streamdecode(struct decoder * decoder, struct input_stream *is)
input_stream_close(&is_wvc);
input_stream_close(is);
- return 0;
+ return true;
}
/*
* Decodes a file.
*/
-static int wavpack_filedecode(struct decoder * decoder, char *fname)
+static bool
+wavpack_filedecode(struct decoder *decoder, char *fname)
{
char error[ERRORLEN];
WavpackContext *wpc;
@@ -543,7 +544,7 @@ static int wavpack_filedecode(struct decoder * decoder, char *fname)
OPEN_2CH_MAX | OPEN_NORMALIZE, 15);
if (wpc == NULL) {
ERROR("failed to open WavPack file \"%s\": %s\n", fname, error);
- return -1;
+ return false;
}
replayGainInfo = wavpack_replaygain(wpc);
@@ -555,7 +556,7 @@ static int wavpack_filedecode(struct decoder * decoder, char *fname)
WavpackCloseFile(wpc);
- return 0;
+ return true;
}
static char const *wavpackSuffixes[] = { "wv", NULL };