From 663cb91e4e70056a757dc3aa76dfc13c7837ae4f Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Wed, 20 Mar 2013 23:57:55 +0100 Subject: [PATCH] xmp: match function heads with prototypes and use (void) In cases where no prototype is present, this changes the function from taking an unspecified number of arguments to taking exactly zero. --- src/commands.c | 4 ++-- src/info.c | 2 +- src/main-old.c | 8 ++++---- src/sound.c | 2 +- src/sound.h | 2 +- src/sound_ahi.c | 8 ++++---- src/sound_aix.c | 8 ++++---- src/sound_alsa.c | 8 ++++---- src/sound_alsa05.c | 4 ++-- src/sound_beos.c | 20 ++++++++++---------- src/sound_bsd.c | 8 ++++---- src/sound_coreaudio.c | 12 ++++++------ src/sound_dart.c | 2 +- src/sound_file.c | 8 ++++---- src/sound_hpux.c | 8 ++++---- src/sound_netbsd.c | 8 ++++---- src/sound_null.c | 8 ++++---- src/sound_oss.c | 8 ++++---- src/sound_pulseaudio.c | 8 ++++---- src/sound_qnx.c | 8 ++++---- src/sound_sgi.c | 8 ++++---- src/sound_sndio.c | 8 ++++---- src/sound_solaris.c | 8 ++++---- src/sound_wav.c | 8 ++++---- src/sound_win32.c | 8 ++++---- src/terminal.c | 4 ++-- 26 files changed, 94 insertions(+), 94 deletions(-) diff --git a/src/commands.c b/src/commands.c index 4d5a826..ef782ed 100644 --- a/src/commands.c +++ b/src/commands.c @@ -32,7 +32,7 @@ * This makes Cygwin builds work out of the box with no fiddling around, * but does impose a neglectible cpu overhead (for Cygwin builds only). */ -static int stdin_ready_for_reading() +static int stdin_ready_for_reading(void) { fd_set fds; struct timeval tv; @@ -53,7 +53,7 @@ static int stdin_ready_for_reading() } #endif -static int read_key() +static int read_key(void) { char key; int ret; diff --git a/src/info.c b/src/info.c index 7f4f7d1..d2ad9f3 100644 --- a/src/info.c +++ b/src/info.c @@ -87,7 +87,7 @@ void info_mod(struct xmp_module_info *mi) } } -void info_frame_init() +void info_frame_init(void) { max_channels = 0; } diff --git a/src/main-old.c b/src/main-old.c index b528a30..06afbc6 100644 --- a/src/main-old.c +++ b/src/main-old.c @@ -106,7 +106,7 @@ static xmp_context ctx; static int paused; -static int set_tty() +static int set_tty(void) { #ifdef HAVE_TERMIOS_H struct termios t; @@ -129,7 +129,7 @@ static int set_tty() } -static int reset_tty() +static int reset_tty(void) { #ifdef HAVE_TERMIOS_H if (background) @@ -235,7 +235,7 @@ static void cleanup(int s) * This makes Cygwin builds work out of the box with no fiddling around, * but does impose a neglectible cpu overhead (for Cygwin builds only). */ -static int stdin_ready_for_reading() +static int stdin_ready_for_reading(void) { fd_set fds; struct timeval tv; @@ -256,7 +256,7 @@ static int stdin_ready_for_reading() } #endif -void read_keyboard() +void read_keyboard(void) { unsigned char cmd; int k; diff --git a/src/sound.c b/src/sound.c index 1036972..2b59473 100644 --- a/src/sound.c +++ b/src/sound.c @@ -37,7 +37,7 @@ static void register_sound_driver(struct sound_driver *sd) list_add_tail(&sd->list, &sound_driver_list); } -void init_sound_drivers() +void init_sound_drivers(void) { #ifdef SOUND_AHI register_sound_driver(&sound_ahi); diff --git a/src/sound.h b/src/sound.h index bcdc320..8782c00 100644 --- a/src/sound.h +++ b/src/sound.h @@ -35,7 +35,7 @@ struct sound_driver { #define chkparm2(x,y,z,w) { if (!strcmp(s, x)) { \ if (2 > sscanf(token, y, z, w)) parm_error(); } } -static inline int is_big_endian() { +static inline int is_big_endian(void) { unsigned short w = 0x00ff; return (*(char *)&w == 0x00); } diff --git a/src/sound_ahi.c b/src/sound_ahi.c index ebab17c..59bbede 100644 --- a/src/sound_ahi.c +++ b/src/sound_ahi.c @@ -51,20 +51,20 @@ static void play(void *b, int i) } } -static void deinit() +static void deinit(void) { close(fd); } -static void flush() +static void flush(void) { } -static void onpause() +static void onpause(void) { } -static void onresume() +static void onresume(void) { } diff --git a/src/sound_aix.c b/src/sound_aix.c index 23f04f7..3de574d 100644 --- a/src/sound_aix.c +++ b/src/sound_aix.c @@ -99,22 +99,22 @@ static void play(void *b, int i) }; } -static void deinit() +static void deinit(void) { control.ioctl_request = AUDIO_STOP; ioctl(audio_fd, AUDIO_CONTROL, &control); close(audio_fd); } -static void flush() +static void flush(void) { } -static void onpause() +static void onpause(void) { } -static void onresume() +static void onresume(void) { } diff --git a/src/sound_alsa.c b/src/sound_alsa.c index 5d5c0fa..48713bf 100644 --- a/src/sound_alsa.c +++ b/src/sound_alsa.c @@ -91,21 +91,21 @@ static void play(void *b, int i) } } -static void deinit() +static void deinit(void) { snd_pcm_close(pcm_handle); } -static void flush() +static void flush(void) { snd_pcm_drain(pcm_handle); } -static void onpause() +static void onpause(void) { } -static void onresume() +static void onresume(void) { } diff --git a/src/sound_alsa05.c b/src/sound_alsa05.c index cdcb2b5..36b9ccf 100644 --- a/src/sound_alsa05.c +++ b/src/sound_alsa05.c @@ -182,13 +182,13 @@ static void play(void *b, int i) } } -static void deinit() +static void deinit(void) { snd_pcm_close(pcm_handle); free(mybuffer); } -static void flush() +static void flush(void) { snd_pcm_plugin_flush(pcm_handle, SND_PCM_CHANNEL_PLAYBACK); prepare_driver(); diff --git a/src/sound_beos.c b/src/sound_beos.c index 93e6124..99e0355 100644 --- a/src/sound_beos.c +++ b/src/sound_beos.c @@ -43,11 +43,11 @@ static const char *const help[] = { }; static int init(struct options *options); -static void deinit(); +static void deinit(void); static void play(void *b, int i); -static void flush(); -static void onpause(); -static void onresume(); +static void flush(void); +static void onpause(void); +static void onresume(void); struct sound_driver sound_beos = { "beos", @@ -64,7 +64,7 @@ struct sound_driver sound_beos = { /* return minimum number of free bytes in buffer, value may change between * two immediately following calls, and the real number of free bytes * might actually be larger! */ -static int buf_free() +static int buf_free(void) { int free = buf_read_pos - buf_write_pos - chunk_size; if (free < 0) @@ -75,7 +75,7 @@ static int buf_free() /* return minimum number of buffered bytes, value may change between * two immediately following calls, and the real number of buffered bytes * might actually be larger! */ -static int buf_used() +static int buf_used(void) { int used = buf_write_pos - buf_read_pos; if (used < 0) @@ -205,22 +205,22 @@ static void play(void *b, int i) } } -static void deinit() +static void deinit(void) { player->Stop(); be_app->Lock(); be_app->Quit(); } -static void flush() +static void flush(void) { } -static void onpause() +static void onpause(void) { } -static void onresume() +static void onresume(void) { } diff --git a/src/sound_bsd.c b/src/sound_bsd.c index bc3e8cf..e2fde23 100644 --- a/src/sound_bsd.c +++ b/src/sound_bsd.c @@ -77,20 +77,20 @@ static void play(void *b, int i) } } -static void deinit() +static void deinit(void) { close(audio_fd); } -static void flush() +static void flush(void) { } -static void onpause() +static void onpause(void) { } -static void onresume() +static void onresume(void) { } diff --git a/src/sound_coreaudio.c b/src/sound_coreaudio.c index 20e0e26..2fb1893 100644 --- a/src/sound_coreaudio.c +++ b/src/sound_coreaudio.c @@ -33,7 +33,7 @@ static int packet_size; /* return minimum number of free bytes in buffer, value may change between * two immediately following calls, and the real number of free bytes * might actually be larger! */ -static int buf_free() +static int buf_free(void) { int free = buf_read_pos - buf_write_pos - chunk_size; if (free < 0) @@ -44,7 +44,7 @@ static int buf_free() /* return minimum number of buffered bytes, value may change between * two immediately following calls, and the real number of buffered bytes * might actually be larger! */ -static int buf_used() +static int buf_used(void) { int used = buf_write_pos - buf_read_pos; if (used < 0) @@ -246,7 +246,7 @@ static void play(void *b, int i) } -static void deinit() +static void deinit(void) { AudioOutputUnitStop(au); AudioUnitUninitialize(au); @@ -254,15 +254,15 @@ static void deinit() free(buffer); } -static void flush() +static void flush(void) { } -static void onpause() +static void onpause(void) { } -static void onresume() +static void onresume(void) { } diff --git a/src/sound_dart.c b/src/sound_dart.c index 1a49359..f1a11f3 100644 --- a/src/sound_dart.c +++ b/src/sound_dart.c @@ -195,7 +195,7 @@ static void play(void *b, int i) } -static void deinit() +static void deinit(void) { if (MixBuffers[0].pBuffer) { mciSendCommand(DeviceID, MCI_BUFFER, diff --git a/src/sound_file.c b/src/sound_file.c index 51c3d2f..fa691ce 100644 --- a/src/sound_file.c +++ b/src/sound_file.c @@ -73,20 +73,20 @@ static void play(void *b, int len) size += len; } -static void deinit() +static void deinit(void) { free(sound_file.description); } -static void flush() +static void flush(void) { } -static void onpause() +static void onpause(void) { } -static void onresume() +static void onresume(void) { } diff --git a/src/sound_hpux.c b/src/sound_hpux.c index 5ebf352..bffd6a3 100644 --- a/src/sound_hpux.c +++ b/src/sound_hpux.c @@ -122,20 +122,20 @@ static void play(void *b, int i) } } -static void deinit() +static void deinit(void) { close(audio_fd); } -static void flush() +static void flush(void) { } -static void onpause() +static void onpause(void) { } -static void onresume() +static void onresume(void) { } diff --git a/src/sound_netbsd.c b/src/sound_netbsd.c index 770cb59..f746ae2 100644 --- a/src/sound_netbsd.c +++ b/src/sound_netbsd.c @@ -105,20 +105,20 @@ static void play(void *b, int i) } } -static void deinit() +static void deinit(void) { close(audio_fd); } -static void flush() +static void flush(void) { } -static void onpause() +static void onpause(void) { } -static void onresume() +static void onresume(void) { } diff --git a/src/sound_null.c b/src/sound_null.c index 81bd640..9d18f32 100644 --- a/src/sound_null.c +++ b/src/sound_null.c @@ -18,19 +18,19 @@ static void play(void *b, int i) { } -static void deinit() +static void deinit(void) { } -static void flush() +static void flush(void) { } -static void onpause() +static void onpause(void) { } -static void onresume() +static void onresume(void) { } diff --git a/src/sound_oss.c b/src/sound_oss.c index e728042..9b0e8a6 100644 --- a/src/sound_oss.c +++ b/src/sound_oss.c @@ -161,17 +161,17 @@ static void play(void *b, int i) }; } -static void deinit() +static void deinit(void) { ioctl(audio_fd, SNDCTL_DSP_RESET, NULL); close(audio_fd); } -static void flush() +static void flush(void) { } -static void onpause() +static void onpause(void) { #ifdef SNDCTL_DSP_SETTRIGGER int trig = 0; @@ -184,7 +184,7 @@ static void onpause() ioctl(audio_fd, SNDCTL_DSP_SYNC, NULL); } -static void onresume() +static void onresume(void) { #ifdef SNDCTL_DSP_SETTRIGGER int trig = PCM_ENABLE_OUTPUT; diff --git a/src/sound_pulseaudio.c b/src/sound_pulseaudio.c index 20ff678..8058758 100644 --- a/src/sound_pulseaudio.c +++ b/src/sound_pulseaudio.c @@ -60,12 +60,12 @@ static void play(void *b, int i) } } -static void deinit() +static void deinit(void) { pa_simple_free(s); } -static void flush() +static void flush(void) { int error; @@ -74,11 +74,11 @@ static void flush() } } -static void onpause() +static void onpause(void) { } -static void onresume() +static void onresume(void) { } diff --git a/src/sound_qnx.c b/src/sound_qnx.c index b6311ee..486e7d8 100644 --- a/src/sound_qnx.c +++ b/src/sound_qnx.c @@ -87,21 +87,21 @@ static void play(void *b, int i) } while (i); } -static void deinit() +static void deinit(void) { close(fd_audio); } -static void flush() +static void flush(void) { ioctl(fd, SNDCTL_DSP_SYNC, NULL); } -static void onpause() +static void onpause(void) { } -static void onresume() +static void onresume(void) { } diff --git a/src/sound_sgi.c b/src/sound_sgi.c index cff8016..da7b16f 100644 --- a/src/sound_sgi.c +++ b/src/sound_sgi.c @@ -150,20 +150,20 @@ static void play(void *b, int i) ALwritesamps(audio_port, b, i); } -static void deinit() +static void deinit(void) { ALcloseport(audio_port); } -static void flush() +static void flush(void) { } -static void onpause() +static void onpause(void) { } -static void onresume() +static void onresume(void) { } diff --git a/src/sound_sndio.c b/src/sound_sndio.c index 74c9535..ea51b55 100644 --- a/src/sound_sndio.c +++ b/src/sound_sndio.c @@ -76,7 +76,7 @@ static int init(struct options *options) return -1; } -static void deinit() +static void deinit(void) { sio_close(hdl); hdl = NULL; @@ -89,15 +89,15 @@ static void play(void *buf, int len) } } -static void flush() +static void flush(void) { } -static void onpause() +static void onpause(void) { } -static void onresume() +static void onresume(void) { } diff --git a/src/sound_solaris.c b/src/sound_solaris.c index d8254e7..6c2f90d 100644 --- a/src/sound_solaris.c +++ b/src/sound_solaris.c @@ -153,20 +153,20 @@ static void play(void *b, int i) } } -static void deinit() +static void deinit(void) { close(audio_fd); } -static void flush() +static void flush(void) { } -static void onpause() +static void onpause(void) { } -static void onresume() +static void onresume(void) { } diff --git a/src/sound_wav.c b/src/sound_wav.c index 91e36b3..358a83b 100644 --- a/src/sound_wav.c +++ b/src/sound_wav.c @@ -134,7 +134,7 @@ static void play(void *b, int len) size += len; } -static void deinit() +static void deinit(void) { lseek(fd, 40, SEEK_SET); write_32l(fd, size); @@ -149,15 +149,15 @@ static void deinit() free(sound_wav.description); } -static void flush() +static void flush(void) { } -static void onpause() +static void onpause(void) { } -static void onresume() +static void onresume(void) { } diff --git a/src/sound_win32.c b/src/sound_win32.c index 4edc1f0..a9ad0b8 100644 --- a/src/sound_win32.c +++ b/src/sound_win32.c @@ -134,7 +134,7 @@ static void play(void *b, int len) nextbuffer %= num_buffers; } -static void deinit() +static void deinit(void) { int i; @@ -151,15 +151,15 @@ static void deinit() } } -static void flush() +static void flush(void) { } -static void onpause() +static void onpause(void) { } -static void onresume() +static void onresume(void) { } diff --git a/src/terminal.c b/src/terminal.c index 02eec2d..295b35e 100644 --- a/src/terminal.c +++ b/src/terminal.c @@ -17,7 +17,7 @@ static struct termios term; #endif -int set_tty() +int set_tty(void) { #ifdef HAVE_TERMIOS_H struct termios t; @@ -38,7 +38,7 @@ int set_tty() return 0; } -int reset_tty() +int reset_tty(void) { #ifdef HAVE_TERMIOS_H if (!isatty(STDIN_FILENO))