shithub: sox

Download patch

ref: c5ba431f0810f439854ec48f4c8e0fb5d5a46d01
parent: b96a305a04172aeaf1acb22c8ba720c4bdbacb88
author: rrt <rrt>
date: Mon Dec 11 17:37:15 EST 2006

Remove redundant raw functions, but keep their names in case they
become non-trivial again in future.

--- a/src/raw.c
+++ b/src/raw.c
@@ -101,7 +101,9 @@
     return ft->st_errno;
 }
 
-int st_rawstartread(ft_t ft)
+/* Works nicely for starting read and write; st_rawstart{read,write}
+   are #defined in st_i.h */
+int st_rawstart(ft_t ft)
 {
     ft->eof = 0;
 
@@ -108,13 +110,6 @@
     return ST_SUCCESS;
 }
 
-int st_rawstartwrite(ft_t ft)
-{
-    ft->eof = 0;
-
-    return ST_SUCCESS;
-}
-
 #define READ_FUNC(size, sign, ctype, uctype, cast) \
   static st_size_t st_ ## sign ## size ## _read_buf(st_sample_t *buf, ft_t ft, st_size_t len, st_size_t *clippedCount UNUSED) \
   { \
@@ -257,11 +252,6 @@
       return read_buf(buf, ft, nsamp, &ft->clippedCount);
 
     return 0;
-}
-
-int st_rawstopread(ft_t ft)
-{
-  return ST_SUCCESS;
 }
 
 static void writeflush(ft_t ft)
--- a/src/st_i.h
+++ b/src/st_i.h
@@ -233,6 +233,11 @@
 int st_effect_nothing_drain(eff_t effp, st_sample_t *obuf, st_size_t *osamp);
 int st_effect_nothing_getopts(eff_t effp, int n, char **argv UNUSED);
 
+#define st_rawstopread st_format_nothing
+int st_rawstart(ft_t ft);
+#define st_rawstartread st_rawstart
+#define st_rawstartwrite st_rawstart
+
 /*=============================================================================
  * Effects
  *=============================================================================