aboutsummaryrefslogtreecommitdiffstats
path: root/src/playlist.c
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2006-07-17 00:15:34 +0000
committerEric Wong <normalperson@yhbt.net>2006-07-17 00:15:34 +0000
commita234780aab8b2d693502e03165f658f96c956969 (patch)
treef8c9a6d72a4478f6c8a769e797483dfb0ce88f2e /src/playlist.c
parent0c24fc0cb33dd6482670a54ed80c7dc67ebc929c (diff)
downloadmpd-a234780aab8b2d693502e03165f658f96c956969.tar.gz
mpd-a234780aab8b2d693502e03165f658f96c956969.tar.xz
mpd-a234780aab8b2d693502e03165f658f96c956969.zip
sparse: ANSI-fy function declarations
These are just warnings from sparse, but it makes the output easier to read. I ran this through a quick perl script, but of course verified the output by looking at the diff and making sure the thing still compiles. here's the quick perl script I wrote to generate this patch: ----------- 8< ----------- use Tie::File; defined(my $pid = open my $fh, '-|') or die $!; if (!$pid) { open STDERR, '>&STDOUT' or die $!; exec 'sparse', @ARGV or die $!; } my $na = 'warning: non-ANSI function declaration of function'; while (<$fh>) { print STDERR $_; if (/^(.+?\.[ch]):(\d+):(\d+): $na '(\w+)'/o) { my ($f, $l, $pos, $func) = ($1, $2, $3, $4); $l--; tie my @x, 'Tie::File', $f or die "$!: $f"; print '-', $x[$l], "\n"; $x[$l] =~ s/\b($func\s*)\(\s*\)/$1(void)/; print '+', $x[$l], "\n"; untie @x; } } git-svn-id: https://svn.musicpd.org/mpd/trunk@4378 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to 'src/playlist.c')
-rw-r--r--src/playlist.c44
1 files changed, 22 insertions, 22 deletions
diff --git a/src/playlist.c b/src/playlist.c
index 395688aeb..e48cc8c35 100644
--- a/src/playlist.c
+++ b/src/playlist.c
@@ -92,7 +92,7 @@ static void swapOrder(int a, int b);
static int playPlaylistOrderNumber(FILE * fp, int orderNum);
static void randomizeOrder(int start, int end);
-char * getStateFile() {
+char * getStateFile(void) {
ConfigParam * param = parseConfigFilePath(CONF_STATE_FILE, 0);
if(!param) return NULL;
@@ -100,7 +100,7 @@ char * getStateFile() {
return param->value;
}
-static void incrPlaylistVersion() {
+static void incrPlaylistVersion(void) {
static unsigned long max = ((mpd_uint32)1<<31)-1;
playlist.version++;
if(playlist.version>=max) {
@@ -114,7 +114,7 @@ static void incrPlaylistVersion() {
}
}
-void playlistVersionChange() {
+void playlistVersionChange(void) {
int i = 0;
for(i=0; i<playlist.length; i++) {
@@ -124,7 +124,7 @@ void playlistVersionChange() {
incrPlaylistVersion();
}
-static void incrPlaylistCurrent() {
+static void incrPlaylistCurrent(void) {
if(playlist.current < 0) return;
if(playlist.current >= playlist.length-1) {
@@ -134,7 +134,7 @@ static void incrPlaylistCurrent() {
else playlist.current++;
}
-void initPlaylist() {
+void initPlaylist(void) {
char * test;
int i;
ConfigParam * param;
@@ -190,7 +190,7 @@ void initPlaylist() {
}
}
-static int getNextId() {
+static int getNextId(void) {
static int cur = -1;
do {
@@ -203,7 +203,7 @@ static int getNextId() {
return cur;
}
-void finishPlaylist() {
+void finishPlaylist(void) {
int i;
for(i=0;i<playlist.length;i++) {
if(playlist.songs[i]->type == SONG_TYPE_URL) {
@@ -255,7 +255,7 @@ int showPlaylist(FILE * fp) {
return 0;
}
-void savePlaylistState() {
+void savePlaylistState(void) {
char * stateFile = getStateFile();
if(stateFile) {
@@ -340,7 +340,7 @@ void loadPlaylistFromStateFile(FILE * fp, char * buffer, int state, int current,
}
}
-void readPlaylistState() {
+void readPlaylistState(void) {
char * stateFile = getStateFile();
if(stateFile) {
@@ -543,7 +543,7 @@ void swapSongs(int song1, int song2) {
playlist.positionToId[song2] = iTemp;
}
-void queueNextSongInPlaylist() {
+void queueNextSongInPlaylist(void) {
if(playlist.current<playlist.length-1) {
playlist.queued = playlist.current+1;
DEBUG("playlist: queue song %i:\"%s\"\n",
@@ -594,7 +594,7 @@ void syncPlaylistWithQueue(int queue) {
}
}
-void lockPlaylistInteraction() {
+void lockPlaylistInteraction(void) {
if(getPlayerQueueState()==PLAYER_QUEUE_PLAY ||
getPlayerQueueState()==PLAYER_QUEUE_FULL) {
playerQueueLock();
@@ -602,11 +602,11 @@ void lockPlaylistInteraction() {
}
}
-static void unlockPlaylistInteraction() {
+static void unlockPlaylistInteraction(void) {
playerQueueUnlock();
}
-void clearPlayerQueue() {
+void clearPlayerQueue(void) {
playlist.queued = -1;
switch(getPlayerQueueState()) {
case PLAYER_QUEUE_FULL:
@@ -926,7 +926,7 @@ int playPlaylistById(FILE * fp, int id, int stopOnError) {
return playPlaylist(fp, playlist.idToPosition[id], stopOnError);
}
-void syncCurrentPlayerDecodeMetadata() {
+void syncCurrentPlayerDecodeMetadata(void) {
Song * songPlayer = playerCurrentDecodeSong();
Song * song;
int songNum;
@@ -949,7 +949,7 @@ void syncCurrentPlayerDecodeMetadata() {
}
}
-void syncPlayerAndPlaylist() {
+void syncPlayerAndPlaylist(void) {
if(playlist_state!=PLAYLIST_STATE_PLAY) return;
if(getPlayerState()==PLAYER_STATE_STOP) playPlaylistIfPlayerStopped();
@@ -995,7 +995,7 @@ int nextSongInPlaylist(FILE * fp) {
return 0;
}
-void playPlaylistIfPlayerStopped() {
+void playPlaylistIfPlayerStopped(void) {
if(getPlayerState()==PLAYER_STATE_STOP) {
int error = getPlayerError();
@@ -1015,11 +1015,11 @@ void playPlaylistIfPlayerStopped() {
}
}
-int getPlaylistRepeatStatus() {
+int getPlaylistRepeatStatus(void) {
return playlist.repeat;
}
-int getPlaylistRandomStatus() {
+int getPlaylistRandomStatus(void) {
return playlist.random;
}
@@ -1125,7 +1125,7 @@ int moveSongInPlaylistById(FILE * fp, int id1, int to) {
return moveSongInPlaylist(fp, playlist.idToPosition[id1], to);
}
-static void orderPlaylist() {
+static void orderPlaylist(void) {
int i;
if(playlist.current >= 0 && playlist.current < playlist.length) {
@@ -1359,7 +1359,7 @@ int savePlaylist(FILE * fp, char * utf8file) {
return 0;
}
-int getPlaylistCurrentSong() {
+int getPlaylistCurrentSong(void) {
if(playlist.current >= 0 && playlist.current < playlist.length) {
return playlist.order[playlist.current];
}
@@ -1367,11 +1367,11 @@ int getPlaylistCurrentSong() {
return -1;
}
-unsigned long getPlaylistVersion() {
+unsigned long getPlaylistVersion(void) {
return playlist.version;
}
-int getPlaylistLength() {
+int getPlaylistLength(void) {
return playlist.length;
}