From: Max Kellermann Date: Wed, 30 Sep 2009 19:17:48 +0000 (+0200) Subject: screen_outputs: toggle_output() returns bool X-Git-Tag: release-0.16~252 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=bcffcd5262c95cb6d5cc9f901dfaf456e6807a18;p=ncmpc.git screen_outputs: toggle_output() returns bool --- diff --git a/src/screen_outputs.c b/src/screen_outputs.c index c40f470..75b9790 100644 --- a/src/screen_outputs.c +++ b/src/screen_outputs.c @@ -42,7 +42,7 @@ outputs_repaint(void) wrefresh(lw->w); } -static int +static bool toggle_output(struct mpdclient *c, unsigned int output_index) { struct mpd_output *output; @@ -50,7 +50,7 @@ toggle_output(struct mpdclient *c, unsigned int output_index) assert(mpd_outputs != NULL); if (output_index >= mpd_outputs->len) - return -1; + return false; output = g_ptr_array_index(mpd_outputs, output_index); @@ -58,7 +58,7 @@ toggle_output(struct mpdclient *c, unsigned int output_index) if (!mpd_run_enable_output(c->connection, mpd_output_get_id(output))) { mpdclient_handle_error(c); - return -1; + return false; } c->events |= MPD_IDLE_OUTPUT; @@ -69,7 +69,7 @@ toggle_output(struct mpdclient *c, unsigned int output_index) if (!mpd_run_disable_output(c->connection, mpd_output_get_id(output))) { mpdclient_handle_error(c); - return -1; + return false; } c->events |= MPD_IDLE_OUTPUT; @@ -78,7 +78,7 @@ toggle_output(struct mpdclient *c, unsigned int output_index) mpd_output_get_name(output)); } - return 0; + return true; } static void