shithub: sox

Download patch

ref: 388af59ea6626b498d9c0cc659762ea46c17ec81
parent: 943cae72e49aca14d3e0ed7f9c86d42afe9c5916
author: Chris Bagwell <chris@cnpbagwell.com>
date: Tue Jul 10 04:10:46 EDT 2012

Don't use symbol names read/write.

Fixes incompatible redefinition error on mingw.

--- a/src/cvsd-fmt.c
+++ b/src/cvsd-fmt.c
@@ -68,7 +68,7 @@
     p->sample = max(p->step_mult * p->sample - p->step, SOX_SAMPLE_MIN);
 }
 
-static size_t read(sox_format_t * ft, sox_sample_t * buf, size_t len)
+static size_t cvsdread(sox_format_t * ft, sox_sample_t * buf, size_t len)
 {
   priv_t *p = (priv_t *) ft->priv;
   size_t i;
@@ -85,7 +85,7 @@
   return i;
 }
 
-static size_t write(sox_format_t * ft, sox_sample_t const * buf, size_t len)
+static size_t cvsdwrite(sox_format_t * ft, sox_sample_t const * buf, size_t len)
 {
   priv_t *p = (priv_t *) ft->priv;
   size_t i;
@@ -107,7 +107,7 @@
   static unsigned const write_encodings[] = {SOX_ENCODING_CVSD, 1, 0, 0};
   static sox_format_handler_t const handler = {SOX_LIB_VERSION_CODE,
     "Headerless Continuously Variable Slope Delta modulation (unfiltered)",
-    names, SOX_FILE_MONO, start, read, NULL, start, write, NULL,
+    names, SOX_FILE_MONO, start, cvsdread, NULL, start, cvsdwrite, NULL,
     lsx_rawseek, write_encodings, NULL, sizeof(priv_t)
   };
   return &handler;
--- a/src/waveaudio.c
+++ b/src/waveaudio.c
@@ -327,7 +327,7 @@
   return SOX_SUCCESS;
 }
 
-static size_t read(sox_format_t * ft, sox_sample_t* buf, size_t len)
+static size_t waveread(sox_format_t * ft, sox_sample_t* buf, size_t len)
 {
   size_t copied = 0;
   priv_t *priv = (priv_t*)ft->priv;
@@ -394,7 +394,7 @@
   return copied;
 }
 
-static size_t write(sox_format_t * ft, const sox_sample_t* buf, size_t len)
+static size_t wavewrite(sox_format_t * ft, const sox_sample_t* buf, size_t len)
 {
   unsigned clips = 0;
   size_t copied = 0;
@@ -475,8 +475,8 @@
   static sox_format_handler_t const handler = {SOX_LIB_VERSION_CODE,
   "Windows Multimedia Audio", names, 
   SOX_FILE_DEVICE | SOX_FILE_NOSTDIO,
-  start, read, stop,
-  start, write, stop,
+  start, waveread, stop,
+  start, wavewrite, stop,
   NULL, write_encodings, NULL, sizeof(priv_t)
   };
   return &handler;