From a234780aab8b2d693502e03165f658f96c956969 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Mon, 17 Jul 2006 00:15:34 +0000 Subject: 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 --- src/playlist.c | 44 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) (limited to 'src/playlist.c') 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-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;itype == 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= 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; } -- cgit v1.2.3