Commit a234780a authored by Eric Wong's avatar Eric Wong

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
parent 0c24fc0c
...@@ -80,7 +80,7 @@ extern AudioOutputPlugin mvpPlugin; ...@@ -80,7 +80,7 @@ extern AudioOutputPlugin mvpPlugin;
extern AudioOutputPlugin shoutPlugin; extern AudioOutputPlugin shoutPlugin;
void loadAudioDrivers() { void loadAudioDrivers(void) {
initAudioOutputPlugins(); initAudioOutputPlugins();
loadAudioOutputPlugin(&alsaPlugin); loadAudioOutputPlugin(&alsaPlugin);
loadAudioOutputPlugin(&aoPlugin); loadAudioOutputPlugin(&aoPlugin);
...@@ -92,7 +92,7 @@ void loadAudioDrivers() { ...@@ -92,7 +92,7 @@ void loadAudioDrivers() {
} }
/* make sure initPlayerData is called before this function!! */ /* make sure initPlayerData is called before this function!! */
void initAudioDriver() { void initAudioDriver(void) {
ConfigParam * param = NULL; ConfigParam * param = NULL;
int i; int i;
...@@ -152,7 +152,7 @@ void getOutputAudioFormat(AudioFormat * inAudioFormat, ...@@ -152,7 +152,7 @@ void getOutputAudioFormat(AudioFormat * inAudioFormat,
else copyAudioFormat(outAudioFormat,inAudioFormat); else copyAudioFormat(outAudioFormat,inAudioFormat);
} }
void initAudioConfig() { void initAudioConfig(void) {
ConfigParam * param = getConfigParam(CONF_AUDIO_OUTPUT_FORMAT); ConfigParam * param = getConfigParam(CONF_AUDIO_OUTPUT_FORMAT);
if(NULL == param || NULL == param->value) return; if(NULL == param || NULL == param->value) return;
...@@ -232,11 +232,11 @@ int parseAudioConfig(AudioFormat * audioFormat, char * conf) { ...@@ -232,11 +232,11 @@ int parseAudioConfig(AudioFormat * audioFormat, char * conf) {
return 0; return 0;
} }
void finishAudioConfig() { void finishAudioConfig(void) {
if(audio_configFormat) free(audio_configFormat); if(audio_configFormat) free(audio_configFormat);
} }
void finishAudioDriver() { void finishAudioDriver(void) {
int i; int i;
for(i = 0; i < audioOutputArraySize; i++) { for(i = 0; i < audioOutputArraySize; i++) {
...@@ -272,7 +272,7 @@ static void syncAudioDevicesEnabledArrays(void) { ...@@ -272,7 +272,7 @@ static void syncAudioDevicesEnabledArrays(void) {
} }
} }
static int flushAudioBuffer() { static int flushAudioBuffer(void) {
int ret = -1; int ret = -1;
int i, err; int i, err;
...@@ -356,11 +356,11 @@ int playAudio(char * playChunk, int size) { ...@@ -356,11 +356,11 @@ int playAudio(char * playChunk, int size) {
return 0; return 0;
} }
int isAudioDeviceOpen() { int isAudioDeviceOpen(void) {
return audioOpened; return audioOpened;
} }
void dropBufferedAudio() { void dropBufferedAudio(void) {
int i; int i;
if(0 != memcmp(pdAudioDevicesEnabled, myAudioDevicesEnabled, if(0 != memcmp(pdAudioDevicesEnabled, myAudioDevicesEnabled,
...@@ -377,7 +377,7 @@ void dropBufferedAudio() { ...@@ -377,7 +377,7 @@ void dropBufferedAudio() {
} }
} }
void closeAudioDevice() { void closeAudioDevice(void) {
int i; int i;
flushAudioBuffer(); flushAudioBuffer();
...@@ -436,7 +436,7 @@ void printAudioDevices(FILE * fp) { ...@@ -436,7 +436,7 @@ void printAudioDevices(FILE * fp) {
} }
} }
void saveAudioDevicesState() { void saveAudioDevicesState(void) {
char *stateFile; char *stateFile;
FILE *fp; FILE *fp;
int i; int i;
...@@ -494,7 +494,7 @@ errline: ...@@ -494,7 +494,7 @@ errline:
} }
} }
void readAudioDevicesState() { void readAudioDevicesState(void) {
char *stateFile; char *stateFile;
FILE *fp; FILE *fp;
struct stat st; struct stat st;
......
...@@ -41,11 +41,11 @@ void unloadAudioOutputPlugin(AudioOutputPlugin * audioOutputPlugin) { ...@@ -41,11 +41,11 @@ void unloadAudioOutputPlugin(AudioOutputPlugin * audioOutputPlugin) {
deleteFromList(audioOutputPluginList, audioOutputPlugin->name); deleteFromList(audioOutputPluginList, audioOutputPlugin->name);
} }
void initAudioOutputPlugins() { void initAudioOutputPlugins(void) {
audioOutputPluginList = makeList(NULL, 0); audioOutputPluginList = makeList(NULL, 0);
} }
void finishAudioOutputPlugins() { void finishAudioOutputPlugins(void) {
freeList(audioOutputPluginList); freeList(audioOutputPluginList);
} }
......
...@@ -54,7 +54,7 @@ typedef struct _AlsaData { ...@@ -54,7 +54,7 @@ typedef struct _AlsaData {
int canResume; int canResume;
} AlsaData; } AlsaData;
static AlsaData * newAlsaData() { static AlsaData * newAlsaData(void) {
AlsaData * ret = malloc(sizeof(AlsaData)); AlsaData * ret = malloc(sizeof(AlsaData));
ret->device = NULL; ret->device = NULL;
...@@ -100,7 +100,7 @@ static void alsa_finishDriver(AudioOutput * audioOutput) { ...@@ -100,7 +100,7 @@ static void alsa_finishDriver(AudioOutput * audioOutput) {
freeAlsaData(ad); freeAlsaData(ad);
} }
static int alsa_testDefault() static int alsa_testDefault(void)
{ {
snd_pcm_t * handle; snd_pcm_t * handle;
......
...@@ -226,7 +226,7 @@ static void unsupportParam(OssData * od, int param, int val) { ...@@ -226,7 +226,7 @@ static void unsupportParam(OssData * od, int param, int val) {
addUnsupportedParam(od, param, val); addUnsupportedParam(od, param, val);
} }
static OssData * newOssData() { static OssData * newOssData(void) {
OssData * ret = malloc(sizeof(OssData)); OssData * ret = malloc(sizeof(OssData));
ret->device = NULL; ret->device = NULL;
...@@ -298,7 +298,7 @@ static int oss_statDevice(char * device, int * stErrno) { ...@@ -298,7 +298,7 @@ static int oss_statDevice(char * device, int * stErrno) {
return 0; return 0;
} }
static int oss_testDefault() { static int oss_testDefault(void) {
int fd; int fd;
fd = open("/dev/sound/dsp", O_WRONLY); fd = open("/dev/sound/dsp", O_WRONLY);
......
...@@ -72,7 +72,7 @@ typedef struct _ShoutData { ...@@ -72,7 +72,7 @@ typedef struct _ShoutData {
AudioFormat * audioFormat; AudioFormat * audioFormat;
} ShoutData; } ShoutData;
static ShoutData * newShoutData() { static ShoutData * newShoutData(void) {
ShoutData * ret = malloc(sizeof(ShoutData)); ShoutData * ret = malloc(sizeof(ShoutData));
ret->shoutConn = shout_new(); ret->shoutConn = shout_new();
......
...@@ -135,7 +135,7 @@ char * convStrDup(char * string) { ...@@ -135,7 +135,7 @@ char * convStrDup(char * string) {
return NULL; return NULL;
} }
static void closeCharSetConversion() { static void closeCharSetConversion(void) {
if(char_conv_to) { if(char_conv_to) {
#ifdef HAVE_ICONV #ifdef HAVE_ICONV
if(char_conv_use_iconv) iconv_close(char_conv_iconv); if(char_conv_use_iconv) iconv_close(char_conv_iconv);
......
...@@ -128,7 +128,7 @@ static CommandEntry * getCommandEntryFromString(char * string, int * permission) ...@@ -128,7 +128,7 @@ static CommandEntry * getCommandEntryFromString(char * string, int * permission)
List * commandList; List * commandList;
CommandEntry * newCommandEntry() { CommandEntry * newCommandEntry(void) {
CommandEntry * cmd = malloc(sizeof(CommandEntry)); CommandEntry * cmd = malloc(sizeof(CommandEntry));
cmd->cmd = NULL; cmd->cmd = NULL;
cmd->min = 0; cmd->min = 0;
...@@ -934,7 +934,7 @@ static int handleNotcommands(FILE * fp, unsigned int * permission, int argArrayL ...@@ -934,7 +934,7 @@ static int handleNotcommands(FILE * fp, unsigned int * permission, int argArrayL
return 0; return 0;
} }
void initCommands() { void initCommands(void) {
commandList = makeList(free, 1); commandList = makeList(free, 1);
addCommand(COMMAND_PLAY ,PERMISSION_CONTROL, 0, 1,handlePlay,NULL); addCommand(COMMAND_PLAY ,PERMISSION_CONTROL, 0, 1,handlePlay,NULL);
...@@ -995,7 +995,7 @@ void initCommands() { ...@@ -995,7 +995,7 @@ void initCommands() {
sortList(commandList); sortList(commandList);
} }
void finishCommands() { void finishCommands(void) {
freeList(commandList); freeList(commandList);
} }
......
...@@ -112,11 +112,11 @@ static void registerConfigParam(char * name, int repeatable, int block) { ...@@ -112,11 +112,11 @@ static void registerConfigParam(char * name, int repeatable, int block) {
insertInList(configEntriesList, name, entry); insertInList(configEntriesList, name, entry);
} }
void finishConf() { void finishConf(void) {
freeList(configEntriesList); freeList(configEntriesList);
} }
void initConf() { void initConf(void) {
configEntriesList = makeList((ListFreeDataFunc *)freeConfigEntry, 1); configEntriesList = makeList((ListFreeDataFunc *)freeConfigEntry, 1);
/* registerConfigParam(name, repeatable, block); */ /* registerConfigParam(name, repeatable, block); */
......
...@@ -409,7 +409,7 @@ static int sumSavedFilenameMemoryInSong(FILE * fp, Song * song, void * data) { ...@@ -409,7 +409,7 @@ static int sumSavedFilenameMemoryInSong(FILE * fp, Song * song, void * data) {
return 0; return 0;
} }
void printSavedMemoryFromFilenames() { void printSavedMemoryFromFilenames(void) {
int sum = 0; int sum = 0;
traverseAllIn(stderr, NULL, sumSavedFilenameMemoryInSong, traverseAllIn(stderr, NULL, sumSavedFilenameMemoryInSong,
......
...@@ -130,7 +130,7 @@ extern InputPlugin mpcPlugin; ...@@ -130,7 +130,7 @@ extern InputPlugin mpcPlugin;
extern InputPlugin aacPlugin; extern InputPlugin aacPlugin;
extern InputPlugin modPlugin; extern InputPlugin modPlugin;
void initInputPlugins() { void initInputPlugins(void) {
inputPlugin_list = makeList(NULL, 1); inputPlugin_list = makeList(NULL, 1);
/* load plugins here */ /* load plugins here */
...@@ -144,6 +144,6 @@ void initInputPlugins() { ...@@ -144,6 +144,6 @@ void initInputPlugins() {
loadInputPlugin(&modPlugin); loadInputPlugin(&modPlugin);
} }
void finishInputPlugins() { void finishInputPlugins(void) {
freeList(inputPlugin_list); freeList(inputPlugin_list);
} }
...@@ -39,18 +39,18 @@ ...@@ -39,18 +39,18 @@
#define MIKMOD_FRAME_SIZE 4096 #define MIKMOD_FRAME_SIZE 4096
static BOOL mod_mpd_Init() { static BOOL mod_mpd_Init(void) {
return VC_Init(); return VC_Init();
} }
static void mod_mpd_Exit() { static void mod_mpd_Exit(void) {
VC_Exit(); VC_Exit();
} }
static void mod_mpd_Update() { static void mod_mpd_Update(void) {
} }
static BOOL mod_mpd_IsThere() { static BOOL mod_mpd_IsThere(void) {
return 1; return 1;
} }
...@@ -92,7 +92,7 @@ MDRIVER drv_mpd = ...@@ -92,7 +92,7 @@ MDRIVER drv_mpd =
static int mod_mikModInitiated = 0; static int mod_mikModInitiated = 0;
static int mod_mikModInitError = 0; static int mod_mikModInitError = 0;
static int mod_initMikMod() { static int mod_initMikMod(void) {
if(mod_mikModInitError) return -1; if(mod_mikModInitError) return -1;
if(!mod_mikModInitiated) { if(!mod_mikModInitiated) {
...@@ -120,7 +120,7 @@ static int mod_initMikMod() { ...@@ -120,7 +120,7 @@ static int mod_initMikMod() {
return 0; return 0;
} }
void mod_finishMikMod() { void mod_finishMikMod(void) {
MikMod_Exit(); MikMod_Exit();
} }
......
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
#include <sys/types.h> #include <sys/types.h>
#include <unistd.h> #include <unistd.h>
void initInputStream() { void initInputStream(void) {
inputStream_initFile(); inputStream_initFile();
inputStream_initHttp(); inputStream_initHttp();
} }
......
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
#include <unistd.h> #include <unistd.h>
#include <errno.h> #include <errno.h>
void inputStream_initFile() { void inputStream_initFile(void) {
} }
int inputStream_fileOpen(InputStream * inStream, char * filename) { int inputStream_fileOpen(InputStream * inStream, char * filename) {
......
...@@ -70,7 +70,7 @@ typedef struct _InputStreemHTTPData { ...@@ -70,7 +70,7 @@ typedef struct _InputStreemHTTPData {
char * httpAuth; char * httpAuth;
} InputStreamHTTPData; } InputStreamHTTPData;
void inputStream_initHttp() { void inputStream_initHttp(void) {
ConfigParam * param = getConfigParam(CONF_HTTP_PROXY_HOST); ConfigParam * param = getConfigParam(CONF_HTTP_PROXY_HOST);
char * test; char * test;
...@@ -238,7 +238,7 @@ static char * authString(char * header, char * user, char * password) { ...@@ -238,7 +238,7 @@ static char * authString(char * header, char * user, char * password) {
#define proxyAuthString(x, y) authString(PROXY_AUTH_HEADER, x, y) #define proxyAuthString(x, y) authString(PROXY_AUTH_HEADER, x, y)
#define httpAuthString(x, y) authString(HTTP_AUTH_HEADER, x, y) #define httpAuthString(x, y) authString(HTTP_AUTH_HEADER, x, y)
static InputStreamHTTPData * newInputStreamHTTPData() { static InputStreamHTTPData * newInputStreamHTTPData(void) {
InputStreamHTTPData * ret = malloc(sizeof(InputStreamHTTPData)); InputStreamHTTPData * ret = malloc(sizeof(InputStreamHTTPData));
if(proxyHost) { if(proxyHost) {
......
...@@ -373,7 +373,7 @@ static void addInterfacesForBufferFlushToFdSet(fd_set * fds, int * fdmax) { ...@@ -373,7 +373,7 @@ static void addInterfacesForBufferFlushToFdSet(fd_set * fds, int * fdmax) {
} }
} }
static void closeNextErroredInterface() { static void closeNextErroredInterface(void) {
fd_set fds; fd_set fds;
struct timeval tv; struct timeval tv;
int i; int i;
...@@ -393,7 +393,7 @@ static void closeNextErroredInterface() { ...@@ -393,7 +393,7 @@ static void closeNextErroredInterface() {
} }
} }
int doIOForInterfaces() { int doIOForInterfaces(void) {
fd_set rfds; fd_set rfds;
fd_set wfds; fd_set wfds;
struct timeval tv; struct timeval tv;
...@@ -441,7 +441,7 @@ int doIOForInterfaces() { ...@@ -441,7 +441,7 @@ int doIOForInterfaces() {
return 1; return 1;
} }
void initInterfaces() { void initInterfaces(void) {
int i; int i;
char * test; char * test;
ConfigParam * param; ConfigParam * param;
...@@ -506,7 +506,7 @@ void initInterfaces() { ...@@ -506,7 +506,7 @@ void initInterfaces() {
} }
} }
static void closeAllInterfaces() { static void closeAllInterfaces(void) {
int i; int i;
fflush(NULL); fflush(NULL);
...@@ -518,7 +518,7 @@ static void closeAllInterfaces() { ...@@ -518,7 +518,7 @@ static void closeAllInterfaces() {
} }
} }
void freeAllInterfaces() { void freeAllInterfaces(void) {
closeAllInterfaces(); closeAllInterfaces();
free(interfaces); free(interfaces);
...@@ -526,7 +526,7 @@ void freeAllInterfaces() { ...@@ -526,7 +526,7 @@ void freeAllInterfaces() {
interface_max_connections = 0; interface_max_connections = 0;
} }
void closeOldInterfaces() { void closeOldInterfaces(void) {
int i; int i;
for(i=0;i<interface_max_connections;i++) { for(i=0;i<interface_max_connections;i++) {
......
...@@ -165,7 +165,7 @@ static int establishListen(unsigned int port, ConfigParam * param) { ...@@ -165,7 +165,7 @@ static int establishListen(unsigned int port, ConfigParam * param) {
return sock; return sock;
} }
void listenOnPort() { void listenOnPort(void) {
int port = DEFAULT_PORT; int port = DEFAULT_PORT;
ConfigParam * param = getNextConfigParam(CONF_BIND_TO_ADDRESS,NULL); ConfigParam * param = getNextConfigParam(CONF_BIND_TO_ADDRESS,NULL);
...@@ -204,7 +204,7 @@ void addListenSocketsToFdSet(fd_set * fds, int * fdmax) { ...@@ -204,7 +204,7 @@ void addListenSocketsToFdSet(fd_set * fds, int * fdmax) {
} }
} }
void closeAllListenSockets() { void closeAllListenSockets(void) {
int i; int i;
DEBUG("closeAllListenSockets called\n"); DEBUG("closeAllListenSockets called\n");
...@@ -216,7 +216,7 @@ void closeAllListenSockets() { ...@@ -216,7 +216,7 @@ void closeAllListenSockets() {
freeAllListenSockets(); freeAllListenSockets();
} }
void freeAllListenSockets() { void freeAllListenSockets(void) {
numberOfListenSockets = 0; numberOfListenSockets = 0;
free(listenSockets); free(listenSockets);
listenSockets = NULL; listenSockets = NULL;
......
...@@ -31,7 +31,7 @@ short warningFlushed = 0; ...@@ -31,7 +31,7 @@ short warningFlushed = 0;
static char * warningBuffer = NULL; static char * warningBuffer = NULL;
void initLog() { void initLog(void) {
ConfigParam * param = getConfigParam(CONF_LOG_LEVEL); ConfigParam * param = getConfigParam(CONF_LOG_LEVEL);
if(!param) return; if(!param) return;
...@@ -69,7 +69,7 @@ void bufferWarning(char * format, ... ) { ...@@ -69,7 +69,7 @@ void bufferWarning(char * format, ... ) {
va_end(arglist); va_end(arglist);
} }
void flushWarningLog() { void flushWarningLog(void) {
char * s; char * s;
DEBUG("flushing warning messages\n"); DEBUG("flushing warning messages\n");
......
...@@ -96,7 +96,7 @@ void myfprintf(FILE * fp, char * format, ... ) { ...@@ -96,7 +96,7 @@ void myfprintf(FILE * fp, char * format, ... ) {
va_end(arglist); va_end(arglist);
} }
int myfprintfCloseAndOpenLogFile() { int myfprintfCloseAndOpenLogFile(void) {
if(myfprintf_stdLogMode) { if(myfprintf_stdLogMode) {
while(fclose(myfprintf_out)<0 && errno==EINTR); while(fclose(myfprintf_out)<0 && errno==EINTR);
while(fclose(myfprintf_err)<0 && errno==EINTR); while(fclose(myfprintf_err)<0 && errno==EINTR);
...@@ -121,7 +121,7 @@ int myfprintfCloseAndOpenLogFile() { ...@@ -121,7 +121,7 @@ int myfprintfCloseAndOpenLogFile() {
return 0; return 0;
} }
void myfprintfCloseLogFile() { void myfprintfCloseLogFile(void) {
if(myfprintf_stdLogMode) { if(myfprintf_stdLogMode) {
while(fclose(myfprintf_out)<0 && errno==EINTR); while(fclose(myfprintf_out)<0 && errno==EINTR);
while(fclose(myfprintf_err)<0 && errno==EINTR); while(fclose(myfprintf_err)<0 && errno==EINTR);
......
...@@ -98,7 +98,7 @@ void setFsCharset(char * charset) { ...@@ -98,7 +98,7 @@ void setFsCharset(char * charset) {
} }
} }
char * getFsCharset() { char * getFsCharset(void) {
return fsCharset; return fsCharset;
} }
...@@ -118,7 +118,7 @@ static char * appendSlash(char ** path) { ...@@ -118,7 +118,7 @@ static char * appendSlash(char ** path) {
return temp; return temp;
} }
void initPaths() { void initPaths(void) {
ConfigParam * musicParam = parseConfigFilePath(CONF_MUSIC_DIR, 1); ConfigParam * musicParam = parseConfigFilePath(CONF_MUSIC_DIR, 1);
ConfigParam * playlistParam = parseConfigFilePath(CONF_PLAYLIST_DIR, 1); ConfigParam * playlistParam = parseConfigFilePath(CONF_PLAYLIST_DIR, 1);
ConfigParam * fsCharsetParam = getConfigParam(CONF_FS_CHARSET); ConfigParam * fsCharsetParam = getConfigParam(CONF_FS_CHARSET);
...@@ -192,7 +192,7 @@ void initPaths() { ...@@ -192,7 +192,7 @@ void initPaths() {
} }
} }
void finishPaths() { void finishPaths(void) {
free(fsCharset); free(fsCharset);
fsCharset = NULL; fsCharset = NULL;
} }
......
...@@ -68,7 +68,7 @@ static unsigned int parsePermissions(char * string) { ...@@ -68,7 +68,7 @@ static unsigned int parsePermissions(char * string) {
return permission; return permission;
} }
void initPermissions() { void initPermissions(void) {
char * temp; char * temp;
char * cp2; char * cp2;
char * password; char * password;
...@@ -129,10 +129,10 @@ int getPermissionFromPassword(char * password, unsigned int * permission) { ...@@ -129,10 +129,10 @@ int getPermissionFromPassword(char * password, unsigned int * permission) {
return -1; return -1;
} }
void finishPermissions() { void finishPermissions(void) {
freeList(permission_passwords); freeList(permission_passwords);
} }
unsigned int getDefaultPermissions() { unsigned int getDefaultPermissions(void) {
return permission_default; return permission_default;
} }
...@@ -36,7 +36,7 @@ int buffered_chunks; ...@@ -36,7 +36,7 @@ int buffered_chunks;
static PlayerData * playerData_pd; static PlayerData * playerData_pd;
int * player_pid; int * player_pid;
void initPlayerData() { void initPlayerData(void) {
float perc = DEFAULT_BUFFER_BEFORE_PLAY; float perc = DEFAULT_BUFFER_BEFORE_PLAY;
char * test; char * test;
int shmid; int shmid;
...@@ -162,11 +162,11 @@ void initPlayerData() { ...@@ -162,11 +162,11 @@ void initPlayerData() {
memset(playerData_pd->decoderControl.utf8url, 0, MAXPATHLEN+1); memset(playerData_pd->decoderControl.utf8url, 0, MAXPATHLEN+1);
} }
PlayerData * getPlayerData() { PlayerData * getPlayerData(void) {
return playerData_pd; return playerData_pd;
} }
int getPlayerPid() { int getPlayerPid(void) {
return *player_pid; return *player_pid;
} }
...@@ -174,7 +174,7 @@ void setPlayerPid(int pid) { ...@@ -174,7 +174,7 @@ void setPlayerPid(int pid) {
*player_pid = pid; *player_pid = pid;
} }
void freePlayerData() { void freePlayerData(void) {
shmdt(playerData_pd); shmdt(playerData_pd);
shmdt(player_pid); shmdt(player_pid);
} }
...@@ -92,7 +92,7 @@ static void swapOrder(int a, int b); ...@@ -92,7 +92,7 @@ static void swapOrder(int a, int b);
static int playPlaylistOrderNumber(FILE * fp, int orderNum); static int playPlaylistOrderNumber(FILE * fp, int orderNum);
static void randomizeOrder(int start, int end); static void randomizeOrder(int start, int end);
char * getStateFile() { char * getStateFile(void) {
ConfigParam * param = parseConfigFilePath(CONF_STATE_FILE, 0); ConfigParam * param = parseConfigFilePath(CONF_STATE_FILE, 0);
if(!param) return NULL; if(!param) return NULL;
...@@ -100,7 +100,7 @@ char * getStateFile() { ...@@ -100,7 +100,7 @@ char * getStateFile() {
return param->value; return param->value;
} }
static void incrPlaylistVersion() { static void incrPlaylistVersion(void) {
static unsigned long max = ((mpd_uint32)1<<31)-1; static unsigned long max = ((mpd_uint32)1<<31)-1;
playlist.version++; playlist.version++;
if(playlist.version>=max) { if(playlist.version>=max) {
...@@ -114,7 +114,7 @@ static void incrPlaylistVersion() { ...@@ -114,7 +114,7 @@ static void incrPlaylistVersion() {
} }
} }
void playlistVersionChange() { void playlistVersionChange(void) {
int i = 0; int i = 0;
for(i=0; i<playlist.length; i++) { for(i=0; i<playlist.length; i++) {
...@@ -124,7 +124,7 @@ void playlistVersionChange() { ...@@ -124,7 +124,7 @@ void playlistVersionChange() {
incrPlaylistVersion(); incrPlaylistVersion();
} }
static void incrPlaylistCurrent() { static void incrPlaylistCurrent(void) {
if(playlist.current < 0) return; if(playlist.current < 0) return;
if(playlist.current >= playlist.length-1) { if(playlist.current >= playlist.length-1) {
...@@ -134,7 +134,7 @@ static void incrPlaylistCurrent() { ...@@ -134,7 +134,7 @@ static void incrPlaylistCurrent() {
else playlist.current++; else playlist.current++;
} }
void initPlaylist() { void initPlaylist(void) {
char * test; char * test;
int i; int i;
ConfigParam * param; ConfigParam * param;
...@@ -190,7 +190,7 @@ void initPlaylist() { ...@@ -190,7 +190,7 @@ void initPlaylist() {
} }
} }
static int getNextId() { static int getNextId(void) {
static int cur = -1; static int cur = -1;
do { do {
...@@ -203,7 +203,7 @@ static int getNextId() { ...@@ -203,7 +203,7 @@ static int getNextId() {
return cur; return cur;
} }
void finishPlaylist() { void finishPlaylist(void) {
int i; int i;
for(i=0;i<playlist.length;i++) { for(i=0;i<playlist.length;i++) {
if(playlist.songs[i]->type == SONG_TYPE_URL) { if(playlist.songs[i]->type == SONG_TYPE_URL) {
...@@ -255,7 +255,7 @@ int showPlaylist(FILE * fp) { ...@@ -255,7 +255,7 @@ int showPlaylist(FILE * fp) {
return 0; return 0;
} }
void savePlaylistState() { void savePlaylistState(void) {
char * stateFile = getStateFile(); char * stateFile = getStateFile();
if(stateFile) { if(stateFile) {
...@@ -340,7 +340,7 @@ void loadPlaylistFromStateFile(FILE * fp, char * buffer, int state, int current, ...@@ -340,7 +340,7 @@ void loadPlaylistFromStateFile(FILE * fp, char * buffer, int state, int current,
} }
} }
void readPlaylistState() { void readPlaylistState(void) {
char * stateFile = getStateFile(); char * stateFile = getStateFile();
if(stateFile) { if(stateFile) {
...@@ -543,7 +543,7 @@ void swapSongs(int song1, int song2) { ...@@ -543,7 +543,7 @@ void swapSongs(int song1, int song2) {
playlist.positionToId[song2] = iTemp; playlist.positionToId[song2] = iTemp;
} }
void queueNextSongInPlaylist() { void queueNextSongInPlaylist(void) {
if(playlist.current<playlist.length-1) { if(playlist.current<playlist.length-1) {
playlist.queued = playlist.current+1; playlist.queued = playlist.current+1;
DEBUG("playlist: queue song %i:\"%s\"\n", DEBUG("playlist: queue song %i:\"%s\"\n",
...@@ -594,7 +594,7 @@ void syncPlaylistWithQueue(int queue) { ...@@ -594,7 +594,7 @@ void syncPlaylistWithQueue(int queue) {
} }
} }
void lockPlaylistInteraction() { void lockPlaylistInteraction(void) {
if(getPlayerQueueState()==PLAYER_QUEUE_PLAY || if(getPlayerQueueState()==PLAYER_QUEUE_PLAY ||
getPlayerQueueState()==PLAYER_QUEUE_FULL) { getPlayerQueueState()==PLAYER_QUEUE_FULL) {
playerQueueLock(); playerQueueLock();
...@@ -602,11 +602,11 @@ void lockPlaylistInteraction() { ...@@ -602,11 +602,11 @@ void lockPlaylistInteraction() {
} }
} }
static void unlockPlaylistInteraction() { static void unlockPlaylistInteraction(void) {
playerQueueUnlock(); playerQueueUnlock();
} }
void clearPlayerQueue() { void clearPlayerQueue(void) {
playlist.queued = -1; playlist.queued = -1;
switch(getPlayerQueueState()) { switch(getPlayerQueueState()) {
case PLAYER_QUEUE_FULL: case PLAYER_QUEUE_FULL:
...@@ -926,7 +926,7 @@ int playPlaylistById(FILE * fp, int id, int stopOnError) { ...@@ -926,7 +926,7 @@ int playPlaylistById(FILE * fp, int id, int stopOnError) {
return playPlaylist(fp, playlist.idToPosition[id], stopOnError); return playPlaylist(fp, playlist.idToPosition[id], stopOnError);
} }
void syncCurrentPlayerDecodeMetadata() { void syncCurrentPlayerDecodeMetadata(void) {
Song * songPlayer = playerCurrentDecodeSong(); Song * songPlayer = playerCurrentDecodeSong();
Song * song; Song * song;
int songNum; int songNum;
...@@ -949,7 +949,7 @@ void syncCurrentPlayerDecodeMetadata() { ...@@ -949,7 +949,7 @@ void syncCurrentPlayerDecodeMetadata() {
} }
} }
void syncPlayerAndPlaylist() { void syncPlayerAndPlaylist(void) {
if(playlist_state!=PLAYLIST_STATE_PLAY) return; if(playlist_state!=PLAYLIST_STATE_PLAY) return;
if(getPlayerState()==PLAYER_STATE_STOP) playPlaylistIfPlayerStopped(); if(getPlayerState()==PLAYER_STATE_STOP) playPlaylistIfPlayerStopped();
...@@ -995,7 +995,7 @@ int nextSongInPlaylist(FILE * fp) { ...@@ -995,7 +995,7 @@ int nextSongInPlaylist(FILE * fp) {
return 0; return 0;
} }
void playPlaylistIfPlayerStopped() { void playPlaylistIfPlayerStopped(void) {
if(getPlayerState()==PLAYER_STATE_STOP) { if(getPlayerState()==PLAYER_STATE_STOP) {
int error = getPlayerError(); int error = getPlayerError();
...@@ -1015,11 +1015,11 @@ void playPlaylistIfPlayerStopped() { ...@@ -1015,11 +1015,11 @@ void playPlaylistIfPlayerStopped() {
} }
} }
int getPlaylistRepeatStatus() { int getPlaylistRepeatStatus(void) {
return playlist.repeat; return playlist.repeat;
} }
int getPlaylistRandomStatus() { int getPlaylistRandomStatus(void) {
return playlist.random; return playlist.random;
} }
...@@ -1125,7 +1125,7 @@ int moveSongInPlaylistById(FILE * fp, int id1, int to) { ...@@ -1125,7 +1125,7 @@ int moveSongInPlaylistById(FILE * fp, int id1, int to) {
return moveSongInPlaylist(fp, playlist.idToPosition[id1], to); return moveSongInPlaylist(fp, playlist.idToPosition[id1], to);
} }
static void orderPlaylist() { static void orderPlaylist(void) {
int i; int i;
if(playlist.current >= 0 && playlist.current < playlist.length) { if(playlist.current >= 0 && playlist.current < playlist.length) {
...@@ -1359,7 +1359,7 @@ int savePlaylist(FILE * fp, char * utf8file) { ...@@ -1359,7 +1359,7 @@ int savePlaylist(FILE * fp, char * utf8file) {
return 0; return 0;
} }
int getPlaylistCurrentSong() { int getPlaylistCurrentSong(void) {
if(playlist.current >= 0 && playlist.current < playlist.length) { if(playlist.current >= 0 && playlist.current < playlist.length) {
return playlist.order[playlist.current]; return playlist.order[playlist.current];
} }
...@@ -1367,11 +1367,11 @@ int getPlaylistCurrentSong() { ...@@ -1367,11 +1367,11 @@ int getPlaylistCurrentSong() {
return -1; return -1;
} }
unsigned long getPlaylistVersion() { unsigned long getPlaylistVersion(void) {
return playlist.version; return playlist.version;
} }
int getPlaylistLength() { int getPlaylistLength(void) {
return playlist.length; return playlist.length;
} }
......
...@@ -31,7 +31,7 @@ static int replayGainState = REPLAYGAIN_OFF; ...@@ -31,7 +31,7 @@ static int replayGainState = REPLAYGAIN_OFF;
static float replayGainPreamp = 1.0; static float replayGainPreamp = 1.0;
void initReplayGainState() { void initReplayGainState(void) {
ConfigParam * param = getConfigParam(CONF_REPLAYGAIN); ConfigParam * param = getConfigParam(CONF_REPLAYGAIN);
if(!param) return; if(!param) return;
...@@ -85,7 +85,7 @@ static float computeReplayGainScale(float gain, float peak) { ...@@ -85,7 +85,7 @@ static float computeReplayGainScale(float gain, float peak) {
return(scale); return(scale);
} }
ReplayGainInfo * newReplayGainInfo() { ReplayGainInfo * newReplayGainInfo(void) {
ReplayGainInfo * ret = malloc(sizeof(ReplayGainInfo)); ReplayGainInfo * ret = malloc(sizeof(ReplayGainInfo));
ret->albumGain = 0.0; ret->albumGain = 0.0;
......
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
#include <string.h> #include <string.h>
#include <assert.h> #include <assert.h>
Song * newNullSong() { Song * newNullSong(void) {
Song * song = malloc(sizeof(Song)); Song * song = malloc(sizeof(Song));
song->tag = NULL; song->tag = NULL;
...@@ -92,7 +92,7 @@ void freeJustSong(Song * song) { ...@@ -92,7 +92,7 @@ void freeJustSong(Song * song) {
getSongUrl(NULL); getSongUrl(NULL);
} }
SongList * newSongList() { SongList * newSongList(void) {
return makeList((ListFreeDataFunc *)freeSong, 0); return makeList((ListFreeDataFunc *)freeSong, 0);
} }
......
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
Stats stats; Stats stats;
void initStats() { void initStats(void) {
stats.daemonStart = time(NULL); stats.daemonStart = time(NULL);
stats.numberOfSongs = 0; stats.numberOfSongs = 0;
} }
......
...@@ -72,7 +72,7 @@ char * mpdTagItemKeys[TAG_NUM_OF_ITEM_TYPES] = ...@@ -72,7 +72,7 @@ char * mpdTagItemKeys[TAG_NUM_OF_ITEM_TYPES] =
static mpd_sint8 ignoreTagItems[TAG_NUM_OF_ITEM_TYPES]; static mpd_sint8 ignoreTagItems[TAG_NUM_OF_ITEM_TYPES];
void initTagConfig() { void initTagConfig(void) {
int quit = 0; int quit = 0;
char * temp; char * temp;
char * s; char * s;
...@@ -450,7 +450,7 @@ fail: ...@@ -450,7 +450,7 @@ fail:
return ret; return ret;
} }
MpdTag * newMpdTag() { MpdTag * newMpdTag(void) {
MpdTag * ret = malloc(sizeof(MpdTag)); MpdTag * ret = malloc(sizeof(MpdTag));
ret->items = NULL; ret->items = NULL;
ret->time = -1; ret->time = -1;
......
...@@ -89,7 +89,7 @@ int getNumberOfTagItems(int type) { ...@@ -89,7 +89,7 @@ int getNumberOfTagItems(int type) {
return tagLists[type]->numberOfNodes; return tagLists[type]->numberOfNodes;
} }
void printMemorySavedByTagTracker() { void printMemorySavedByTagTracker(void) {
int i; int i;
ListNode * node; ListNode * node;
size_t sum = 0; size_t sum = 0;
......
...@@ -62,7 +62,7 @@ void my_usleep(long usec) { ...@@ -62,7 +62,7 @@ void my_usleep(long usec) {
select(0,NULL,NULL,NULL,&tv); select(0,NULL,NULL,NULL,&tv);
} }
int ipv6Supported() { int ipv6Supported(void) {
#ifdef HAVE_IPV6 #ifdef HAVE_IPV6
int s; int s;
s = socket(AF_INET6,SOCK_STREAM,0); s = socket(AF_INET6,SOCK_STREAM,0);
......
...@@ -144,7 +144,7 @@ static int ensure_oss_open(void) ...@@ -144,7 +144,7 @@ static int ensure_oss_open(void)
return 0; return 0;
} }
static int getOssVolumeLevel() { static int getOssVolumeLevel(void) {
int left, right, level; int left, right, level;
if (ensure_oss_open() < 0) if (ensure_oss_open() < 0)
...@@ -298,7 +298,7 @@ error: ...@@ -298,7 +298,7 @@ error:
return -1; return -1;
} }
static int getAlsaVolumeLevel() { static int getAlsaVolumeLevel(void) {
int ret; int ret;
long level; long level;
long max = volume_alsaMax; long max = volume_alsaMax;
...@@ -374,7 +374,7 @@ static int prepMixer(char * device) { ...@@ -374,7 +374,7 @@ static int prepMixer(char * device) {
return 0; return 0;
} }
void finishVolume() { void finishVolume(void) {
switch(volume_mixerType) { switch(volume_mixerType) {
#ifdef HAVE_ALSA #ifdef HAVE_ALSA
case VOLUME_MIXER_TYPE_ALSA: case VOLUME_MIXER_TYPE_ALSA:
...@@ -389,7 +389,7 @@ void finishVolume() { ...@@ -389,7 +389,7 @@ void finishVolume() {
} }
} }
void initVolume() { void initVolume(void) {
ConfigParam * param = getConfigParam(CONF_MIXER_TYPE); ConfigParam * param = getConfigParam(CONF_MIXER_TYPE);
if(param) { if(param) {
...@@ -424,18 +424,18 @@ void initVolume() { ...@@ -424,18 +424,18 @@ void initVolume() {
} }
} }
void openVolumeDevice() { void openVolumeDevice(void) {
if(prepMixer(volume_mixerDevice)<0) { if(prepMixer(volume_mixerDevice)<0) {
WARNING("using software volume\n"); WARNING("using software volume\n");
volume_mixerType = VOLUME_MIXER_TYPE_SOFTWARE; volume_mixerType = VOLUME_MIXER_TYPE_SOFTWARE;
} }
} }
static int getSoftwareVolume() { static int getSoftwareVolume(void) {
return volume_softwareSet; return volume_softwareSet;
} }
int getVolumeLevel() { int getVolumeLevel(void) {
switch(volume_mixerType) { switch(volume_mixerType) {
#ifdef HAVE_ALSA #ifdef HAVE_ALSA
case VOLUME_MIXER_TYPE_ALSA: case VOLUME_MIXER_TYPE_ALSA:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment