diff options
author | Eric Wong <normalperson@yhbt.net> | 2006-07-17 00:15:34 +0000 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2006-07-17 00:15:34 +0000 |
commit | a234780aab8b2d693502e03165f658f96c956969 (patch) | |
tree | f8c9a6d72a4478f6c8a769e797483dfb0ce88f2e /src/song.c | |
parent | 0c24fc0cb33dd6482670a54ed80c7dc67ebc929c (diff) | |
download | mpd-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 '')
-rw-r--r-- | src/song.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/song.c b/src/song.c index ed27667b4..6bb31d75d 100644 --- a/src/song.c +++ b/src/song.c @@ -35,7 +35,7 @@ #include <string.h> #include <assert.h> -Song * newNullSong() { +Song * newNullSong(void) { Song * song = malloc(sizeof(Song)); song->tag = NULL; @@ -92,7 +92,7 @@ void freeJustSong(Song * song) { getSongUrl(NULL); } -SongList * newSongList() { +SongList * newSongList(void) { return makeList((ListFreeDataFunc *)freeSong, 0); } |