diff options
author | Max Kellermann <max@duempel.org> | 2008-08-26 08:27:16 +0200 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2008-08-31 03:49:24 -0700 |
commit | b2de20ad8ebdba6d78c63a32a28340faf51778c1 (patch) | |
tree | 5c1a3fafb45c48262c364d5494943cbb1f9d8687 | |
parent | e4db015707016978b6a478e06a908fb1a1577601 (diff) | |
download | mpd-b2de20ad8ebdba6d78c63a32a28340faf51778c1.tar.gz mpd-b2de20ad8ebdba6d78c63a32a28340faf51778c1.tar.xz mpd-b2de20ad8ebdba6d78c63a32a28340faf51778c1.zip |
playlist: eliminate unused fd parameters
Again, remove file descriptor parameters, which are not actually
used. These functions can also be converted to return void.
-rw-r--r-- | src/command.c | 20 | ||||
-rw-r--r-- | src/playlist.c | 40 | ||||
-rw-r--r-- | src/playlist.h | 8 |
3 files changed, 34 insertions, 34 deletions
diff --git a/src/command.c b/src/command.c index 27e7f3408..af559bd6b 100644 --- a/src/command.c +++ b/src/command.c @@ -269,10 +269,11 @@ static int handlePlayId(int fd, mpd_unused int *permission, return playPlaylistById(fd, id, 0); } -static int handleStop(int fd, mpd_unused int *permission, +static int handleStop(mpd_unused int fd, mpd_unused int *permission, mpd_unused int argc, mpd_unused char *argv[]) { - return stopPlaylist(fd); + stopPlaylist(); + return 0; } static int handleCurrentSong(int fd, mpd_unused int *permission, @@ -442,10 +443,11 @@ static int handleShuffle(int fd, mpd_unused int *permission, return shufflePlaylist(fd); } -static int handleClear(int fd, mpd_unused int *permission, +static int handleClear(mpd_unused int fd, mpd_unused int *permission, mpd_unused int argc, mpd_unused char *argv[]) { - return clearPlaylist(fd); + clearPlaylist(); + return 0; } static int handleSave(int fd, mpd_unused int *permission, @@ -717,16 +719,18 @@ static int handleUpdate(int fd, mpd_unused int *permission, return updateInit(fd, NULL); } -static int handleNext(int fd, mpd_unused int *permission, +static int handleNext(mpd_unused int fd, mpd_unused int *permission, mpd_unused int argc, mpd_unused char *argv[]) { - return nextSongInPlaylist(fd); + nextSongInPlaylist(); + return 0; } -static int handlePrevious(int fd, mpd_unused int *permission, +static int handlePrevious(mpd_unused int fd, mpd_unused int *permission, mpd_unused int argc, mpd_unused char *argv[]) { - return previousSongInPlaylist(fd); + previousSongInPlaylist(); + return 0; } static int handleListAll(int fd, mpd_unused int *permission, diff --git a/src/playlist.c b/src/playlist.c index 39e806670..0512951fd 100644 --- a/src/playlist.c +++ b/src/playlist.c @@ -94,7 +94,7 @@ static pthread_mutex_t queue_lock = PTHREAD_MUTEX_INITIALIZER; int playlist_saveAbsolutePaths = DEFAULT_PLAYLIST_SAVE_ABSOLUTE_PATHS; static void swapOrder(int a, int b); -static int play_order_num(int fd, int order_num, float seek_time); +static void play_order_num(int order_num, float seek_time); static void randomizeOrder(int start, int end); static void incrPlaylistVersion(void) @@ -219,12 +219,11 @@ void finishPlaylist(void) playlist.positionToId = NULL; } -int clearPlaylist(int fd) +void clearPlaylist(void) { int i; - if (stopPlaylist(fd) < 0) - return -1; + stopPlaylist(); for (i = 0; i < playlist.length; i++) { if (playlist.songs[i]->type == SONG_TYPE_URL) { @@ -237,8 +236,6 @@ int clearPlaylist(int fd) playlist.current = -1; incrPlaylistVersion(); - - return 0; } int clearStoredPlaylist(int fd, char *utf8file) @@ -834,9 +831,9 @@ int deleteFromPlaylist(int fd, int song) if (stop_current) { /* DEBUG(__FILE__": %d\n", __LINE__); */ if (playlist.current >= 0 && songOrder > 0) - play_order_num(fd, playlist.current, 0); + play_order_num(playlist.current, 0); else - stopPlaylist(fd); + stopPlaylist(); } else { /* DEBUG(__FILE__": %d\n", __LINE__); */ queueNextSongInPlaylist(); @@ -866,7 +863,7 @@ void deleteASongFromPlaylist(Song * song) } } -int stopPlaylist(int fd) +void stopPlaylist(void) { DEBUG("playlist: stop\n"); @@ -883,10 +880,9 @@ int stopPlaylist(int fd) playlist_state = PLAYLIST_STATE_STOP; if (playlist.random) randomizeOrder(0, playlist.length - 1); - return 0; } -static int play_order_num(int fd, int order_num, float seek_time) +static void play_order_num(int order_num, float seek_time) { char path[MPD_PATH_MAX]; enum dc_action action = seek_time ? DC_ACTION_SEEK : DC_ACTION_START; @@ -906,8 +902,6 @@ static int play_order_num(int fd, int order_num, float seek_time) dc_trigger_action(action, seek_time); if (dc.seek_where >= 0) playlist.current = order_num; - - return 0; } int playPlaylist(int fd, int song, int stopOnError) @@ -954,7 +948,8 @@ int playPlaylist(int fd, int song, int stopOnError) ERROR(__FILE__ ": %d current:%d\n", __LINE__, playlist.current); ob_trigger_action(OB_ACTION_PAUSE_UNSET); - return play_order_num(fd, i, 0); + play_order_num(i, 0); + return 0; } int playPlaylistById(int fd, int id, int stopOnError) @@ -1015,20 +1010,21 @@ void syncPlayerAndPlaylist(void) } } -int nextSongInPlaylist(int fd) +void nextSongInPlaylist(void) { int next; if (playlist_state != PLAYLIST_STATE_PLAY) - return 0; + return; playlist_stopOnError = 0; next = next_order_num(); if (next < 0) { /* we were already at last song w/o repeat: */ incrPlaylistCurrent(); - return stopPlaylist(fd); + stopPlaylist(); + return; } ob_trigger_action(OB_ACTION_PAUSE_UNSET); - return play_order_num(fd, next, 0); + play_order_num(next, 0); } int getPlaylistRepeatStatus(void) @@ -1234,7 +1230,7 @@ int setPlaylistRandomStatus(int fd, int status) return 0; } -int previousSongInPlaylist(int fd) +void previousSongInPlaylist(void) { static time_t lastTime; time_t diff = time(NULL) - lastTime; @@ -1243,7 +1239,7 @@ int previousSongInPlaylist(int fd) lastTime += diff; if (playlist_state != PLAYLIST_STATE_PLAY) - return 0; + return; syncPlaylistWithQueue(); @@ -1258,7 +1254,7 @@ int previousSongInPlaylist(int fd) prev_order_num = playlist.current; } ob_trigger_action(OB_ACTION_PAUSE_UNSET); - return play_order_num(fd, prev_order_num, 0); + play_order_num(prev_order_num, 0); } int shufflePlaylist(mpd_unused int fd) @@ -1419,7 +1415,7 @@ int seekSongInPlaylist(int fd, int song, float seek_time) } DEBUG("playlist: seek %i:\"%s\"\n", i, get_song_url(path, song_at(i))); - play_order_num(fd, i, seek_time); + play_order_num(i, seek_time); return 0; } diff --git a/src/playlist.h b/src/playlist.h index 2ba28f9e4..2e9e02a91 100644 --- a/src/playlist.h +++ b/src/playlist.h @@ -36,7 +36,7 @@ void readPlaylistState(FILE *); void savePlaylistState(FILE *); -int clearPlaylist(int fd); +void clearPlaylist(void); int clearStoredPlaylist(int fd, char *utf8file); @@ -62,17 +62,17 @@ void playlist_queue_next(void); int playlist_playing(void); -int stopPlaylist(int fd); +void stopPlaylist(void); int playPlaylist(int fd, int song, int stopOnError); int playPlaylistById(int fd, int song, int stopOnError); -int nextSongInPlaylist(int fd); +void nextSongInPlaylist(void); void syncPlayerAndPlaylist(void); -int previousSongInPlaylist(int fd); +void previousSongInPlaylist(void); int shufflePlaylist(int fd); |