[MPlayer-cvslog] CVS: main/mp3lib mp3.h,1.2,1.3 sr1.c,1.35,1.36

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

CVS change done by Dominik Mierzejewski CVS

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

Modified Files:
	mp3.h sr1.c 
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: mp3.h
RCS file: /cvsroot/mplayer/main/mp3lib/mp3.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- mp3.h	8 May 2001 21:49:00 -0000	1.2
+++ mp3.h	9 Feb 2006 14:08:00 -0000	1.3
@@ -9,11 +9,11 @@
 extern int MP3_Open(char *filename,int buffsize);
 extern void MP3_SeekFrame(int num,int dir);
 extern void MP3_SeekForward(int num);
-extern int MP3_PrintTAG();
+extern int MP3_PrintTAG(void);
 extern int MP3_DecodeFrame(unsigned char *hova,short single);
-extern int MP3_FillBuffers();
-extern void MP3_PrintHeader();
-extern void MP3_Close();
+extern int MP3_FillBuffers(void);
+extern void MP3_PrintHeader(void);
+extern void MP3_Close(void);
 /* public variables: */
 extern int MP3_eof;        // set if EOF reached
 extern int MP3_pause;      // lock playing
@@ -29,7 +29,7 @@
 /* player level: */
 extern int  MP3_OpenDevice(char *devname);  /* devname can be NULL for default) */
-extern void MP3_Play();
-extern void MP3_Stop();
-extern void MP3_CloseDevice();
+extern void MP3_Play(void);
+extern void MP3_Stop(void);
+extern void MP3_CloseDevice(void);

Index: sr1.c
RCS file: /cvsroot/mplayer/main/mp3lib/sr1.c,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -r1.35 -r1.36
--- sr1.c	3 Jan 2006 22:06:12 -0000	1.35
+++ sr1.c	9 Feb 2006 14:08:00 -0000	1.36
@@ -523,7 +523,7 @@
 // Prints last frame header in ascii.
-void MP3_PrintHeader(){
+void MP3_PrintHeader(void){
         static char *modes[4] = { "Stereo", "Joint-Stereo", "Dual-Channel", "Single-Channel" };
         static char *layers[4] = { "???" , "I", "II", "III" };

More information about the MPlayer-cvslog mailing list