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
This commit is contained in:
@@ -54,7 +54,7 @@ typedef struct _AlsaData {
|
||||
int canResume;
|
||||
} AlsaData;
|
||||
|
||||
static AlsaData * newAlsaData() {
|
||||
static AlsaData * newAlsaData(void) {
|
||||
AlsaData * ret = malloc(sizeof(AlsaData));
|
||||
|
||||
ret->device = NULL;
|
||||
@@ -100,7 +100,7 @@ static void alsa_finishDriver(AudioOutput * audioOutput) {
|
||||
freeAlsaData(ad);
|
||||
}
|
||||
|
||||
static int alsa_testDefault()
|
||||
static int alsa_testDefault(void)
|
||||
{
|
||||
snd_pcm_t * handle;
|
||||
|
||||
|
||||
@@ -226,7 +226,7 @@ static void unsupportParam(OssData * od, int param, int val) {
|
||||
addUnsupportedParam(od, param, val);
|
||||
}
|
||||
|
||||
static OssData * newOssData() {
|
||||
static OssData * newOssData(void) {
|
||||
OssData * ret = malloc(sizeof(OssData));
|
||||
|
||||
ret->device = NULL;
|
||||
@@ -298,7 +298,7 @@ static int oss_statDevice(char * device, int * stErrno) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int oss_testDefault() {
|
||||
static int oss_testDefault(void) {
|
||||
int fd;
|
||||
|
||||
fd = open("/dev/sound/dsp", O_WRONLY);
|
||||
|
||||
@@ -72,7 +72,7 @@ typedef struct _ShoutData {
|
||||
AudioFormat * audioFormat;
|
||||
} ShoutData;
|
||||
|
||||
static ShoutData * newShoutData() {
|
||||
static ShoutData * newShoutData(void) {
|
||||
ShoutData * ret = malloc(sizeof(ShoutData));
|
||||
|
||||
ret->shoutConn = shout_new();
|
||||
|
||||
Reference in New Issue
Block a user