diff options
author | rathann <rathann@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2006-02-09 14:08:03 +0000 |
---|---|---|
committer | rathann <rathann@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2006-02-09 14:08:03 +0000 |
commit | e7db4ccf1afbb6653ae1aae44b1c96c724361985 (patch) | |
tree | 9cc7321a75460de67bd0dae4e940b73439a1374b /libao2 | |
parent | 1f34ddefd2546a37c6efe4fcd9ea3f7627af4a5d (diff) | |
download | mpv-e7db4ccf1afbb6653ae1aae44b1c96c724361985.tar.bz2 mpv-e7db4ccf1afbb6653ae1aae44b1c96c724361985.tar.xz |
Patch by Stefan Huehner / stefan % huehner ! org \
patch replaces '()' for the correct '(void)' in function
declarations/prototypes which have no parameters. The '()' syntax tell
thats there is a variable list of arguments, so that the compiler cannot
check this. The extra CFLAG '-Wstrict-declarations' shows those cases.
Comments about a similar patch applied to ffmpeg:
That in C++ these mean the same, but in ANSI C the semantics are
different; function() is an (obsolete) K&R C style forward declaration,
it basically means that the function can have any number and any types
of parameters, effectively completely preventing the compiler from doing
any sort of type checking. -- Erik Slagter
Defining functions with unspecified arguments is allowed but bad.
With arguments unspecified the compiler can't report an error/warning
if the function is called with incorrect arguments. -- Måns Rullgård
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@17567 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libao2')
-rw-r--r-- | libao2/ao_alsa.c | 12 | ||||
-rw-r--r-- | libao2/ao_arts.c | 10 | ||||
-rw-r--r-- | libao2/ao_esd.c | 10 | ||||
-rw-r--r-- | libao2/ao_mpegpes.c | 10 | ||||
-rw-r--r-- | libao2/ao_nas.c | 10 | ||||
-rw-r--r-- | libao2/ao_null.c | 12 | ||||
-rw-r--r-- | libao2/ao_oss.c | 10 | ||||
-rw-r--r-- | libao2/ao_pcm.c | 10 | ||||
-rw-r--r-- | libao2/ao_sdl.c | 14 | ||||
-rw-r--r-- | libao2/audio_out.c | 2 | ||||
-rw-r--r-- | libao2/audio_out.h | 12 | ||||
-rw-r--r-- | libao2/audio_out_internal.h | 12 |
12 files changed, 62 insertions, 62 deletions
diff --git a/libao2/ao_alsa.c b/libao2/ao_alsa.c index da0017d094..402f89264f 100644 --- a/libao2/ao_alsa.c +++ b/libao2/ao_alsa.c @@ -237,7 +237,7 @@ static void parse_device (char *dest, const char *src, int len) tmp[0] = ':'; } -static void print_help () +static void print_help (void) { mp_msg (MSGT_AO, MSGL_FATAL, "\n-ao alsa commandline help:\n" @@ -725,7 +725,7 @@ static void uninit(int immed) } } -static void audio_pause() +static void audio_pause(void) { int err; @@ -745,7 +745,7 @@ static void audio_pause() } } -static void audio_resume() +static void audio_resume(void) { int err; @@ -766,7 +766,7 @@ static void audio_resume() } /* stop playing and empty buffers (for seeking/pause) */ -static void reset() +static void reset(void) { int err; @@ -1030,7 +1030,7 @@ static int play_mmap(void* data, int len) } /* how many byes are free in the buffer */ -static int get_space() +static int get_space(void) { snd_pcm_status_t *status; int ret; @@ -1100,7 +1100,7 @@ static int get_space() } /* delay in seconds between first and last sample in buffer */ -static float get_delay() +static float get_delay(void) { if (alsa_handler) { diff --git a/libao2/ao_arts.c b/libao2/ao_arts.c index 35e678b9e0..96379560a0 100644 --- a/libao2/ao_arts.c +++ b/libao2/ao_arts.c @@ -112,24 +112,24 @@ static int play(void* data,int len,int flags) return arts_write(stream, data, len); } -static void audio_pause() +static void audio_pause(void) { } -static void audio_resume() +static void audio_resume(void) { } -static void reset() +static void reset(void) { } -static int get_space() +static int get_space(void) { return arts_stream_get(stream, ARTS_P_BUFFER_SPACE); } -static float get_delay() +static float get_delay(void) { return ((float) (ao_data.buffersize - arts_stream_get(stream, ARTS_P_BUFFER_SPACE))) / ((float) ao_data.bps); diff --git a/libao2/ao_esd.c b/libao2/ao_esd.c index 2ce2efc7c5..297787f6c8 100644 --- a/libao2/ao_esd.c +++ b/libao2/ao_esd.c @@ -346,7 +346,7 @@ static int play(void* data, int len, int flags) /* * stop playing, keep buffers (for pause) */ -static void audio_pause() +static void audio_pause(void) { /* * not possible with esd. the esd daemom will continue playing @@ -358,7 +358,7 @@ static void audio_pause() /* * resume playing, after audio_pause() */ -static void audio_resume() +static void audio_resume(void) { /* * not possible with esd. @@ -375,7 +375,7 @@ static void audio_resume() /* * stop playing and empty buffers (for seeking/pause) */ -static void reset() +static void reset(void) { #ifdef __svr4__ /* throw away data buffered in the esd connection */ @@ -388,7 +388,7 @@ static void reset() /* * return: how many bytes can be played without blocking */ -static int get_space() +static int get_space(void) { struct timeval tmout; fd_set wfds; @@ -432,7 +432,7 @@ static int get_space() /* * return: delay in seconds between first and last sample in buffer */ -static float get_delay() +static float get_delay(void) { struct timeval now; double buffered_samples_time; diff --git a/libao2/ao_mpegpes.c b/libao2/ao_mpegpes.c index 925d78b609..ec856a6671 100644 --- a/libao2/ao_mpegpes.c +++ b/libao2/ao_mpegpes.c @@ -137,19 +137,19 @@ static void uninit(int immed){ } // stop playing and empty buffers (for seeking/pause) -static void reset(){ +static void reset(void){ } // stop playing, keep buffers (for pause) -static void audio_pause() +static void audio_pause(void) { // for now, just call reset(); reset(); } // resume playing, after audio_pause() -static void audio_resume() +static void audio_resume(void) { } @@ -158,7 +158,7 @@ void send_lpcm_packet(unsigned char* data,int len,int id,int timestamp,int freq_ extern int vo_pts; // return: how many bytes can be played without blocking -static int get_space(){ +static int get_space(void){ float x=(float)(vo_pts-ao_data.pts)/90000.0; int y; // printf("vo_pts: %5.3f ao_pts: %5.3f\n",vo_pts/90000.0,ao_data.pts/90000.0); @@ -189,7 +189,7 @@ static int play(void* data,int len,int flags){ } // return: delay in seconds between first and last sample in buffer -static float get_delay(){ +static float get_delay(void){ return 0.0; } diff --git a/libao2/ao_nas.c b/libao2/ao_nas.c index f4c74dd7cb..aba055b683 100644 --- a/libao2/ao_nas.c +++ b/libao2/ao_nas.c @@ -506,7 +506,7 @@ static void uninit(int immed){ } // stop playing and empty buffers (for seeking/pause) -static void reset(){ +static void reset(void){ AuStatus as; mp_msg(MSGT_AO, MSGL_DBG3, "ao_nas: reset()\n"); @@ -523,7 +523,7 @@ static void reset(){ } // stop playing, keep buffers (for pause) -static void audio_pause() +static void audio_pause(void) { AuStatus as; mp_msg(MSGT_AO, MSGL_DBG3, "ao_nas: audio_pause()\n"); @@ -532,7 +532,7 @@ static void audio_pause() } // resume playing, after audio_pause() -static void audio_resume() +static void audio_resume(void) { AuStatus as; @@ -546,7 +546,7 @@ static void audio_resume() // return: how many bytes can be played without blocking -static int get_space() +static int get_space(void) { int result; @@ -597,7 +597,7 @@ static int play(void* data,int len,int flags) } // return: delay in seconds between first and last sample in buffer -static float get_delay() +static float get_delay(void) { float result; diff --git a/libao2/ao_null.c b/libao2/ao_null.c index 70e3a52b31..7189d98fdf 100644 --- a/libao2/ao_null.c +++ b/libao2/ao_null.c @@ -20,7 +20,7 @@ LIBAO_EXTERN(null) struct timeval last_tv; int buffer; -static void drain(){ +static void drain(void){ struct timeval now_tv; int temp, temp2; @@ -70,24 +70,24 @@ static void uninit(int immed){ } // stop playing and empty buffers (for seeking/pause) -static void reset(){ +static void reset(void){ buffer=0; } // stop playing, keep buffers (for pause) -static void audio_pause() +static void audio_pause(void) { // for now, just call reset(); reset(); } // resume playing, after audio_pause() -static void audio_resume() +static void audio_resume(void) { } // return: how many bytes can be played without blocking -static int get_space(){ +static int get_space(void){ drain(); return ao_data.buffersize - buffer; @@ -106,7 +106,7 @@ static int play(void* data,int len,int flags){ } // return: delay in seconds between first and last sample in buffer -static float get_delay(){ +static float get_delay(void){ drain(); return (float) buffer / (float) ao_data.bps; diff --git a/libao2/ao_oss.c b/libao2/ao_oss.c index 484f820ecf..b363808463 100644 --- a/libao2/ao_oss.c +++ b/libao2/ao_oss.c @@ -423,7 +423,7 @@ static void uninit(int immed){ } // stop playing and empty buffers (for seeking/pause) -static void reset(){ +static void reset(void){ int oss_format; uninit(1); audio_fd=open(dsp, O_WRONLY); @@ -450,20 +450,20 @@ static void reset(){ } // stop playing, keep buffers (for pause) -static void audio_pause() +static void audio_pause(void) { uninit(1); } // resume playing, after audio_pause() -static void audio_resume() +static void audio_resume(void) { reset(); } // return: how many bytes can be played without blocking -static int get_space(){ +static int get_space(void){ int playsize=ao_data.outburst; #ifdef SNDCTL_DSP_GETOSPACE @@ -503,7 +503,7 @@ static int play(void* data,int len,int flags){ static int audio_delay_method=2; // return: delay in seconds between first and last sample in buffer -static float get_delay(){ +static float get_delay(void){ /* Calculate how many bytes/second is sent out */ if(audio_delay_method==2){ #ifdef SNDCTL_DSP_GETODELAY diff --git a/libao2/ao_pcm.c b/libao2/ao_pcm.c index 025c3b75ec..f6455bdb89 100644 --- a/libao2/ao_pcm.c +++ b/libao2/ao_pcm.c @@ -159,24 +159,24 @@ static void uninit(int immed){ } // stop playing and empty buffers (for seeking/pause) -static void reset(){ +static void reset(void){ } // stop playing, keep buffers (for pause) -static void audio_pause() +static void audio_pause(void) { // for now, just call reset(); reset(); } // resume playing, after audio_pause() -static void audio_resume() +static void audio_resume(void) { } // return: how many bytes can be played without blocking -static int get_space(){ +static int get_space(void){ if(vo_pts) return ao_data.pts < vo_pts ? ao_data.outburst : 0; @@ -210,7 +210,7 @@ static int play(void* data,int len,int flags){ } // return: delay in seconds between first and last sample in buffer -static float get_delay(){ +static float get_delay(void){ return 0.0; } diff --git a/libao2/ao_sdl.c b/libao2/ao_sdl.c index 7c079d2e06..9bb141ff6b 100644 --- a/libao2/ao_sdl.c +++ b/libao2/ao_sdl.c @@ -67,7 +67,7 @@ static unsigned char volume=SDL_MIX_MAXVOLUME; // may only be called by mplayer's thread // return value may change between immediately following two calls, // and the real number of free bytes might be larger! -static int buf_free() { +static int buf_free(void) { int free = read_pos - write_pos - CHUNK_SIZE; if (free < 0) free += BUFFSIZE; return free; @@ -76,7 +76,7 @@ static int buf_free() { // may only be called by SDL's playback thread // return value may change between immediately following two calls, // and the real number of buffered bytes might be larger! -static int buf_used() { +static int buf_used(void) { int used = write_pos - read_pos; if (used < 0) used += BUFFSIZE; return used; @@ -283,7 +283,7 @@ static void uninit(int immed){ } // stop playing and empty buffers (for seeking/pause) -static void reset(){ +static void reset(void){ //printf("SDL: reset called!\n"); @@ -295,7 +295,7 @@ static void reset(){ } // stop playing, keep buffers (for pause) -static void audio_pause() +static void audio_pause(void) { //printf("SDL: audio_pause called!\n"); @@ -304,7 +304,7 @@ static void audio_pause() } // resume playing, after audio_pause() -static void audio_resume() +static void audio_resume(void) { //printf("SDL: audio_resume called!\n"); SDL_PauseAudio(0); @@ -312,7 +312,7 @@ static void audio_resume() // return: how many bytes can be played without blocking -static int get_space(){ +static int get_space(void){ return buf_free(); } @@ -338,7 +338,7 @@ static int play(void* data,int len,int flags){ } // return: delay in seconds between first and last sample in buffer -static float get_delay(){ +static float get_delay(void){ int buffered = BUFFSIZE - CHUNK_SIZE - buf_free(); // could be less return (float)(buffered + ao_data.buffersize)/(float)ao_data.bps; } diff --git a/libao2/audio_out.c b/libao2/audio_out.c index d152df612f..c5802006a7 100644 --- a/libao2/audio_out.c +++ b/libao2/audio_out.c @@ -126,7 +126,7 @@ ao_functions_t* audio_out_drivers[] = NULL }; -void list_audio_out(){ +void list_audio_out(void){ int i=0; mp_msg(MSGT_AO, MSGL_INFO, MSGTR_AvailableAudioOutputDrivers); if (identify) diff --git a/libao2/audio_out.h b/libao2/audio_out.h index ced207a0e1..095b020247 100644 --- a/libao2/audio_out.h +++ b/libao2/audio_out.h @@ -21,12 +21,12 @@ typedef struct ao_functions_s int (*control)(int cmd,void *arg); int (*init)(int rate,int channels,int format,int flags); void (*uninit)(int immed); - void (*reset)(); - int (*get_space)(); + void (*reset)(void); + int (*get_space)(void); int (*play)(void* data,int len,int flags); - float (*get_delay)(); - void (*pause)(); - void (*resume)(); + float (*get_delay)(void); + void (*pause)(void); + void (*resume)(void); } ao_functions_t; /* global data used by mplayer and plugins */ @@ -44,7 +44,7 @@ typedef struct ao_data_s extern char *ao_subdevice; extern ao_data_t ao_data; -void list_audio_out(); +void list_audio_out(void); ao_functions_t* init_best_audio_out(char** ao_list,int use_plugin,int rate,int channels,int format,int flags); // NULL terminated array of all drivers diff --git a/libao2/audio_out_internal.h b/libao2/audio_out_internal.h index 8433ccf495..4ddd564914 100644 --- a/libao2/audio_out_internal.h +++ b/libao2/audio_out_internal.h @@ -3,13 +3,13 @@ //static ao_info_t info; static int control(int cmd, void *arg); static int init(int rate,int channels,int format,int flags); -static void uninit(); -static void reset(); -static int get_space(); +static void uninit(int immed); +static void reset(void); +static int get_space(void); static int play(void* data,int len,int flags); -static float get_delay(); -static void audio_pause(); -static void audio_resume(); +static float get_delay(void); +static void audio_pause(void); +static void audio_resume(void); #define LIBAO_EXTERN(x) ao_functions_t audio_out_##x =\ {\ |