From 62d4fa9306fdb5dd0a1b592fd8dbdf1b679d92ca Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Thu, 30 Oct 2008 08:38:54 +0100 Subject: 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. --- src/decoder/audiofile_plugin.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/decoder/audiofile_plugin.c') diff --git a/src/decoder/audiofile_plugin.c b/src/decoder/audiofile_plugin.c index 5e5eb2cb6..5c1e0a0d0 100644 --- a/src/decoder/audiofile_plugin.c +++ b/src/decoder/audiofile_plugin.c @@ -41,7 +41,8 @@ static int getAudiofileTotalTime(char *file) return total_time; } -static int audiofile_decode(struct decoder * decoder, char *path) +static bool +audiofile_decode(struct decoder *decoder, char *path) { int fs, frame_count; AFfilehandle af_fp; @@ -55,13 +56,13 @@ static int audiofile_decode(struct decoder * decoder, char *path) if (stat(path, &st) < 0) { ERROR("failed to stat: %s\n", path); - return -1; + return false; } af_fp = afOpenFile(path, "r", NULL); if (af_fp == AF_NULL_FILEHANDLE) { ERROR("failed to open: %s\n", path); - return -1; + return false; } afSetVirtualSampleFormat(af_fp, AF_DEFAULT_TRACK, @@ -83,7 +84,7 @@ static int audiofile_decode(struct decoder * decoder, char *path) ERROR("Only 8 and 16-bit files are supported. %s is %i-bit\n", path, audio_format.bits); afCloseFile(af_fp); - return -1; + return false; } fs = (int)afGetVirtualFrameSize(af_fp, AF_DEFAULT_TRACK, 1); @@ -111,7 +112,7 @@ static int audiofile_decode(struct decoder * decoder, char *path) } while (decoder_get_command(decoder) != DECODE_COMMAND_STOP); afCloseFile(af_fp); - return 0; + return true; } static struct tag *audiofileTagDup(char *file) -- cgit v1.2.3