ref: aebade976e2e351524c119a1f54435fd4b66cb20
parent: 3965e4ac88ef6df5057b018fab8d15e9512699fc
author: cbagwell <cbagwell>
date: Mon Nov 5 22:54:56 EST 2001
Adding some checks for int*_t typedefs.
--- a/configure
+++ b/configure
@@ -1044,13 +1044,53 @@
fi
echo "$ac_t""$CPP" 1>&6
+echo $ac_n "checking for inline""... $ac_c" 1>&6
+echo "configure:1049: checking for inline" >&5
+if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ ac_cv_c_inline=no
+for ac_kw in inline __inline__ __inline; do
+ cat > conftest.$ac_ext <<EOF
+#line 1056 "configure"
+#include "confdefs.h"
+int main() {
+} $ac_kw foo() {
+; return 0; }
+EOF
+if { (eval echo configure:1063: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ ac_cv_c_inline=$ac_kw; break
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+fi
+rm -f conftest*
+done
+
+fi
+
+echo "$ac_t""$ac_cv_c_inline" 1>&6
+case "$ac_cv_c_inline" in
+ inline | yes) ;;
+ no) cat >> confdefs.h <<\EOF
+#define inline
+EOF
+ ;;
+ *) cat >> confdefs.h <<EOF
+#define inline $ac_cv_c_inline
+EOF
+ ;;
+esac
+
+
for ac_prog in sed
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1054: checking for $ac_word" >&5
+echo "configure:1094: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_SED'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1109,7 +1149,7 @@
fi
echo $ac_n "checking host system type""... $ac_c" 1>&6
-echo "configure:1113: checking host system type" >&5
+echo "configure:1153: checking host system type" >&5
host_alias=$host
case "$host_alias" in
@@ -1130,7 +1170,7 @@
echo "$ac_t""$host" 1>&6
echo $ac_n "checking target system type""... $ac_c" 1>&6
-echo "configure:1134: checking target system type" >&5
+echo "configure:1174: checking target system type" >&5
target_alias=$target
case "$target_alias" in
@@ -1148,7 +1188,7 @@
echo "$ac_t""$target" 1>&6
echo $ac_n "checking build system type""... $ac_c" 1>&6
-echo "configure:1152: checking build system type" >&5
+echo "configure:1192: checking build system type" >&5
build_alias=$build
case "$build_alias" in
@@ -1190,7 +1230,7 @@
echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6
-echo "configure:1194: checking whether byte ordering is bigendian" >&5
+echo "configure:1234: checking whether byte ordering is bigendian" >&5
if eval "test \"`echo '$''{'ac_cv_c_bigendian'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1197,7 +1237,7 @@
ac_cv_c_bigendian=unknown
# See if sys/param.h defines the BYTE_ORDER macro.
cat > conftest.$ac_ext <<EOF
-#line 1201 "configure"
+#line 1241 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/param.h>
@@ -1208,11 +1248,11 @@
#endif
; return 0; }
EOF
-if { (eval echo configure:1212: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1252: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
# It does; now see whether it defined to BIG_ENDIAN or not.
cat > conftest.$ac_ext <<EOF
-#line 1216 "configure"
+#line 1256 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/param.h>
@@ -1223,7 +1263,7 @@
#endif
; return 0; }
EOF
-if { (eval echo configure:1227: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1267: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_c_bigendian=yes
else
@@ -1243,7 +1283,7 @@
{ echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
else
cat > conftest.$ac_ext <<EOF
-#line 1247 "configure"
+#line 1287 "configure"
#include "confdefs.h"
main () {
/* Are we little or big endian? From Harbison&Steele. */
@@ -1256,7 +1296,7 @@
exit (u.c[sizeof (long) - 1] == 1);
}
EOF
-if { (eval echo configure:1260: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:1300: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_c_bigendian=no
else
@@ -1283,14 +1323,14 @@
echo "checking if math library is required during link" 1>&6
-echo "configure:1287: checking if math library is required during link" >&5
+echo "configure:1327: checking if math library is required during link" >&5
echo $ac_n "checking for pow""... $ac_c" 1>&6
-echo "configure:1289: checking for pow" >&5
+echo "configure:1329: checking for pow" >&5
if eval "test \"`echo '$''{'ac_cv_func_pow'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1294 "configure"
+#line 1334 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char pow(); below. */
@@ -1313,7 +1353,7 @@
; return 0; }
EOF
-if { (eval echo configure:1317: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1357: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_pow=yes"
else
@@ -1335,7 +1375,7 @@
if test "$ac_cv_func_pow" = no
then
echo $ac_n "checking for pow in -lm""... $ac_c" 1>&6
-echo "configure:1339: checking for pow in -lm" >&5
+echo "configure:1379: checking for pow in -lm" >&5
ac_lib_var=`echo m'_'pow | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -1343,7 +1383,7 @@
ac_save_LIBS="$LIBS"
LIBS="-lm $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 1347 "configure"
+#line 1387 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -1354,7 +1394,7 @@
pow()
; return 0; }
EOF
-if { (eval echo configure:1358: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1398: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -1402,17 +1442,17 @@
ac_safe=`echo "gsm.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for gsm.h""... $ac_c" 1>&6
-echo "configure:1406: checking for gsm.h" >&5
+echo "configure:1446: checking for gsm.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1411 "configure"
+#line 1451 "configure"
#include "confdefs.h"
#include <gsm.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1416: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1456: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -1437,7 +1477,7 @@
if test "$gsminc" = yes
then
echo $ac_n "checking for gsm_create in -lgsm""... $ac_c" 1>&6
-echo "configure:1441: checking for gsm_create in -lgsm" >&5
+echo "configure:1481: checking for gsm_create in -lgsm" >&5
ac_lib_var=`echo gsm'_'gsm_create | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -1445,7 +1485,7 @@
ac_save_LIBS="$LIBS"
LIBS="-lgsm $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 1449 "configure"
+#line 1489 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -1456,7 +1496,7 @@
gsm_create()
; return 0; }
EOF
-if { (eval echo configure:1460: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1500: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -1506,17 +1546,17 @@
ac_safe=`echo "vorbis/codec.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for vorbis/codec.h""... $ac_c" 1>&6
-echo "configure:1510: checking for vorbis/codec.h" >&5
+echo "configure:1550: checking for vorbis/codec.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1515 "configure"
+#line 1555 "configure"
#include "confdefs.h"
#include <vorbis/codec.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1520: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1560: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -1541,7 +1581,7 @@
if test "$ogg_vorbisinc" = yes
then
echo $ac_n "checking for vorbis_analysis_init in -lvorbis""... $ac_c" 1>&6
-echo "configure:1545: checking for vorbis_analysis_init in -lvorbis" >&5
+echo "configure:1585: checking for vorbis_analysis_init in -lvorbis" >&5
ac_lib_var=`echo vorbis'_'vorbis_analysis_init | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -1549,7 +1589,7 @@
ac_save_LIBS="$LIBS"
LIBS="-lvorbis $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 1553 "configure"
+#line 1593 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -1560,7 +1600,7 @@
vorbis_analysis_init()
; return 0; }
EOF
-if { (eval echo configure:1564: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1604: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -1588,21 +1628,21 @@
CPPFLAGS="$ac_save_CPPFLAGS"
-for ac_hdr in getopt.h unistd.h malloc.h byteswap.h
+for ac_hdr in getopt.h unistd.h malloc.h byteswap.h sys/types.h inttypes.h stdint.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:1596: checking for $ac_hdr" >&5
+echo "configure:1636: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1601 "configure"
+#line 1641 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1606: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1646: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -1633,12 +1673,12 @@
for ac_func in getopt strerror memmove rand
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:1637: checking for $ac_func" >&5
+echo "configure:1677: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1642 "configure"
+#line 1682 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -1661,7 +1701,7 @@
; return 0; }
EOF
-if { (eval echo configure:1665: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1705: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -1693,17 +1733,17 @@
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:1697: checking for $ac_hdr" >&5
+echo "configure:1737: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1702 "configure"
+#line 1742 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1707: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1747: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -1734,9 +1774,9 @@
if test "$alsa_dsp" = yes
then
echo $ac_n "checking for ALSA ioctl API""... $ac_c" 1>&6
-echo "configure:1738: checking for ALSA ioctl API" >&5
+echo "configure:1778: checking for ALSA ioctl API" >&5
cat > conftest.$ac_ext <<EOF
-#line 1740 "configure"
+#line 1780 "configure"
#include "confdefs.h"
#include <linux/asound.h>
@@ -1747,7 +1787,7 @@
; return 0; }
EOF
-if { (eval echo configure:1751: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1791: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
alsa_api_ver=oldapi
else
@@ -1770,17 +1810,17 @@
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:1774: checking for $ac_hdr" >&5
+echo "configure:1814: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1779 "configure"
+#line 1819 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1784: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1824: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -1821,17 +1861,17 @@
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:1825: checking for $ac_hdr" >&5
+echo "configure:1865: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1830 "configure"
+#line 1870 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1835: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1875: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
--- a/configure.in
+++ b/configure.in
@@ -59,6 +59,7 @@
AC_PROG_RANLIB
AC_PROG_INSTALL
AC_PROG_CPP
+AC_C_INLINE
AC_CHECK_PROGS(SED, sed)
@@ -161,7 +162,7 @@
dnl Checks for header files.
-AC_CHECK_HEADERS(getopt.h unistd.h malloc.h byteswap.h)
+AC_CHECK_HEADERS(getopt.h unistd.h malloc.h byteswap.h sys/types.h inttypes.h stdint.h)
dnl Checks for library functions.
--- a/src/dat.c
+++ b/src/dat.c
@@ -70,6 +70,7 @@
dat_t dat = (dat_t) ft->priv;
double srate;
char s[80];
+ long rate;
if (ft->info.channels > 1)
{
@@ -83,11 +84,8 @@
dat->timevalue = 0.0;
srate = ft->info.rate;
dat->deltat = 1.0 / srate;
-#ifdef __alpha__
- sprintf(s,"; Sample Rate %d\015\n", ft->info.rate);
-#else
- sprintf(s,"; Sample Rate %ld\015\n",ft->info.rate);
-#endif
+ rate = ft->info.rate;
+ sprintf(s,"; Sample Rate %ld\015\n",rate);
st_writes(ft, s);
return (ST_SUCCESS);
--- a/src/filter.c
+++ b/src/filter.c
@@ -86,7 +86,7 @@
return (ST_EOF);
}
- if ((n >= 2) && !sscanf(argv[1], "%ld", &f->Nwin))
+ if ((n >= 2) && !sscanf(argv[1], "%d", &f->Nwin))
{
st_fail("Usage: filter low-high [ windowlength ]");
return (ST_EOF);
--- a/src/map.c
+++ b/src/map.c
@@ -38,13 +38,8 @@
fprintf(stderr, "Loop info:\n");
for(i = 0; i < 8; i++) {
-#ifdef __alpha__
fprintf(stderr, "Loop %d: start: %6d",i,effp->loops[i].start);
fprintf(stderr, " length: %6d", effp->loops[i].length);
-#else
- fprintf(stderr, "Loop %d: start: %6ld",i,effp->loops[i].start);
- fprintf(stderr, " length: %6ld", effp->loops[i].length);
-#endif
fprintf(stderr, " count: %6d", effp->loops[i].count);
fprintf(stderr, " type: ");
switch(effp->loops[i].type) {
--- a/src/sox.c
+++ b/src/sox.c
@@ -441,13 +441,8 @@
case 'r':
if (! ft) usage("-r");
str = optarg;
-#ifdef __alpha__
if ((! sscanf(str, "%u", &ft->info.rate)) ||
(ft->info.rate <= 0))
-#else
- if ((! sscanf(str, "%lu", &ft->info.rate)) ||
- (ft->info.rate <= 0))
-#endif
st_fail("-r must be given a positive integer");
break;
case 'v':
--- a/src/sphere.c
+++ b/src/sphere.c
@@ -35,6 +35,7 @@
char fldname[64], fldtype[16], fldsval[128];
int i;
int header_size, bytes_read;
+ long rate;
/* Needed for rawread() */
rc = st_rawstartread(ft);
@@ -95,11 +96,8 @@
if (strncmp(buf, "sample_rate ", 12) == 0 &&
ft->info.rate == 0)
{
-#ifdef __alpha__
- sscanf(buf, "%s %s %d", fldname, fldtype, &ft->info.rate);
-#else
- sscanf(buf, "%s %s %ld", fldname, fldtype, &ft->info.rate);
-#endif
+ sscanf(buf, "%s %s %ld", fldname, fldtype, &rate);
+ ft->info.rate = rate;
}
if (strncmp(buf, "sample_byte_format", 18) == 0)
{
@@ -248,6 +246,7 @@
int rc;
char buf[128];
sphere_t sphere = (sphere_t) ft->priv;
+ long samples, rate;
rc = st_rawstopwrite(ft);
if (rc)
@@ -262,11 +261,8 @@
st_writes(ft, "NIST_1A\n");
st_writes(ft, " 1024\n");
-#ifdef __alpha__
- sprintf(buf, "sample_count -i %d\n", sphere->numSamples/ft->info.channels);
-#else
- sprintf(buf, "sample_count -i %ld\n", sphere->numSamples/ft->info.channels);
-#endif
+ samples = sphere->numSamples/ft->info.channels;
+ sprintf(buf, "sample_count -i %ld\n", samples);
st_writes(ft, buf);
sprintf(buf, "sample_n_bytes -i %d\n", ft->info.size);
@@ -285,11 +281,8 @@
}
st_writes(ft, buf);
-#ifdef __alpha__
- sprintf(buf, "sample_rate -i %d\n", ft->info.rate);
-#else
- sprintf(buf, "sample_rate -i %ld\n", ft->info.rate);
-#endif
+ rate = ft->info.rate;
+ sprintf(buf, "sample_rate -i %ld\n", rate);
st_writes(ft, buf);
if (ft->info.encoding == ST_ENCODING_ULAW)
--- a/src/st.h
+++ b/src/st.h
@@ -22,21 +22,21 @@
#define ST_LIB_VERSION_CODE 0x0c1103
#define ST_LIB_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))
-#ifdef __alpha__
-#include <sys/types.h> /* To get defines for exact size integers */
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
#endif
+#ifdef HAVE_INTTYPES_H
+#include <inttypes.h>
+#else
+#ifdef HAVE_STDINT_H
+#include <stdint.h>
+#endif
+#endif
-#ifdef __alpha
typedef int32_t st_sample_t;
-typdef uint32_t st_size_t;
+typedef uint32_t st_size_t;
typedef int32_t st_ssize_t;
-typedef uint32t_t st_rate_t;
-#else
-typedef long st_sample_t;
-typedef unsigned long st_size_t;
-typedef long st_ssize_t;
-typedef unsigned long st_rate_t;
-#endif
+typedef uint32_t st_rate_t;
/* Minimum and maximum values a sample can hold. */
#define ST_SAMPLE_MAX 0x7fffffffL
@@ -73,13 +73,8 @@
#define ST_SSIZE_MIN (-ST_SSIZE_MAX - 1L)
/* FIXME: Remove from usage by libst */
-#ifdef __alpha__
#define LONG int32_t
#define ULONG u_int32_t
-#else
-#define LONG long
-#define ULONG unsigned long
-#endif
/* FIXME: Get rid of this and usage of LONG_MAX */
#define MAXLONG 0x7fffffffL
--- a/src/st_i.h
+++ b/src/st_i.h
@@ -14,9 +14,6 @@
*/
#include "st.h"
-// FIXME: One works on solaris, the other on Linux
-//#include <sys/types.h>
-#include <stdint.h>
#ifdef __cplusplus
extern "C" {
@@ -29,10 +26,8 @@
/* various gcc optimizations and portablity defines */
#ifdef __GNUC__
#define NORET __attribute__((noreturn))
-#define INLINE inline
#else
#define NORET
-#define INLINE
#endif
#ifdef USE_REGPARM
--- a/src/stat.c
+++ b/src/stat.c
@@ -351,7 +351,7 @@
fprintf(stderr, "\n\n");
}
/* print out the info */
- fprintf(stderr, "Samples read: %12lu\n", stat->read);
+ fprintf(stderr, "Samples read: %12u\n", stat->read);
fprintf(stderr, "Length (seconds): %12.6f\n", (double)stat->read/effp->ininfo.rate/effp->ininfo.channels);
if (stat->srms)
fprintf(stderr, "Scaled by rms: %12.6f\n", rms);
--- a/src/vorbis.c
+++ b/src/vorbis.c
@@ -315,6 +315,7 @@
{
vorbis_t vb = (vorbis_t) ft->priv;
vorbis_enc_t *ve;
+ long rate;
/* Allocate memory for all of the structures */
ve = vb->vorbis_enc_data = malloc(sizeof(vorbis_enc_t));
@@ -325,8 +326,9 @@
vorbis_info_init(&ve->vi);
/* DEBUG */
+ rate = ft->info.rate;
fprintf(stdout, "Channels: %d Rate: %ld\n", ft->info.channels,
- ft->info.rate);
+ rate);
/* Set encoding to average bit rate of 128kbps with no min or max */
vorbis_encode_init(&ve->vi, ft->info.channels, ft->info.rate,