shithub: sox

Download patch

ref: 2754a7c0759a3bc32937ca397b7589a0b21eedfc
parent: bba0bddc87c09d85e858eb8f48f7f67656777959
author: cbagwell <cbagwell>
date: Tue Jan 16 11:49:53 EST 2001

Removed broken support for compiling with non-ANSI compilers.  Makefile
now places path from configure script inside the play/rec scripts.

--- a/Changelog
+++ b/Changelog
@@ -20,6 +20,9 @@
   o Jimen Ching updated ALSA configure support to auto-detect 4.x or 5.x API
     and compile correctly under those two.  All other versions are unsupported.
   o Merged in the NetBSD package changes into CVS finally.
+  o Removed broken support for non-ANSI compilers.
+  o Makefile now places the correct path to SoX in the play/rec scripts
+    based on configuration script values.
 
 sox-12.17.1
 -----------
--- a/Makefile.gcc
+++ b/Makefile.gcc
@@ -211,6 +211,7 @@
 install: sox
 	if [ -f $(BINDIR)/rec ] ; then $(RM) $(BINDIR)/rec ; fi
 	if [ -f $(MANDIR)/man1/rec.1 ] ; then $(RM) $(MANDIR)/man1/rec.1 ; fi
+	sed -e 's|@PREFIX@|$(BINDIR)|g' < play.in > play
 	install -c -m 755 sox play $(BINDIR)
 	install -c -m 644 sox.1 soxexam.1 play.1 $(MANDIR)/man1
 	ln -s $(BINDIR)/play $(BINDIR)/rec
--- a/configure.in
+++ b/configure.in
@@ -50,6 +50,8 @@
 AC_PROG_INSTALL
 AC_PROG_CPP
 
+AC_CHECK_PROGS(SED, sed)
+
 dnl Set host type
 
 AC_CANONICAL_SYSTEM
--- a/libst.h
+++ b/libst.h
@@ -24,8 +24,8 @@
 #define st_ulaw_to_linear(ulawbyte)   ulaw_exp_table[ulawbyte]
 #define st_linear_to_ulaw(linearword) ulaw_comp_table[(unsigned short)linearword >> 2]
 #else
-unsigned char st_linear_to_ulaw(P1(short))REGPARM(1);
-int           st_ulaw_to_linear(P1(unsigned char))REGPARM(1);
+unsigned char st_linear_to_ulaw(short) REGPARM(1);
+int           st_ulaw_to_linear(unsigned char) REGPARM(1);
 #endif
 
 #ifdef FAST_ALAW_CONVERSION
@@ -34,7 +34,7 @@
 #define st_Alaw_to_linear(Alawbyte)   Alaw_exp_table[Alawbyte]
 #define st_linear_to_Alaw(linearword) Alaw_comp_table[(unsigned short)linearword >> 2]
 #else
-unsigned char st_linear_to_Alaw(P1(short))REGPARM(1);
-int           st_Alaw_to_linear(P1(unsigned char))REGPARM(1);
+unsigned char st_linear_to_Alaw(short) REGPARM(1);
+int           st_Alaw_to_linear(unsigned char) REGPARM(1);
 #endif
 
--- a/play
+++ /dev/null
@@ -1,205 +1,0 @@
-#!/bin/sh
-# Shell script to play/record sound files to/from unix style sound devices.
-# Should auto detect most supported systems.
-#
-# Originally developed by Chris Bagwell (cbagwell@sprynet.com)
-#
-#   TODO:  Put each set of fopts and filenames on an array and then 
-#          play each filename back with the given effect.h
-#
-# Change History:
-#
-#   Major updates have been supplied by Kjetil Torgrim Homme and 
-#   Kirk Goff.
-
-# Set up path so that it can find Sox if user's path doesn't already
-# include it.
-PATH=$PATH:/usr/local/bin
-program_name=`basename $0`
-program_version="2.0"
-
-if [ -z "$1" ]; then
-    echo "\
-$program_name: too few arguments
-Try \`$program_name --help' for more information." 1>&2
-    exit 1
-fi
-
-version()
-{
-    echo "$program_name (sox) $program_version"
-    exit 0
-}
-
-help()
-{
-    echo "\
-Usage: $program_name [OPTION]... FILE [EFFECT]...
-Play/record sound files to/from unix style sound devices.
-
-  -c, --channels=CHANNELS      specifies the number of sound channels in FILE
-  -d, --device=DEVICE          use DEVICE for input/output
-  -f, --format=FORMAT          specifies bit format of sample
-                               FORMAT is either s, u, U, A, a, or g
-  -r, --rate=RATE              sample rate in hertz of FILE
-  -s, --size=SIZE              interpret size of sample
-                               SIZE is either b, w, l, f, d, or D
-  -t, --type=TYPE              specifies file format of FILE
-  -v, --volume=VOLUME          change amplitude
-  -x, --xinu                   reverse bit order of sample
-                               (only works with 16-bit and 32-bit integer data)
-      --file                   next argument is FILE
-  -h, --help                   display this help and exit
-      --version                output version information and exit
-
-EFFECTs are one or more of the following:  avg, band, chorus, copy, cut, 
-deemph, echo, echos, flanger, highp, lowp, map, mask, phaser, pick, polyphase
-rate, resample, reverb, reverse, split, stat, vibro.
-
-See sox man page for detailed information on supported file types, data
-formats, and effect options."
-    exit 0
-}
-
-
-# loop over arguments
-while [ $# -ne 0 ]; do
-    case "$1" in
-	avg|band|bandpass|bandreject|chorus|compand|copy|cut|deemph|earwax|echo|echos|fade|filter|flanger|highp|highpass|lowp|lowpass|map|mask|pan|phaser|pick|pitch|polyphase|rate|resample|reverb|reverse|speed|split|stat|stretch|swap|trim|vibro|vol)
-	    effects="$@"
-	    break
-	    ;;
-	-c)
-	    shift
-	    fopts="$fopts -c $1"
-	    ;;
-	--channels=*)
-	    fopts="$fopts -c `echo $1 | sed 's/.*=//'`"
-	    ;;
-	-d)
-	    shift
-	    device="$1"
-	    ;;
-	--device=*)
-	    device=`echo $1 | sed 's/.*=//'`
-	    ;;
-	-f)
-	    shift
-	    fopts="$fopts -$1"
-	    ;;
-	--format=*)
-	    fopts="$fopts -`echo $1 | sed 's/.*=//'`"
-	    ;;
-	-r)
-	    shift
-	    fopts="$fopts -r $1"
-	    ;;
-	--rate=*)
-	    fopts="$fopts -r `echo $1 | sed 's/.*=//'`"
-	    ;;
-	-s)
-	    shift
-	    fopts="$fopts -$1"
-	    ;;
-	--size=*)
-	    fopts="$fopts -`echo $1 | sed 's/.*=//'`"
-	    ;;
-	-t)
-	    shift
-	    fopts2="$fopts -t $1"
-	    ;;
-	--type=*)
-	    fopts2="$fopts -t `echo $1 | sed 's/.*=//'`"
-	    ;;
-	-v)
-	    shift
-	    volume="-v $1"
-	    ;;
-	--volume=*)
-	    volume="-v `echo $1 | sed 's/.*=//'`"
-	    ;;
-	-x|--xinu)
-	    fopts="$fopts -x"
-	    ;;
-	--file)
-	    shift
-	    if [ -z "$filename" ]; then
-		filename="$1"
-	    else
-		echo "Filename already given.  Ignoring extra name: $1" 1>&2
-	    fi
-	    ;;
-	-h)
-	    help
-	    ;;
-	--help)
-	    help
-	    ;;
-	--version)
-	    version
-	    ;;
-	-)
-	    filename="-"
-	    ;;
-	-*)
-	    fopts="$fopts $1"
-	    ;;
-	*)
-	    if [ -z "$filename" ]; then
-		filename="$1"
-	    else
-		echo "Filename already given.  Ignoring extra name: $1" 1>&2
-	    fi
-	    
-	    ;;
-    esac
-    shift
-done
-
-arch=`uname -s`
-case $arch in
-  SunOS)
-    case `uname -r` in
-        # Solaris software can auto-detect hardware capabilities.
-        5.*)
-	    arch_defines="-t sunau"
-	    ;;
-	# For SunOS default to signed words.  Some hardware can only play u-law and would need
-	# to be changed here.
-	*)
-	    arch_defines="-t sunau -w -s"
-	    ;;
-    esac
-    if [ -z "$device" ]; then
-	device="/dev/audio"
-    fi
-    ;;
-  Linux|FreeBSD)
-    arch_defines="-t ossdsp"
-    if [ -z "$device" ]; then
-	device="/dev/dsp"
-    fi
-    ;;
-  NetBSD)
-    arch_defines="-t sunau"
-    if [ -z "$device" ]; then
-        device="/dev/audio"
-    fi
-    ;;
-esac
-
-# If name is "rec" then record else assume user is wanting to play
-# a sound file.
-if [ "$program_name" = "rec" ]; then
-
-    # Don't send data to stdout if they are reading from it.
-    if [ "$filename" = "-" ]; then
-      echo "Send break (control-c) to end recording" 1>&2
-    else
-      echo "Send break (control-c) to end recording"
-    fi
-    sox $volume $arch_defines $fopts $device $fopts2 "$filename" $effects 
-
-else
-    sox $volume $fopts $fopts2 "$filename" $arch_defines $device $effects
-fi
--- a/src/8svx.c
+++ b/src/8svx.c
@@ -20,7 +20,7 @@
 	FILE *ch[4];
 };
 
-static void svxwriteheader(P2(ft_t, LONG));
+static void svxwriteheader(ft_t, LONG);
 
 /*======================================================================*/
 /*                         8SVXSTARTREAD                                */
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -64,11 +64,17 @@
 
 VPATH	= @srcdir@
 
-all: sox
+PLAY_0    =
+PLAY_1    = play
 
+all: sox $(PLAY_$(PLAY_SUPPORT))
+
 sox: libst.a sox.o
 	$(CC) $(LDFLAGS) -o sox sox.o $(LIBS)
 
+play: play.in
+	$(SED) -e 's|@PREFIX@|$(BINDIR)|g' < play.in > play
+
 libst.a: $(LIBOBJS)
 	$(AR) libst.a $(LIBOBJS)
 	$(RANLIB) libst.a
@@ -111,7 +117,7 @@
 	$(RM) *.o
 
 distclean:
-	$(RM) *~ *.o *.raw *.sf core sox libst.a
+	$(RM) *~ *.o *.raw *.sf core sox libst.a play
 	$(RM) config.cache config.log config.status config.h Makefile
 
 tar:
--- a/src/aiff.c
+++ b/src/aiff.c
@@ -58,14 +58,14 @@
 };
 
 /* forward declarations */
-static double read_ieee_extended(P1(ft_t));
-static int aiffwriteheader(P2(ft_t, LONG));
-static void write_ieee_extended(P2(ft_t, double));
-static double ConvertFromIeeeExtended(P1(unsigned char*));
-static void ConvertToIeeeExtended(P2(double, char *));
-static int textChunk(P3(char **text, char *chunkDescription, ft_t ft));
-static int commentChunk(P3(char **text, char *chunkDescription, ft_t ft));
-static void reportInstrument(P1(ft_t ft));
+static double read_ieee_extended(ft_t);
+static int aiffwriteheader(ft_t, LONG);
+static void write_ieee_extended(ft_t, double);
+static double ConvertFromIeeeExtended(unsigned char*);
+static void ConvertToIeeeExtended(double, char *);
+static int textChunk(char **text, char *chunkDescription, ft_t ft);
+static int commentChunk(char **text, char *chunkDescription, ft_t ft);
+static void reportInstrument(ft_t ft);
 
 int st_aiffstartread(ft) 
 ft_t ft;
--- a/src/alsa.c
+++ b/src/alsa.c
@@ -19,7 +19,7 @@
 #include <sys/ioctl.h>
 #include "st.h"
 
-static int get_format(P3(ft_t ft, int formats, int *fmt));
+static int get_format(ft_t ft, int formats, int *fmt);
 
 #ifdef USE_OLD_API /* Start 0.4.x API */
 
--- a/src/au.c
+++ b/src/au.c
@@ -56,7 +56,7 @@
 	int in_bits;
 };
 
-static void auwriteheader(P2(ft_t ft, ULONG data_size));
+static void auwriteheader(ft_t ft, ULONG data_size);
 
 int st_auencodingandsize(sun_encoding, encoding, size)
 int sun_encoding;
--- a/src/avg.c
+++ b/src/avg.c
@@ -73,7 +73,7 @@
 			avg->mix = MIX_FRONT;
 		else if (!strcmp(argv[0], "-b"))
 			avg->mix = MIX_BACK;
-		else if (argv[0][0] == '-' && !isdigit(argv[0][1])
+		else if (argv[0][0] == '-' && !isdigit((int)argv[0][1])
 		    && argv[0][1] != '.') {
 			st_fail("Usage: avg [ -l | -r | -f | -b | n,n,n...,n ]");
 			return (ST_EOF);
--- a/src/btrworth.h
+++ b/src/btrworth.h
@@ -31,9 +31,9 @@
 
  */
 
-int st_butterworth_start (P1 (eff_t effp));
-int st_butterworth_flow (P5 (eff_t effp, LONG *ibuf, LONG *obuf,
-                             LONG *isamp, LONG *osamp));
+int st_butterworth_start (eff_t effp);
+int st_butterworth_flow (eff_t effp, LONG *ibuf, LONG *obuf,
+                         LONG *isamp, LONG *osamp);
 
 typedef struct butterworth {
   double x [2];
--- a/src/filter.c
+++ b/src/filter.c
@@ -52,9 +52,9 @@
 
 /* makeFilter() declared in resample.c */
 extern int 
-makeFilter(P6(Float Fp[], LONG Nwing, double Froll, double Beta, LONG Num, int Normalize));
+makeFilter(Float Fp[], LONG Nwing, double Froll, double Beta, LONG Num, int Normalize);
 
-static void FiltWin(P2(filter_t f, LONG Nx));
+static void FiltWin(filter_t f, LONG Nx);
 
 /*
  * Process options
--- a/src/g72x.h
+++ b/src/g72x.h
@@ -74,60 +74,60 @@
 
 /* External function definitions. */
 
-extern void g72x_init_state(P1(struct g72x_state *));
-extern int g721_encoder(P3(
+extern void g72x_init_state(struct g72x_state *);
+extern int g721_encoder(
 		int sample,
 		int in_coding,
-		struct g72x_state *state_ptr));
-extern int g721_decoder(P3(
+		struct g72x_state *state_ptr);
+extern int g721_decoder(
 		int code,
 		int out_coding,
-		struct g72x_state *state_ptr));
-extern int g723_24_encoder(P3(
+		struct g72x_state *state_ptr);
+extern int g723_24_encoder(
 		int sample,
 		int in_coding,
-		struct g72x_state *state_ptr));
-extern int g723_24_decoder(P3(
+		struct g72x_state *state_ptr);
+extern int g723_24_decoder(
 		int code,
 		int out_coding,
-		struct g72x_state *state_ptr));
-extern int g723_40_encoder(P3(
+		struct g72x_state *state_ptr);
+extern int g723_40_encoder(
 		int sample,
 		int in_coding,
-		struct g72x_state *state_ptr));
-extern int g723_40_decoder(P3(
+		struct g72x_state *state_ptr);
+extern int g723_40_decoder(
 		int code,
 		int out_coding,
-		struct g72x_state *state_ptr));
+		struct g72x_state *state_ptr);
 
-int predictor_zero(P1(struct g72x_state *state_ptr));
-int predictor_pole(P1(struct g72x_state *state_ptr));
-int step_size(P1(struct g72x_state *state_ptr));
-int quantize(P4(int d,
-		int y,
-		short *table,
-		int size));
-int reconstruct(P3(int sign,
-		   int dqln,
-		   int y));
-void update(P8(int code_size,
-	       int y,
-	       int wi,
-	       int fi,
-	       int dq,
-	       int sr,
-	       int dqsez,
-	       struct g72x_state *state_ptr));
-int tandem_adjust_alaw(P6(int sr,
-			  int se,
-			  int y,
-			  int i,
-			  int sign,
-			  short *qtab));
-int tandem_adjust_ulaw(P6(int sr,
-			  int se,
-			  int y,
-			  int i,
-			  int sign,
-			  short *qtab));
+int predictor_zero(struct g72x_state *state_ptr);
+int predictor_pole(struct g72x_state *state_ptr);
+int step_size(struct g72x_state *state_ptr);
+int quantize(int d,
+	     int y,
+	     short *table,
+	     int size);
+int reconstruct(int sign,
+		int dqln,
+		int y);
+void update(int code_size,
+	    int y,
+	    int wi,
+	    int fi,
+	    int dq,
+	    int sr,
+	    int dqsez,
+	    struct g72x_state *state_ptr);
+int tandem_adjust_alaw(int sr,
+		       int se,
+		       int y,
+		       int i,
+		       int sign,
+		       short *qtab);
+int tandem_adjust_ulaw(int sr,
+		       int se,
+		       int y,
+		       int i,
+		       int sign,
+		       short *qtab);
 #endif /* !_G72X_H */
--- a/src/hcom.c
+++ b/src/hcom.c
@@ -47,7 +47,7 @@
 	short sample;
 };
 
-static int skipbytes(P2(ft_t, int));
+static int skipbytes(ft_t, int);
 
 int st_hcomstartread(ft)
 ft_t ft;
--- a/src/maud.c
+++ b/src/maud.c
@@ -31,7 +31,7 @@
 	ULONG nsamples;
 };
 
-static void maudwriteheader(P1(ft_t));
+static void maudwriteheader(ft_t);
 
 /*
  * Do anything required before you start reading samples.
--- a/src/misc.c
+++ b/src/misc.c
@@ -329,8 +329,8 @@
 
 
 /* dummy routines for do-nothing functions */
-void st_nothing(P0) {}
-LONG st_nothing_success(P0) {return(0);}
+void st_nothing(void) {}
+LONG st_nothing_success(void) {return(0);}
 
 /* dummy drain routine for effects */
 void st_null_drain(effp, obuf, osamp)
@@ -379,7 +379,7 @@
 #endif
 
 /* Util to set initial seed so that we are a little less non-random */
-void st_initrand(P0) {
+void st_initrand(void) {
 	time_t t;
 
 	time(&t);
--- /dev/null
+++ b/src/play.in
@@ -1,0 +1,205 @@
+#!/bin/sh
+# Shell script to play/record sound files to/from unix style sound devices.
+# Should auto detect most supported systems.
+#
+# Originally developed by Chris Bagwell (cbagwell@sprynet.com)
+#
+#   TODO:  Put each set of fopts and filenames on an array and then 
+#          play each filename back with the given effect.h
+#
+# Change History:
+#
+#   Major updates have been supplied by Kjetil Torgrim Homme and 
+#   Kirk Goff.
+
+# Set up path so that it can find Sox if user's path doesn't already
+# include it.
+PATH=$PATH:@PREFIX@
+program_name=`basename $0`
+program_version="2.0"
+
+if [ -z "$1" ]; then
+    echo "\
+$program_name: too few arguments
+Try \`$program_name --help' for more information." 1>&2
+    exit 1
+fi
+
+version()
+{
+    echo "$program_name (sox) $program_version"
+    exit 0
+}
+
+help()
+{
+    echo "\
+Usage: $program_name [OPTION]... FILE [EFFECT]...
+Play/record sound files to/from unix style sound devices.
+
+  -c, --channels=CHANNELS      specifies the number of sound channels in FILE
+  -d, --device=DEVICE          use DEVICE for input/output
+  -f, --format=FORMAT          specifies bit format of sample
+                               FORMAT is either s, u, U, A, a, or g
+  -r, --rate=RATE              sample rate in hertz of FILE
+  -s, --size=SIZE              interpret size of sample
+                               SIZE is either b, w, l, f, d, or D
+  -t, --type=TYPE              specifies file format of FILE
+  -v, --volume=VOLUME          change amplitude
+  -x, --xinu                   reverse bit order of sample
+                               (only works with 16-bit and 32-bit integer data)
+      --file                   next argument is FILE
+  -h, --help                   display this help and exit
+      --version                output version information and exit
+
+EFFECTs are one or more of the following:  avg, band, chorus, copy, cut, 
+deemph, echo, echos, flanger, highp, lowp, map, mask, phaser, pick, polyphase
+rate, resample, reverb, reverse, split, stat, vibro.
+
+See sox man page for detailed information on supported file types, data
+formats, and effect options."
+    exit 0
+}
+
+
+# loop over arguments
+while [ $# -ne 0 ]; do
+    case "$1" in
+	avg|band|bandpass|bandreject|chorus|compand|copy|cut|deemph|earwax|echo|echos|fade|filter|flanger|highp|highpass|lowp|lowpass|map|mask|pan|phaser|pick|pitch|polyphase|rate|resample|reverb|reverse|speed|split|stat|stretch|swap|trim|vibro|vol)
+	    effects="$@"
+	    break
+	    ;;
+	-c)
+	    shift
+	    fopts="$fopts -c $1"
+	    ;;
+	--channels=*)
+	    fopts="$fopts -c `echo $1 | sed 's/.*=//'`"
+	    ;;
+	-d)
+	    shift
+	    device="$1"
+	    ;;
+	--device=*)
+	    device=`echo $1 | sed 's/.*=//'`
+	    ;;
+	-f)
+	    shift
+	    fopts="$fopts -$1"
+	    ;;
+	--format=*)
+	    fopts="$fopts -`echo $1 | sed 's/.*=//'`"
+	    ;;
+	-r)
+	    shift
+	    fopts="$fopts -r $1"
+	    ;;
+	--rate=*)
+	    fopts="$fopts -r `echo $1 | sed 's/.*=//'`"
+	    ;;
+	-s)
+	    shift
+	    fopts="$fopts -$1"
+	    ;;
+	--size=*)
+	    fopts="$fopts -`echo $1 | sed 's/.*=//'`"
+	    ;;
+	-t)
+	    shift
+	    fopts2="$fopts -t $1"
+	    ;;
+	--type=*)
+	    fopts2="$fopts -t `echo $1 | sed 's/.*=//'`"
+	    ;;
+	-v)
+	    shift
+	    volume="-v $1"
+	    ;;
+	--volume=*)
+	    volume="-v `echo $1 | sed 's/.*=//'`"
+	    ;;
+	-x|--xinu)
+	    fopts="$fopts -x"
+	    ;;
+	--file)
+	    shift
+	    if [ -z "$filename" ]; then
+		filename="$1"
+	    else
+		echo "Filename already given.  Ignoring extra name: $1" 1>&2
+	    fi
+	    ;;
+	-h)
+	    help
+	    ;;
+	--help)
+	    help
+	    ;;
+	--version)
+	    version
+	    ;;
+	-)
+	    filename="-"
+	    ;;
+	-*)
+	    fopts="$fopts $1"
+	    ;;
+	*)
+	    if [ -z "$filename" ]; then
+		filename="$1"
+	    else
+		echo "Filename already given.  Ignoring extra name: $1" 1>&2
+	    fi
+	    
+	    ;;
+    esac
+    shift
+done
+
+arch=`uname -s`
+case $arch in
+  SunOS)
+    case `uname -r` in
+        # Solaris software can auto-detect hardware capabilities.
+        5.*)
+	    arch_defines="-t sunau"
+	    ;;
+	# For SunOS default to signed words.  Some hardware can only play u-law and would need
+	# to be changed here.
+	*)
+	    arch_defines="-t sunau -w -s"
+	    ;;
+    esac
+    if [ -z "$device" ]; then
+	device="/dev/audio"
+    fi
+    ;;
+  Linux|FreeBSD)
+    arch_defines="-t ossdsp"
+    if [ -z "$device" ]; then
+	device="/dev/dsp"
+    fi
+    ;;
+  NetBSD)
+    arch_defines="-t sunau"
+    if [ -z "$device" ]; then
+        device="/dev/audio"
+    fi
+    ;;
+esac
+
+# If name is "rec" then record else assume user is wanting to play
+# a sound file.
+if [ "$program_name" = "rec" ]; then
+
+    # Don't send data to stdout if they are reading from it.
+    if [ "$filename" = "-" ]; then
+      echo "Send break (control-c) to end recording" 1>&2
+    else
+      echo "Send break (control-c) to end recording"
+    fi
+    sox $volume $arch_defines $fopts $device $fopts2 "$filename" $effects 
+
+else
+    sox $volume $fopts $fopts2 "$filename" $arch_defines $device $effects
+fi
--- a/src/raw.c
+++ b/src/raw.c
@@ -31,7 +31,7 @@
 
 #define MAXWSPEED 1
 
-static void rawdefaults(P1(ft_t ft));
+static void rawdefaults(ft_t ft);
 
 int st_rawstartread(ft) 
 ft_t ft;
--- a/src/resample.c
+++ b/src/resample.c
@@ -93,22 +93,22 @@
    Float *X, *Y;      /* I/O buffers */
 } *resample_t;
 
-static void LpFilter(P5(double c[],
-		LONG N,
-		double frq,
-		double Beta,
-		LONG Num));
+static void LpFilter(double c[],
+		     LONG N,
+		     double frq,
+		     double Beta,
+		     LONG Num);
 
 /* makeFilter is used by filter.c */
-int makeFilter(P6(Float Imp[],
-		  LONG Nwing,
-		  double Froll,
-		  double Beta,
-		  LONG Num,
-			int Normalize));
+int makeFilter(Float Imp[],
+	       LONG Nwing,
+	       double Froll,
+	       double Beta,
+	       LONG Num,
+	       int Normalize);
 
-static LONG SrcUD(P2(resample_t r, LONG Nx));
-static LONG SrcEX(P2(resample_t r, LONG Nx));
+static LONG SrcUD(resample_t r, LONG Nx);
+static LONG SrcEX(resample_t r, LONG Nx);
 
 
 /*
@@ -181,7 +181,7 @@
 	resample_t r = (resample_t) effp->priv;
 	LONG Xoff, gcdrate;
 	int i;
-	extern LONG st_gcd(P2(LONG a,LONG b));
+	extern LONG st_gcd(LONG a,LONG b);
 
 	r->Factor = (double)effp->outinfo.rate / (double)effp->ininfo.rate;
 
--- a/src/sndrtool.c
+++ b/src/sndrtool.c
@@ -26,7 +26,7 @@
 #define	SEEK_CUR	1
 #endif
 
-static void  sndtwriteheader(P2(ft_t ft,LONG nsamples));
+static void  sndtwriteheader(ft_t ft,LONG nsamples);
 
 /*======================================================================*/
 /*                         SNDSTARTREAD                                */
--- a/src/sox.c
+++ b/src/sox.c
@@ -1,4 +1,4 @@
-/*)
+/*
  * Sox - The Swiss Army Knife of Audio Manipulation.
  *
  * This is the main function for the command line sox program.
@@ -42,7 +42,7 @@
 #include <getopt.h>
 #else
 #ifndef HAVE_GETOPT
-int getopt(P3(int,char **,char *));
+int getopt(int,char **,char *);
 extern char *optarg;
 extern int optind;
 #endif
@@ -77,16 +77,16 @@
 static LONG obufr[BUFSIZ/2];
 
 /* local forward declarations */
-static void init(P0);
-static void doopts(P2(int, char **));
-static void usage(P1(char *))NORET;
-static int filetype(P1(int));
-static void process(P0);
-static void statistics(P0);
-static LONG volumechange(P3(LONG *buf, LONG ct, double vol));
-static void checkeffect(P0);
-static int flow_effect(P1(int));
-static int drain_effect(P1(int));
+static void init(void);
+static void doopts(int, char **);
+static void usage(char *) NORET;
+static int filetype(int);
+static void process(void);
+static void statistics(void);
+static LONG volumechange(LONG *buf, LONG ct, double vol);
+static void checkeffect(void);
+static int flow_effect(int);
+static int drain_effect(int);
 
 static struct st_soundstream informat, outformat;
 
@@ -390,7 +390,7 @@
 	}
 }
 
-static void init(P0) {
+static void init(void) {
 
 	/* init files */
 	informat.info.rate      = outformat.info.rate  = 0;
@@ -411,7 +411,7 @@
  *	one buffer at a time
  */
 
-static void process(P0) {
+static void process(void) {
     int e, f, havedata, flowstatus;
 
     st_gettype(&informat);
@@ -923,7 +923,7 @@
 	}
 }
 
-static void statistics(P0) {
+static void statistics(void) {
 	if (dovolume && clipped > 0)
 		st_report("Volume change clipped %d samples", clipped);
 }
@@ -998,7 +998,7 @@
 
 
 /* called from util.c:fail */
-void cleanup(P0) {
+void cleanup(void) {
 	/* Close the input file and outputfile before exiting*/
 	if (informat.fp)
 		fclose(informat.fp);
--- a/src/st.h
+++ b/src/st.h
@@ -24,8 +24,8 @@
 #include <byteswap.h>
 #endif
 
-/* Release 12.17.1 of libst */
-#define ST_LIB_VERSION_CODE 0x0c1101
+/* Release 12.17.2 of libst */
+#define ST_LIB_VERSION_CODE 0x0c1102
 #define ST_LIB_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))
 
 /* SJB: these may be changed to assist fail-recovery in libST */
@@ -60,33 +60,6 @@
 #define REGPARM(n)
 #endif
 
-/* FIXME: Move to internal st header */
-#if	defined(__STDC__) || defined(__cplusplus)
-#define	P0 void
-#define	P1(a) a
-#define	P2(a,b) a, b
-#define	P3(a,b,c) a, b, c
-#define	P4(a,b,c,d) a, b, c, d
-#define	P5(a,b,c,d,e) a, b, c, d, e
-#define	P6(a,b,c,d,e,f) a, b, c, d, e, f
-#define	P7(a,b,c,d,e,f,g) a, b, c, d, e, f, g
-#define	P8(a,b,c,d,e,f,g,h) a, b, c, d, e, f, g, h
-#define	P9(a,b,c,d,e,f,g,h,i) a, b, c, d, e, f, g, h, i
-#define	P10(a,b,c,d,e,f,g,h,i,j) a, b, c, d, e, f, g, h, i, j
-#else
-#define	P0
-#define	P1(a)
-#define	P2(a,b)
-#define	P3(a,b,c)
-#define	P4(a,b,c,d)
-#define	P5(a,b,c,d,e)
-#define	P6(a,b,c,d,e,f)
-#define	P7(a,b,c,d,e,f,g)
-#define	P8(a,b,c,d,e,f,g,h)
-#define	P9(a,b,c,d,e,f,g,h,i)
-#define	P10(a,b,c,d,e,f,g,h,i,j)
-#endif
-
 /* Signal parameters */
 
 /* FIXME: Change to typedef */
@@ -161,12 +134,12 @@
 typedef struct st_format {
 	char	**names;	/* file type names */
 	int	flags;		/* details about file type */
-	int	(*startread)(P1(ft_t ft));			
-	LONG	(*read)(P3(ft_t ft, LONG *buf, LONG len));			
-	int	(*stopread)(P1(ft_t ft));		
-	int	(*startwrite)(P1(ft_t ft));			
-	LONG	(*write)(P3(ft_t ft, LONG *buf, LONG len));
-	int	(*stopwrite)(P1(ft_t ft));		
+	int	(*startread)(ft_t ft);			
+	LONG	(*read)(ft_t ft, LONG *buf, LONG len);
+	int	(*stopread)(ft_t ft);
+	int	(*startwrite)(ft_t ft);
+	LONG	(*write)(ft_t ft, LONG *buf, LONG len);
+	int	(*stopwrite)(ft_t ft);
 } st_format_t;
 
 struct st_soundstream {
@@ -234,15 +207,15 @@
 	char	*name;			/* effect name */
 	int	flags;			/* this and that */
 					/* process arguments */
-	int	(*getopts)(P3(eff_t effp, int argc, char **argv));
+	int	(*getopts)(eff_t effp, int argc, char **argv);
 					/* start off effect */
-	int	(*start)(P1(eff_t effp));
+	int	(*start)(eff_t effp);
 					/* do a buffer */
-	int	(*flow)(P5(eff_t effp, LONG *ibuf, LONG *obuf,
-			   LONG *isamp, LONG *osamp));
+	int	(*flow)(eff_t effp, LONG *ibuf, LONG *obuf,
+			LONG *isamp, LONG *osamp);
 					/* drain out at end */
-	int	(*drain)(P3(eff_t effp, LONG *obuf, LONG *osamp));
-	int	(*stop)(P1(eff_t effp));/* finish up effect */
+	int	(*drain)(eff_t effp, LONG *obuf, LONG *osamp);
+	int	(*stop)(eff_t effp);    /* finish up effect */
 } st_effect_t;
 
 struct st_effect {
@@ -261,12 +234,12 @@
 extern st_effect_t st_effects[]; /* declared in handlers.c */
 
 /* declared in misc.c */
-extern LONG st_clip24(P1(LONG)) REGPARM(1);
-extern void st_sine(P4(int *, LONG, int, int));
-extern void st_triangle(P4(int *, LONG, int, int));
+extern LONG st_clip24(LONG) REGPARM(1);
+extern void st_sine(int *, LONG, int, int);
+extern void st_triangle(int *, LONG, int, int);
 
-extern LONG st_gcd(P2(LONG,LONG)) REGPARM(2);
-extern LONG st_lcm(P2(LONG,LONG)) REGPARM(2);
+extern LONG st_gcd(LONG,LONG) REGPARM(2);
+extern LONG st_lcm(LONG,LONG) REGPARM(2);
 
 /****************************************************/
 /* Prototypes for internal cross-platform functions */
@@ -276,13 +249,13 @@
  * these type functions.
  */
 #ifndef HAVE_RAND
-extern int rand(P0);
-extern void srand(P1(unsigned int seed));
+extern int rand(void);
+extern void srand(unsigned int seed);
 #endif
-extern void st_initrand(P0);
+extern void st_initrand(void);
 
 #ifndef HAVE_STRERROR
-char *strerror(P1(int errorcode));
+char *strerror(int errorcode);
 #endif
 
 /* Read and write basic data types from "ft" stream.  Uses ft->swap for
@@ -289,20 +262,20 @@
  * possible byte swapping.
  */
 /* declared in misc.c */
-LONG	st_read(P4(ft_t ft, void *buf, int size, LONG len));
-LONG	st_write(P4(ft_t ft, void *buf, int size, LONG len));
-int	st_reads(P3(ft_t ft, char *c, int len));
-int	st_writes(P2(ft_t ft, char *c));
-int	st_readb(P2(ft_t ft, unsigned char *uc));
-int	st_writeb(P2(ft_t ft, unsigned char uc));
-int	st_readw(P2(ft_t ft, unsigned short *us));
-int	st_writew(P2(ft_t ft, unsigned short us));
-int	st_readdw(P2(ft_t ft, ULONG *ul));		
-int	st_writedw(P2(ft_t ft, ULONG ul));
-int	st_readf(P2(ft_t ft, float *f));
-int	st_writef(P2(ft_t ft, double f));
-int	st_readdf(P2(ft_t ft, double *d));
-int	st_writedf(P2(ft_t ft, double d));
+LONG	st_read(ft_t ft, void *buf, int size, LONG len);
+LONG	st_write(ft_t ft, void *buf, int size, LONG len);
+int	st_reads(ft_t ft, char *c, int len);
+int	st_writes(ft_t ft, char *c);
+int	st_readb(ft_t ft, unsigned char *uc);
+int	st_writeb(ft_t ft, unsigned char uc);
+int	st_readw(ft_t ft, unsigned short *us);
+int	st_writew(ft_t ft, unsigned short us);
+int	st_readdw(ft_t ft, ULONG *ul);		
+int	st_writedw(ft_t ft, ULONG ul);
+int	st_readf(ft_t ft, float *f);
+int	st_writef(ft_t ft, double f);
+int	st_readdf(ft_t ft, double *d);
+int	st_writedf(ft_t ft, double d);
 
 /* FIXME: raw routines are used by so many formats their prototypes are defined
  * here for convience.  This wont last for long so application software
@@ -309,12 +282,12 @@
  * shouldn't make use of it.
  */
 /* declared in raw.c */
-int st_rawstartread(P1(ft_t ft));
-int st_rawstartwrite(P1(ft_t ft));
-int st_rawstopread(P1(ft_t ft));
-int st_rawstopwrite(P1(ft_t ft));
-LONG st_rawread(P3(ft_t ft, LONG *buf, LONG nsamp));
-LONG st_rawwrite(P3(ft_t ft, LONG *buf, LONG nsamp));
+int st_rawstartread(ft_t ft);
+int st_rawstartwrite(ft_t ft);
+int st_rawstopread(ft_t ft);
+int st_rawstopwrite(ft_t ft);
+LONG st_rawread(ft_t ft, LONG *buf, LONG nsamp);
+LONG st_rawwrite(ft_t ft, LONG *buf, LONG nsamp);
 
 /* Utilities to byte-swap values, use libc optimized macro's if possible  */
 #ifdef HAVE_BYTESWAP_H
@@ -322,17 +295,17 @@
 #define st_swapl(x) bswap_32(x)
 #define st_swapf(x) (float)bswap_32((ULONG)(x))
 #else
-unsigned short st_swapw(P1(unsigned short us));		/* Swap short */
-ULONG  	       st_swapl(P1(ULONG ul));			/* Swap long */
-float  	       st_swapf(P1(float f));			/* Swap float */
+unsigned short st_swapw(unsigned short us);		/* Swap short */
+ULONG  	       st_swapl(ULONG ul);			/* Swap long */
+float  	       st_swapf(float f);			/* Swap float */
 #endif
-double 	       st_swapd(P1(double d));			/* Swap double */
+double 	       st_swapd(double d);			/* Swap double */
 
 /* util.c */
-void st_report(P2(const char *, ...));
-void st_warn(P2(const char *, ...));
-void st_fail(P2(const char *, ...))NORET;
-void st_fail_errno(P4(ft_t, int, const char *, ...));
+void st_report(const char *, ...);
+void st_warn(const char *, ...);
+void st_fail(const char *, ...) NORET;
+void st_fail_errno(ft_t, int, const char *, ...);
 
 int st_is_bigendian(void);
 int st_is_littleendian(void);
@@ -345,20 +318,20 @@
 #define ST_IS_LITTLEENDIAN st_is_littleendian()
 #endif
 
-int st_geteffect_opt(P3(eff_t, int, char **));
-int st_geteffect(P2(eff_t, char *));
-int st_updateeffect(P4(eff_t, ft_t, ft_t, int));
-void st_gettype(P1(ft_t));
-void st_checkformat(P1(ft_t));
-void st_copyformat(P2(ft_t, ft_t));
-void st_cmpformats(P2(ft_t, ft_t));
-double st_parsetime(P1(char *));
+int st_geteffect_opt(eff_t, int, char **);
+int st_geteffect(eff_t, char *);
+int st_updateeffect(eff_t, ft_t, ft_t, int);
+void st_gettype(ft_t);
+void st_checkformat(ft_t);
+void st_copyformat(ft_t, ft_t);
+void st_cmpformats(ft_t, ft_t);
+double st_parsetime(char *);
 
 /* FIXME: Recording hacks shouldn't display a "sigint" style interface.
  * Instead we should provide a function to call when done playing/recording.
  * sox.c should be responsible for registering to sigint.
  */
-void sigintreg(P1(ft_t));
+void sigintreg(ft_t);
 
 /* export flags */
 /* FIXME: these declared in util.c, inappropriate for lib */
@@ -390,7 +363,7 @@
 #define ST_EOF (-1)
 #define ST_SUCCESS (0)
 
-const char *st_version(P0);			/* return version number */
+const char *st_version(void);			/* return version number */
 
 /* ST specific error codes.  The rest directly map from errno. */
 #define ST_EHDR 2000		/* Invalid Audio Header */
--- a/src/sunaudio.c
+++ b/src/sunaudio.c
@@ -17,7 +17,7 @@
  */
 
 #include <sys/ioctl.h>
-#if defined(__SVR4) || define(__NeBSD__)
+#if defined(__SVR4) || defined(__NetBSD__)
 #ifdef __NetBSD__
 #include <sys/types.h>  /* This should be in audioio.h itself but its not */
 #endif
--- a/src/voc.c
+++ b/src/voc.c
@@ -167,9 +167,9 @@
 
 #define	min(a, b)	(((a) < (b)) ? (a) : (b))
 
-static int getblock(P1(ft_t));
-static void blockstart(P1(ft_t));
-static void blockstop(P1(ft_t));
+static int getblock(ft_t);
+static void blockstart(ft_t);
+static void blockstop(ft_t);
 
 int st_vocstartread(ft) 
 ft_t ft;
--- a/src/wav.c
+++ b/src/wav.c
@@ -114,7 +114,7 @@
 
 static char *wav_format_str();
 
-static int wavwritehdr(P2(ft_t, int));
+static int wavwritehdr(ft_t, int);
 
 
 /****************************************************************************/
--- a/src/wve.c
+++ b/src/wve.c
@@ -20,7 +20,7 @@
     short repeats;
     };
 
-static void wvewriteheader(P1(ft_t ft));
+static void wvewriteheader(ft_t ft);
 
 int st_wvestartread(ft) 
 ft_t ft;