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/interface.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/interface.c') diff --git a/src/interface.c b/src/interface.c index eec294477..c7efbe032 100644 --- a/src/interface.c +++ b/src/interface.c @@ -373,7 +373,7 @@ static void addInterfacesForBufferFlushToFdSet(fd_set * fds, int * fdmax) { } } -static void closeNextErroredInterface() { +static void closeNextErroredInterface(void) { fd_set fds; struct timeval tv; int i; @@ -393,7 +393,7 @@ static void closeNextErroredInterface() { } } -int doIOForInterfaces() { +int doIOForInterfaces(void) { fd_set rfds; fd_set wfds; struct timeval tv; @@ -441,7 +441,7 @@ int doIOForInterfaces() { return 1; } -void initInterfaces() { +void initInterfaces(void) { int i; char * test; ConfigParam * param; @@ -506,7 +506,7 @@ void initInterfaces() { } } -static void closeAllInterfaces() { +static void closeAllInterfaces(void) { int i; fflush(NULL); @@ -518,7 +518,7 @@ static void closeAllInterfaces() { } } -void freeAllInterfaces() { +void freeAllInterfaces(void) { closeAllInterfaces(); free(interfaces); @@ -526,7 +526,7 @@ void freeAllInterfaces() { interface_max_connections = 0; } -void closeOldInterfaces() { +void closeOldInterfaces(void) { int i; for(i=0;i