On Sat, May 27, 2006 at 07:50:32AM +1000, Erik de Castro Lopo wrote:
!!!!!!!!
What compiler are you using that didn't call
SF_INFO sfinfo;
memset (&sfinfo, 0, sfinfo) ;
an error?
err, as Stefan said above, the macro would expand:
SF_INFO sfinfo;
memset (&sfinfo, 0, sizeof(sizeof(sfinfo))) ;
which is not wrong but doesn't do what was intended.
Even without any warnings turned on, gcc-3.3 and
gcc-4.0 refuse to
compile this and give an error "incompatible type for argument 3 of
`memset'".
No syntax error here. And aubio compiles with -Wall -Werror. :)
I agree with following memset syntax. the applied patch reads:
-#define AUBIO_MEMSET(_dst,_src,_t) memset(_dst,_src,sizeof(_t))
+#define AUBIO_MEMSET(_dst,_src,_t) memset(_dst,_src,_t)
I also removed the sfinfo.format = 0 workaround in sndfile.c and
confirmed the bug was gone. for the record, the error was:
Unable to open input file /path/to/file.wav.
Error. Bad format field in SF_INFO struct when openning a RAW file for read.
Segmentation fault
occuring occasionally when opening multiple files.
bye, Paul