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_control.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/decoder_control.h') diff --git a/src/decoder_control.h b/src/decoder_control.h index 0d163257d..d03d28a46 100644 --- a/src/decoder_control.h +++ b/src/decoder_control.h @@ -44,8 +44,8 @@ struct decoder_control { volatile enum decoder_state state; volatile enum decoder_command command; volatile uint16_t error; - volatile int8_t seekError; - volatile int8_t seekable; + bool seekError; + bool seekable; volatile double seekWhere; struct audio_format audioFormat; struct song *current_song; @@ -59,13 +59,13 @@ void dc_init(void); void dc_deinit(void); -static inline int decoder_is_idle(void) +static inline bool decoder_is_idle(void) { return dc.state == DECODE_STATE_STOP && dc.command != DECODE_COMMAND_START; } -static inline int decoder_is_starting(void) +static inline bool decoder_is_starting(void) { return dc.command == DECODE_COMMAND_START || dc.state == DECODE_STATE_START; @@ -93,7 +93,7 @@ dc_start_async(struct song *song); void dc_stop(struct notify *notify); -int +bool dc_seek(struct notify *notify, double where); #endif -- cgit v1.2.3