ref: 9bfedd43436a2978a94157306dfac01927b9d579
parent: f2227a146117670bfec38f877f010c660728c362
author: Erik de Castro Lopo <erikd@coltrane>
date: Sat Sep 11 22:56:17 EDT 2004
Replace unlink with remove.
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,7 +2,13 @@
* configure.ac Win32/Makefile.mingw.in
Add preliminary support for compiling on Win32 using MinGW.
- Bump version to 0.1.2.
+
+ * configure.ac
+ Bump version to 0.1.2.
+ Add --enable-gg-werror configure option.
+
+ * examples/sndfile-resample.c tests/src-evaluate.c
+ Use ISO C standard function remove instead of unlink.
2004-09-10 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
--- a/examples/sndfile-resample.c
+++ b/examples/sndfile-resample.c
@@ -16,6 +16,8 @@
** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
*/
+#include "config.h"
+
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
@@ -22,8 +24,6 @@
#include <string.h>
#include <math.h>
-#include "config.h"
-
#if (HAVE_SNDFILE)
#include <samplerate.h>
@@ -126,10 +126,8 @@
exit (1) ;
} ;
-#if ((defined (WIN32) || defined (_WIN32)) == 0)
- /* Fix the output file length to zero if already exists. */
- truncate (argv [argc - 1], 0) ;
-#endif
+ /* Delete the output file length to zero if already exists. */
+ remove (argv [argc - 1]) ;
if ((outfile = sf_open (argv [argc - 1], SFM_WRITE, &sfinfo)) == NULL)
{ printf ("Error : Not able to open output file '%s'\n", argv [argc - 1]) ;
--- a/tests/src-evaluate.c
+++ b/tests/src-evaluate.c
@@ -346,8 +346,8 @@
*output_samples = 0 ;
for (k = 0 ; k < ARRAY_LEN (snr_test) ; k++)
- { unlink ("source.wav") ;
- unlink ("destination.wav") ;
+ { remove ("source.wav") ;
+ remove ("destination.wav") ;
if (verbose)
printf (" SNR test #%d : ", k) ;
@@ -424,7 +424,7 @@
generate_source_wav ("source.wav", &freq, 1, prog->format) ;
- unlink (filename) ;
+ remove (filename) ;
snprintf (command, sizeof (command), prog->convert_cmd, 88189) ;
SAFE_STRNCAT (command, " >/dev/null", sizeof (command)) ;