From 113c1c0af5383d356c9e527f8763566aa5a63ea1 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Tue, 26 Aug 2008 08:27:17 +0200 Subject: queueSong() cannot fail All (indirect) callers of queueSong() ensure that the queue state is BLANK, so there is no need to check it in queueSong() again. As a side effect, queueSong() cannot fail anymore, and can return void. Also, playlist_queueError and all its error handling can go away. --- src/player.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'src/player.c') diff --git a/src/player.c b/src/player.c index 2df6b6cd1..84fd163fe 100644 --- a/src/player.c +++ b/src/player.c @@ -165,15 +165,12 @@ char *getPlayerErrorStr(void) return *error ? error : NULL; } -int queueSong(Song * song) +void queueSong(Song * song) { - if (pc.queueState == PLAYER_QUEUE_BLANK) { - set_current_song(song); - pc.queueState = PLAYER_QUEUE_FULL; - return 0; - } + assert(pc.queueState == PLAYER_QUEUE_BLANK); - return -1; + set_current_song(song); + pc.queueState = PLAYER_QUEUE_FULL; } enum player_queue_state getPlayerQueueState(void) -- cgit v1.2.3