[MPlayer-cvslog] CVS: main/libao2 ao_alsa.c, 1.23, 1.24 ao_arts.c, 1.11, 1.12 ao_esd.c, 1.11, 1.12 ao_mpegpes.c, 1.22, 1.23 ao_nas.c, 1.24, 1.25 ao_null.c, 1.15, 1.16 ao_oss.c, 1.57, 1.58 ao_pcm.c, 1.30, 1.31 ao_sdl.c, 1.42, 1.43 audio_out.c, 1.50, 1.51 audio_out.h, 1.14, 1.15 audio_out_internal.h, 1.4, 1.5

Dominik Mierzejewski CVS syncmail at mplayerhq.hu
Thu Feb 9 15:08:27 CET 2006


CVS change done by Dominik Mierzejewski CVS

Update of /cvsroot/mplayer/main/libao2
In directory mail:/var2/tmp/cvs-serv31671/libao2

Modified Files:
	ao_alsa.c ao_arts.c ao_esd.c ao_mpegpes.c ao_nas.c ao_null.c 
	ao_oss.c ao_pcm.c ao_sdl.c audio_out.c audio_out.h 
	audio_out_internal.h 
Log Message:
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



Index: ao_alsa.c
===================================================================
RCS file: /cvsroot/mplayer/main/libao2/ao_alsa.c,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -r1.23 -r1.24
--- ao_alsa.c	12 Jan 2006 20:04:33 -0000	1.23
+++ ao_alsa.c	9 Feb 2006 14:07:54 -0000	1.24
@@ -237,7 +237,7 @@
     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 audio_pause()
+static void audio_pause(void)
 {
     int err;
 
@@ -745,7 +745,7 @@
     }
 }
 
-static void audio_resume()
+static void audio_resume(void)
 {
     int err;
 
@@ -766,7 +766,7 @@
 }
 
 /* stop playing and empty buffers (for seeking/pause) */
-static void reset()
+static void reset(void)
 {
     int err;
 
@@ -1030,7 +1030,7 @@
 }
 
 /* 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 @@
 }
 
 /* delay in seconds between first and last sample in buffer */
-static float get_delay()
+static float get_delay(void)
 {
 
   if (alsa_handler) {

Index: ao_arts.c
===================================================================
RCS file: /cvsroot/mplayer/main/libao2/ao_arts.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- ao_arts.c	12 Jan 2005 22:00:02 -0000	1.11
+++ ao_arts.c	9 Feb 2006 14:07:54 -0000	1.12
@@ -112,24 +112,24 @@
 	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);

Index: ao_esd.c
===================================================================
RCS file: /cvsroot/mplayer/main/libao2/ao_esd.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- ao_esd.c	12 Jan 2005 22:00:02 -0000	1.11
+++ ao_esd.c	9 Feb 2006 14:07:54 -0000	1.12
@@ -346,7 +346,7 @@
 /*
  * 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 @@
 /*
  * resume playing, after audio_pause()
  */
-static void audio_resume()
+static void audio_resume(void)
 {
     /*
      * not possible with esd.
@@ -375,7 +375,7 @@
 /*
  * 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 @@
 /*
  * 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 @@
 /*
  * 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;

Index: ao_mpegpes.c
===================================================================
RCS file: /cvsroot/mplayer/main/libao2/ao_mpegpes.c,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -r1.22 -r1.23
--- ao_mpegpes.c	27 Dec 2004 17:30:13 -0000	1.22
+++ ao_mpegpes.c	9 Feb 2006 14:07:54 -0000	1.23
@@ -137,19 +137,19 @@
 }
 
 // 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 @@
 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 @@
 }
 
 // return: delay in seconds between first and last sample in buffer
-static float get_delay(){
+static float get_delay(void){
 
     return 0.0;
 }

Index: ao_nas.c
===================================================================
RCS file: /cvsroot/mplayer/main/libao2/ao_nas.c,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -r1.24 -r1.25
--- ao_nas.c	17 Jun 2005 02:22:34 -0000	1.24
+++ ao_nas.c	9 Feb 2006 14:07:54 -0000	1.25
@@ -506,7 +506,7 @@
 }
 
 // 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 @@
 }
 
 // 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 @@
 }
 
 // resume playing, after audio_pause()
-static void audio_resume()
+static void audio_resume(void)
 {
 	AuStatus as;
 
@@ -546,7 +546,7 @@
 
 
 // return: how many bytes can be played without blocking
-static int get_space()
+static int get_space(void)
 {
 	int result;
 	
@@ -597,7 +597,7 @@
 }
 
 // return: delay in seconds between first and last sample in buffer
-static float get_delay()
+static float get_delay(void)
 {
 	float result;
 	

Index: ao_null.c
===================================================================
RCS file: /cvsroot/mplayer/main/libao2/ao_null.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- ao_null.c	19 Jun 2005 09:17:44 -0000	1.15
+++ ao_null.c	9 Feb 2006 14:07:54 -0000	1.16
@@ -20,7 +20,7 @@
 struct	timeval last_tv;
 int	buffer;
 
-static void drain(){
+static void drain(void){
  
     struct timeval now_tv;
     int temp, temp2;
@@ -70,24 +70,24 @@
 }
 
 // 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 @@
 }
 
 // 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;

Index: ao_oss.c
===================================================================
RCS file: /cvsroot/mplayer/main/libao2/ao_oss.c,v
retrieving revision 1.57
retrieving revision 1.58
diff -u -r1.57 -r1.58
--- ao_oss.c	28 Nov 2005 23:43:24 -0000	1.57
+++ ao_oss.c	9 Feb 2006 14:07:54 -0000	1.58
@@ -423,7 +423,7 @@
 }
 
 // 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 @@
 }
 
 // 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 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

Index: ao_pcm.c
===================================================================
RCS file: /cvsroot/mplayer/main/libao2/ao_pcm.c,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -r1.30 -r1.31
--- ao_pcm.c	17 Aug 2005 11:27:11 -0000	1.30
+++ ao_pcm.c	9 Feb 2006 14:07:54 -0000	1.31
@@ -159,24 +159,24 @@
 }
 
 // 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 @@
 }
 
 // return: delay in seconds between first and last sample in buffer
-static float get_delay(){
+static float get_delay(void){
 
     return 0.0;
 }

Index: ao_sdl.c
===================================================================
RCS file: /cvsroot/mplayer/main/libao2/ao_sdl.c,v
retrieving revision 1.42
retrieving revision 1.43
diff -u -r1.42 -r1.43
--- ao_sdl.c	26 Dec 2005 03:16:47 -0000	1.42
+++ ao_sdl.c	9 Feb 2006 14:07:54 -0000	1.43
@@ -67,7 +67,7 @@
 // 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 @@
 // 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 @@
 }
 
 // stop playing and empty buffers (for seeking/pause)
-static void reset(){
+static void reset(void){
 
 	//printf("SDL: reset called!\n");	
 
@@ -295,7 +295,7 @@
 }
 
 // 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 @@
 }
 
 // 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 @@
 
 
 // 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 @@
 }
 
 // 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;
 }

Index: audio_out.c
===================================================================
RCS file: /cvsroot/mplayer/main/libao2/audio_out.c,v
retrieving revision 1.50
retrieving revision 1.51
diff -u -r1.50 -r1.51
--- audio_out.c	11 Oct 2005 23:07:53 -0000	1.50
+++ audio_out.c	9 Feb 2006 14:07:54 -0000	1.51
@@ -126,7 +126,7 @@
 	NULL
 };
 
-void list_audio_out(){
+void list_audio_out(void){
       int i=0;
       mp_msg(MSGT_AO, MSGL_INFO, MSGTR_AvailableAudioOutputDrivers);
       if (identify)

Index: audio_out.h
===================================================================
RCS file: /cvsroot/mplayer/main/libao2/audio_out.h,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- audio_out.h	31 Jan 2005 11:18:31 -0000	1.14
+++ audio_out.h	9 Feb 2006 14:07:54 -0000	1.15
@@ -21,12 +21,12 @@
         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 @@
 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

Index: audio_out_internal.h
===================================================================
RCS file: /cvsroot/mplayer/main/libao2/audio_out_internal.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- audio_out_internal.h	21 Mar 2003 16:42:50 -0000	1.4
+++ audio_out_internal.h	9 Feb 2006 14:07:54 -0000	1.5
@@ -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 =\
 {\




More information about the MPlayer-cvslog mailing list