Commit 5ef4be7b authored by Peter Schneider-Kamp's avatar Peter Schneider-Kamp

ANSI-fication

parent 00fb0316
...@@ -26,7 +26,6 @@ typedef unsigned long Py_UInt32; ...@@ -26,7 +26,6 @@ typedef unsigned long Py_UInt32;
#if defined(__CHAR_UNSIGNED__) #if defined(__CHAR_UNSIGNED__)
#if defined(signed) #if defined(signed)
!ERROR!; READ THE SOURCE FILE!;
/* This module currently does not work on systems where only unsigned /* This module currently does not work on systems where only unsigned
characters are available. Take it out of Setup. Sorry. */ characters are available. Take it out of Setup. Sorry. */
#endif #endif
...@@ -95,8 +94,7 @@ static int ulaw_table[256] = { ...@@ -95,8 +94,7 @@ static int ulaw_table[256] = {
#define CLIP 32635 #define CLIP 32635
static unsigned char static unsigned char
st_linear_to_ulaw( sample ) st_linear_to_ulaw(int sample)
int sample;
{ {
static int exp_lut[256] = {0,0,1,1,2,2,2,2,3,3,3,3,3,3,3,3, static int exp_lut[256] = {0,0,1,1,2,2,2,2,3,3,3,3,3,3,3,3,
4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4, 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
...@@ -162,9 +160,7 @@ static int stepsizeTable[89] = { ...@@ -162,9 +160,7 @@ static int stepsizeTable[89] = {
static PyObject *AudioopError; static PyObject *AudioopError;
static PyObject * static PyObject *
audioop_getsample(self, args) audioop_getsample(PyObject *self, PyObject *args)
PyObject *self;
PyObject *args;
{ {
signed char *cp; signed char *cp;
int len, size, val = 0; int len, size, val = 0;
...@@ -187,9 +183,7 @@ audioop_getsample(self, args) ...@@ -187,9 +183,7 @@ audioop_getsample(self, args)
} }
static PyObject * static PyObject *
audioop_max(self, args) audioop_max(PyObject *self, PyObject *args)
PyObject *self;
PyObject *args;
{ {
signed char *cp; signed char *cp;
int len, size, val = 0; int len, size, val = 0;
...@@ -213,9 +207,7 @@ audioop_max(self, args) ...@@ -213,9 +207,7 @@ audioop_max(self, args)
} }
static PyObject * static PyObject *
audioop_minmax(self, args) audioop_minmax(PyObject *self, PyObject *args)
PyObject *self;
PyObject *args;
{ {
signed char *cp; signed char *cp;
int len, size, val = 0; int len, size, val = 0;
...@@ -239,9 +231,7 @@ audioop_minmax(self, args) ...@@ -239,9 +231,7 @@ audioop_minmax(self, args)
} }
static PyObject * static PyObject *
audioop_avg(self, args) audioop_avg(PyObject *self, PyObject *args)
PyObject *self;
PyObject *args;
{ {
signed char *cp; signed char *cp;
int len, size, val = 0; int len, size, val = 0;
...@@ -268,9 +258,7 @@ audioop_avg(self, args) ...@@ -268,9 +258,7 @@ audioop_avg(self, args)
} }
static PyObject * static PyObject *
audioop_rms(self, args) audioop_rms(PyObject *self, PyObject *args)
PyObject *self;
PyObject *args;
{ {
signed char *cp; signed char *cp;
int len, size, val = 0; int len, size, val = 0;
...@@ -343,9 +331,7 @@ static double _sum2(a, b, len) ...@@ -343,9 +331,7 @@ static double _sum2(a, b, len)
** is completely recalculated each step. ** is completely recalculated each step.
*/ */
static PyObject * static PyObject *
audioop_findfit(self, args) audioop_findfit(PyObject *self, PyObject *args)
PyObject *self;
PyObject *args;
{ {
short *cp1, *cp2; short *cp1, *cp2;
int len1, len2; int len1, len2;
...@@ -403,9 +389,7 @@ audioop_findfit(self, args) ...@@ -403,9 +389,7 @@ audioop_findfit(self, args)
** See the comment for findfit for details. ** See the comment for findfit for details.
*/ */
static PyObject * static PyObject *
audioop_findfactor(self, args) audioop_findfactor(PyObject *self, PyObject *args)
PyObject *self;
PyObject *args;
{ {
short *cp1, *cp2; short *cp1, *cp2;
int len1, len2; int len1, len2;
...@@ -435,9 +419,7 @@ audioop_findfactor(self, args) ...@@ -435,9 +419,7 @@ audioop_findfactor(self, args)
** that contains the most energy. ** that contains the most energy.
*/ */
static PyObject * static PyObject *
audioop_findmax(self, args) audioop_findmax(PyObject *self, PyObject *args)
PyObject *self;
PyObject *args;
{ {
short *cp1; short *cp1;
int len1, len2; int len1, len2;
...@@ -481,9 +463,7 @@ audioop_findmax(self, args) ...@@ -481,9 +463,7 @@ audioop_findmax(self, args)
} }
static PyObject * static PyObject *
audioop_avgpp(self, args) audioop_avgpp(PyObject *self, PyObject *args)
PyObject *self;
PyObject *args;
{ {
signed char *cp; signed char *cp;
int len, size, val = 0, prevval = 0, prevextremevalid = 0, int len, size, val = 0, prevval = 0, prevextremevalid = 0,
...@@ -540,9 +520,7 @@ audioop_avgpp(self, args) ...@@ -540,9 +520,7 @@ audioop_avgpp(self, args)
} }
static PyObject * static PyObject *
audioop_maxpp(self, args) audioop_maxpp(PyObject *self, PyObject *args)
PyObject *self;
PyObject *args;
{ {
signed char *cp; signed char *cp;
int len, size, val = 0, prevval = 0, prevextremevalid = 0, int len, size, val = 0, prevval = 0, prevextremevalid = 0,
...@@ -595,9 +573,7 @@ audioop_maxpp(self, args) ...@@ -595,9 +573,7 @@ audioop_maxpp(self, args)
} }
static PyObject * static PyObject *
audioop_cross(self, args) audioop_cross(PyObject *self, PyObject *args)
PyObject *self;
PyObject *args;
{ {
signed char *cp; signed char *cp;
int len, size, val = 0; int len, size, val = 0;
...@@ -624,9 +600,7 @@ audioop_cross(self, args) ...@@ -624,9 +600,7 @@ audioop_cross(self, args)
} }
static PyObject * static PyObject *
audioop_mul(self, args) audioop_mul(PyObject *self, PyObject *args)
PyObject *self;
PyObject *args;
{ {
signed char *cp, *ncp; signed char *cp, *ncp;
int len, size, val = 0; int len, size, val = 0;
...@@ -667,9 +641,7 @@ audioop_mul(self, args) ...@@ -667,9 +641,7 @@ audioop_mul(self, args)
} }
static PyObject * static PyObject *
audioop_tomono(self, args) audioop_tomono(PyObject *self, PyObject *args)
PyObject *self;
PyObject *args;
{ {
signed char *cp, *ncp; signed char *cp, *ncp;
int len, size, val1 = 0, val2 = 0; int len, size, val1 = 0, val2 = 0;
...@@ -713,9 +685,7 @@ audioop_tomono(self, args) ...@@ -713,9 +685,7 @@ audioop_tomono(self, args)
} }
static PyObject * static PyObject *
audioop_tostereo(self, args) audioop_tostereo(PyObject *self, PyObject *args)
PyObject *self;
PyObject *args;
{ {
signed char *cp, *ncp; signed char *cp, *ncp;
int len, size, val1, val2, val = 0; int len, size, val1, val2, val = 0;
...@@ -767,9 +737,7 @@ audioop_tostereo(self, args) ...@@ -767,9 +737,7 @@ audioop_tostereo(self, args)
} }
static PyObject * static PyObject *
audioop_add(self, args) audioop_add(PyObject *self, PyObject *args)
PyObject *self;
PyObject *args;
{ {
signed char *cp1, *cp2, *ncp; signed char *cp1, *cp2, *ncp;
int len1, len2, size, val1 = 0, val2 = 0, maxval, newval; int len1, len2, size, val1 = 0, val2 = 0, maxval, newval;
...@@ -822,9 +790,7 @@ audioop_add(self, args) ...@@ -822,9 +790,7 @@ audioop_add(self, args)
} }
static PyObject * static PyObject *
audioop_bias(self, args) audioop_bias(PyObject *self, PyObject *args)
PyObject *self;
PyObject *args;
{ {
signed char *cp, *ncp; signed char *cp, *ncp;
int len, size, val = 0; int len, size, val = 0;
...@@ -860,9 +826,7 @@ audioop_bias(self, args) ...@@ -860,9 +826,7 @@ audioop_bias(self, args)
} }
static PyObject * static PyObject *
audioop_reverse(self, args) audioop_reverse(PyObject *self, PyObject *args)
PyObject *self;
PyObject *args;
{ {
signed char *cp; signed char *cp;
unsigned char *ncp; unsigned char *ncp;
...@@ -899,9 +863,7 @@ audioop_reverse(self, args) ...@@ -899,9 +863,7 @@ audioop_reverse(self, args)
} }
static PyObject * static PyObject *
audioop_lin2lin(self, args) audioop_lin2lin(PyObject *self, PyObject *args)
PyObject *self;
PyObject *args;
{ {
signed char *cp; signed char *cp;
unsigned char *ncp; unsigned char *ncp;
...@@ -949,9 +911,7 @@ gcd(a, b) ...@@ -949,9 +911,7 @@ gcd(a, b)
} }
static PyObject * static PyObject *
audioop_ratecv(self, args) audioop_ratecv(PyObject *self, PyObject *args)
PyObject *self;
PyObject *args;
{ {
char *cp, *ncp; char *cp, *ncp;
int len, size, nchannels, inrate, outrate, weightA, weightB; int len, size, nchannels, inrate, outrate, weightA, weightB;
...@@ -1090,9 +1050,7 @@ audioop_ratecv(self, args) ...@@ -1090,9 +1050,7 @@ audioop_ratecv(self, args)
} }
static PyObject * static PyObject *
audioop_lin2ulaw(self, args) audioop_lin2ulaw(PyObject *self, PyObject *args)
PyObject *self;
PyObject *args;
{ {
signed char *cp; signed char *cp;
unsigned char *ncp; unsigned char *ncp;
...@@ -1125,9 +1083,7 @@ audioop_lin2ulaw(self, args) ...@@ -1125,9 +1083,7 @@ audioop_lin2ulaw(self, args)
} }
static PyObject * static PyObject *
audioop_ulaw2lin(self, args) audioop_ulaw2lin(PyObject *self, PyObject *args)
PyObject *self;
PyObject *args;
{ {
unsigned char *cp; unsigned char *cp;
unsigned char cval; unsigned char cval;
...@@ -1162,9 +1118,7 @@ audioop_ulaw2lin(self, args) ...@@ -1162,9 +1118,7 @@ audioop_ulaw2lin(self, args)
} }
static PyObject * static PyObject *
audioop_lin2adpcm(self, args) audioop_lin2adpcm(PyObject *self, PyObject *args)
PyObject *self;
PyObject *args;
{ {
signed char *cp; signed char *cp;
signed char *ncp; signed char *ncp;
...@@ -1273,9 +1227,7 @@ audioop_lin2adpcm(self, args) ...@@ -1273,9 +1227,7 @@ audioop_lin2adpcm(self, args)
} }
static PyObject * static PyObject *
audioop_adpcm2lin(self, args) audioop_adpcm2lin(PyObject *self, PyObject *args)
PyObject *self;
PyObject *args;
{ {
signed char *cp; signed char *cp;
signed char *ncp; signed char *ncp;
......
...@@ -27,9 +27,7 @@ redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. ...@@ -27,9 +27,7 @@ redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.
/* fcntl(fd, opt, [arg]) */ /* fcntl(fd, opt, [arg]) */
static PyObject * static PyObject *
fcntl_fcntl(self, args) fcntl_fcntl(PyObject *self, PyObject *args)
PyObject *self; /* Not used */
PyObject *args;
{ {
int fd; int fd;
int code; int code;
...@@ -87,9 +85,7 @@ is optional, and defaults to 0; it may be an int or a string."; ...@@ -87,9 +85,7 @@ is optional, and defaults to 0; it may be an int or a string.";
/* ioctl(fd, opt, [arg]) */ /* ioctl(fd, opt, [arg]) */
static PyObject * static PyObject *
fcntl_ioctl(self, args) fcntl_ioctl(PyObject *self, PyObject *args)
PyObject *self; /* Not used */
PyObject *args;
{ {
int fd; int fd;
int code; int code;
...@@ -146,9 +142,7 @@ is optional, and defaults to 0; it may be an int or a string."; ...@@ -146,9 +142,7 @@ is optional, and defaults to 0; it may be an int or a string.";
/* flock(fd, operation) */ /* flock(fd, operation) */
static PyObject * static PyObject *
fcntl_flock(self, args) fcntl_flock(PyObject *self, PyObject *args)
PyObject *self; /* Not used */
PyObject *args;
{ {
int fd; int fd;
int code; int code;
...@@ -206,9 +200,7 @@ emulated using fcntl().)"; ...@@ -206,9 +200,7 @@ emulated using fcntl().)";
/* lockf(fd, operation) */ /* lockf(fd, operation) */
static PyObject * static PyObject *
fcntl_lockf(self, args) fcntl_lockf(PyObject *self, PyObject *args)
PyObject *self; /* Not used */
PyObject *args;
{ {
int fd, code, ret, whence = 0; int fd, code, ret, whence = 0;
PyObject *lenobj = NULL, *startobj = NULL; PyObject *lenobj = NULL, *startobj = NULL;
...@@ -299,10 +291,7 @@ a file or socket object."; ...@@ -299,10 +291,7 @@ a file or socket object.";
/* Module initialisation */ /* Module initialisation */
static int static int
ins(d, symbol, value) ins(PyObject* d, char* symbol, long value)
PyObject* d;
char* symbol;
long value;
{ {
PyObject* v = PyInt_FromLong(value); PyObject* v = PyInt_FromLong(value);
if (!v || PyDict_SetItemString(d, symbol, v) < 0) if (!v || PyDict_SetItemString(d, symbol, v) < 0)
...@@ -313,8 +302,7 @@ ins(d, symbol, value) ...@@ -313,8 +302,7 @@ ins(d, symbol, value)
} }
static int static int
all_ins(d) all_ins(PyObject* d)
PyObject* d;
{ {
if (ins(d, "LOCK_SH", (long)LOCK_SH)) return -1; if (ins(d, "LOCK_SH", (long)LOCK_SH)) return -1;
if (ins(d, "LOCK_EX", (long)LOCK_EX)) return -1; if (ins(d, "LOCK_EX", (long)LOCK_EX)) return -1;
......
...@@ -527,9 +527,7 @@ static char collect__doc__[] = ...@@ -527,9 +527,7 @@ static char collect__doc__[] =
; ;
static PyObject * static PyObject *
Py_collect(self, args) Py_collect(PyObject *self, PyObject *args)
PyObject *self;
PyObject *args;
{ {
long n; long n;
...@@ -561,9 +559,7 @@ static char set_debug__doc__[] = ...@@ -561,9 +559,7 @@ static char set_debug__doc__[] =
; ;
static PyObject * static PyObject *
Py_set_debug(self, args) Py_set_debug(PyObject *self, PyObject *args)
PyObject *self;
PyObject *args;
{ {
if (!PyArg_ParseTuple(args, "l", &debug)) if (!PyArg_ParseTuple(args, "l", &debug))
return NULL; return NULL;
...@@ -579,9 +575,7 @@ static char get_debug__doc__[] = ...@@ -579,9 +575,7 @@ static char get_debug__doc__[] =
; ;
static PyObject * static PyObject *
Py_get_debug(self, args) Py_get_debug(PyObject *self, PyObject *args)
PyObject *self;
PyObject *args;
{ {
if(!PyArg_ParseTuple(args, "")) /* no args */ if(!PyArg_ParseTuple(args, "")) /* no args */
return NULL; return NULL;
...@@ -597,9 +591,7 @@ static char set_thresh__doc__[] = ...@@ -597,9 +591,7 @@ static char set_thresh__doc__[] =
; ;
static PyObject * static PyObject *
Py_set_thresh(self, args) Py_set_thresh(PyObject *self, PyObject *args)
PyObject *self;
PyObject *args;
{ {
if (!PyArg_ParseTuple(args, "i|ii", &threshold0, if (!PyArg_ParseTuple(args, "i|ii", &threshold0,
&threshold1, &threshold2)) &threshold1, &threshold2))
...@@ -616,9 +608,7 @@ static char get_thresh__doc__[] = ...@@ -616,9 +608,7 @@ static char get_thresh__doc__[] =
; ;
static PyObject * static PyObject *
Py_get_thresh(self, args) Py_get_thresh(PyObject *self, PyObject *args)
PyObject *self;
PyObject *args;
{ {
if(!PyArg_ParseTuple(args, "")) /* no args */ if(!PyArg_ParseTuple(args, "")) /* no args */
return NULL; return NULL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment