From 5c19776f2fc1416dab1da2f2baae9a0c764df965 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sun, 26 Oct 2008 20:56:46 +0100 Subject: input_stream: use "bool" instead of "int" For boolean values and success flags, use bool instead of integer (1/0 for true/false, 0/-1 for success/failure). --- src/decoder/wavpack_plugin.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/decoder/wavpack_plugin.c') diff --git a/src/decoder/wavpack_plugin.c b/src/decoder/wavpack_plugin.c index 7a0a2249f..86b01164e 100644 --- a/src/decoder/wavpack_plugin.c +++ b/src/decoder/wavpack_plugin.c @@ -366,12 +366,14 @@ static uint32_t get_pos(void *id) static int set_pos_abs(void *id, uint32_t pos) { - return input_stream_seek(((InputStreamPlus *)id)->is, pos, SEEK_SET); + return input_stream_seek(((InputStreamPlus *)id)->is, pos, SEEK_SET) + ? 0 : -1; } static int set_pos_rel(void *id, int32_t delta, int mode) { - return input_stream_seek(((InputStreamPlus *)id)->is, delta, mode); + return input_stream_seek(((InputStreamPlus *)id)->is, delta, mode) + ? 0 : -1; } static int push_back_byte(void *id, int c) @@ -439,7 +441,7 @@ static int wavpack_open_wvc(struct decoder *decoder, const char *utf8url; size_t len; char *wvc_url = NULL; - int ret; + bool ret; /* * As we use dc->utf8url, this function will be bad for @@ -464,7 +466,7 @@ static int wavpack_open_wvc(struct decoder *decoder, ret = input_stream_open(is_wvc, wvc_url); free(wvc_url); - if (ret) + if (!ret) return 0; /* -- cgit v1.2.3