From 8bc8f0d036a8257267fe9dc621b3d0861ab9d17d Mon Sep 17 00:00:00 2001 From: Peter Schneider-Kamp Date: Mon, 10 Jul 2000 17:15:07 +0000 Subject: ANSI-fication --- Modules/audioop.c | 96 +++++++++++++-------------------------------------- Modules/fcntlmodule.c | 24 ++++--------- Modules/gcmodule.c | 20 +++-------- 3 files changed, 35 insertions(+), 105 deletions(-) diff --git a/Modules/audioop.c b/Modules/audioop.c index cc5634d..73612cb 100644 --- a/Modules/audioop.c +++ b/Modules/audioop.c @@ -26,7 +26,6 @@ typedef unsigned long Py_UInt32; #if defined(__CHAR_UNSIGNED__) #if defined(signed) -!ERROR!; READ THE SOURCE FILE!; /* This module currently does not work on systems where only unsigned characters are available. Take it out of Setup. Sorry. */ #endif @@ -95,8 +94,7 @@ static int ulaw_table[256] = { #define CLIP 32635 static unsigned char -st_linear_to_ulaw( sample ) - int sample; +st_linear_to_ulaw(int sample) { 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, @@ -162,9 +160,7 @@ static int stepsizeTable[89] = { static PyObject *AudioopError; static PyObject * -audioop_getsample(self, args) - PyObject *self; - PyObject *args; +audioop_getsample(PyObject *self, PyObject *args) { signed char *cp; int len, size, val = 0; @@ -187,9 +183,7 @@ audioop_getsample(self, args) } static PyObject * -audioop_max(self, args) - PyObject *self; - PyObject *args; +audioop_max(PyObject *self, PyObject *args) { signed char *cp; int len, size, val = 0; @@ -213,9 +207,7 @@ audioop_max(self, args) } static PyObject * -audioop_minmax(self, args) - PyObject *self; - PyObject *args; +audioop_minmax(PyObject *self, PyObject *args) { signed char *cp; int len, size, val = 0; @@ -239,9 +231,7 @@ audioop_minmax(self, args) } static PyObject * -audioop_avg(self, args) - PyObject *self; - PyObject *args; +audioop_avg(PyObject *self, PyObject *args) { signed char *cp; int len, size, val = 0; @@ -268,9 +258,7 @@ audioop_avg(self, args) } static PyObject * -audioop_rms(self, args) - PyObject *self; - PyObject *args; +audioop_rms(PyObject *self, PyObject *args) { signed char *cp; int len, size, val = 0; @@ -343,9 +331,7 @@ static double _sum2(a, b, len) ** is completely recalculated each step. */ static PyObject * -audioop_findfit(self, args) - PyObject *self; - PyObject *args; +audioop_findfit(PyObject *self, PyObject *args) { short *cp1, *cp2; int len1, len2; @@ -403,9 +389,7 @@ audioop_findfit(self, args) ** See the comment for findfit for details. */ static PyObject * -audioop_findfactor(self, args) - PyObject *self; - PyObject *args; +audioop_findfactor(PyObject *self, PyObject *args) { short *cp1, *cp2; int len1, len2; @@ -435,9 +419,7 @@ audioop_findfactor(self, args) ** that contains the most energy. */ static PyObject * -audioop_findmax(self, args) - PyObject *self; - PyObject *args; +audioop_findmax(PyObject *self, PyObject *args) { short *cp1; int len1, len2; @@ -481,9 +463,7 @@ audioop_findmax(self, args) } static PyObject * -audioop_avgpp(self, args) - PyObject *self; - PyObject *args; +audioop_avgpp(PyObject *self, PyObject *args) { signed char *cp; int len, size, val = 0, prevval = 0, prevextremevalid = 0, @@ -540,9 +520,7 @@ audioop_avgpp(self, args) } static PyObject * -audioop_maxpp(self, args) - PyObject *self; - PyObject *args; +audioop_maxpp(PyObject *self, PyObject *args) { signed char *cp; int len, size, val = 0, prevval = 0, prevextremevalid = 0, @@ -595,9 +573,7 @@ audioop_maxpp(self, args) } static PyObject * -audioop_cross(self, args) - PyObject *self; - PyObject *args; +audioop_cross(PyObject *self, PyObject *args) { signed char *cp; int len, size, val = 0; @@ -624,9 +600,7 @@ audioop_cross(self, args) } static PyObject * -audioop_mul(self, args) - PyObject *self; - PyObject *args; +audioop_mul(PyObject *self, PyObject *args) { signed char *cp, *ncp; int len, size, val = 0; @@ -667,9 +641,7 @@ audioop_mul(self, args) } static PyObject * -audioop_tomono(self, args) - PyObject *self; - PyObject *args; +audioop_tomono(PyObject *self, PyObject *args) { signed char *cp, *ncp; int len, size, val1 = 0, val2 = 0; @@ -713,9 +685,7 @@ audioop_tomono(self, args) } static PyObject * -audioop_tostereo(self, args) - PyObject *self; - PyObject *args; +audioop_tostereo(PyObject *self, PyObject *args) { signed char *cp, *ncp; int len, size, val1, val2, val = 0; @@ -767,9 +737,7 @@ audioop_tostereo(self, args) } static PyObject * -audioop_add(self, args) - PyObject *self; - PyObject *args; +audioop_add(PyObject *self, PyObject *args) { signed char *cp1, *cp2, *ncp; int len1, len2, size, val1 = 0, val2 = 0, maxval, newval; @@ -822,9 +790,7 @@ audioop_add(self, args) } static PyObject * -audioop_bias(self, args) - PyObject *self; - PyObject *args; +audioop_bias(PyObject *self, PyObject *args) { signed char *cp, *ncp; int len, size, val = 0; @@ -860,9 +826,7 @@ audioop_bias(self, args) } static PyObject * -audioop_reverse(self, args) - PyObject *self; - PyObject *args; +audioop_reverse(PyObject *self, PyObject *args) { signed char *cp; unsigned char *ncp; @@ -899,9 +863,7 @@ audioop_reverse(self, args) } static PyObject * -audioop_lin2lin(self, args) - PyObject *self; - PyObject *args; +audioop_lin2lin(PyObject *self, PyObject *args) { signed char *cp; unsigned char *ncp; @@ -949,9 +911,7 @@ gcd(a, b) } static PyObject * -audioop_ratecv(self, args) - PyObject *self; - PyObject *args; +audioop_ratecv(PyObject *self, PyObject *args) { char *cp, *ncp; int len, size, nchannels, inrate, outrate, weightA, weightB; @@ -1090,9 +1050,7 @@ audioop_ratecv(self, args) } static PyObject * -audioop_lin2ulaw(self, args) - PyObject *self; - PyObject *args; +audioop_lin2ulaw(PyObject *self, PyObject *args) { signed char *cp; unsigned char *ncp; @@ -1125,9 +1083,7 @@ audioop_lin2ulaw(self, args) } static PyObject * -audioop_ulaw2lin(self, args) - PyObject *self; - PyObject *args; +audioop_ulaw2lin(PyObject *self, PyObject *args) { unsigned char *cp; unsigned char cval; @@ -1162,9 +1118,7 @@ audioop_ulaw2lin(self, args) } static PyObject * -audioop_lin2adpcm(self, args) - PyObject *self; - PyObject *args; +audioop_lin2adpcm(PyObject *self, PyObject *args) { signed char *cp; signed char *ncp; @@ -1273,9 +1227,7 @@ audioop_lin2adpcm(self, args) } static PyObject * -audioop_adpcm2lin(self, args) - PyObject *self; - PyObject *args; +audioop_adpcm2lin(PyObject *self, PyObject *args) { signed char *cp; signed char *ncp; diff --git a/Modules/fcntlmodule.c b/Modules/fcntlmodule.c index 0755171..37ea9eb 100644 --- a/Modules/fcntlmodule.c +++ b/Modules/fcntlmodule.c @@ -27,9 +27,7 @@ redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. /* fcntl(fd, opt, [arg]) */ static PyObject * -fcntl_fcntl(self, args) - PyObject *self; /* Not used */ - PyObject *args; +fcntl_fcntl(PyObject *self, PyObject *args) { int fd; int code; @@ -87,9 +85,7 @@ is optional, and defaults to 0; it may be an int or a string."; /* ioctl(fd, opt, [arg]) */ static PyObject * -fcntl_ioctl(self, args) - PyObject *self; /* Not used */ - PyObject *args; +fcntl_ioctl(PyObject *self, PyObject *args) { int fd; int code; @@ -146,9 +142,7 @@ is optional, and defaults to 0; it may be an int or a string."; /* flock(fd, operation) */ static PyObject * -fcntl_flock(self, args) - PyObject *self; /* Not used */ - PyObject *args; +fcntl_flock(PyObject *self, PyObject *args) { int fd; int code; @@ -206,9 +200,7 @@ emulated using fcntl().)"; /* lockf(fd, operation) */ static PyObject * -fcntl_lockf(self, args) - PyObject *self; /* Not used */ - PyObject *args; +fcntl_lockf(PyObject *self, PyObject *args) { int fd, code, ret, whence = 0; PyObject *lenobj = NULL, *startobj = NULL; @@ -299,10 +291,7 @@ a file or socket object."; /* Module initialisation */ static int -ins(d, symbol, value) - PyObject* d; - char* symbol; - long value; +ins(PyObject* d, char* symbol, long value) { PyObject* v = PyInt_FromLong(value); if (!v || PyDict_SetItemString(d, symbol, v) < 0) @@ -313,8 +302,7 @@ ins(d, symbol, value) } static int -all_ins(d) - PyObject* d; +all_ins(PyObject* d) { if (ins(d, "LOCK_SH", (long)LOCK_SH)) return -1; if (ins(d, "LOCK_EX", (long)LOCK_EX)) return -1; diff --git a/Modules/gcmodule.c b/Modules/gcmodule.c index 43acbef..5ceea01 100644 --- a/Modules/gcmodule.c +++ b/Modules/gcmodule.c @@ -527,9 +527,7 @@ static char collect__doc__[] = ; static PyObject * -Py_collect(self, args) - PyObject *self; - PyObject *args; +Py_collect(PyObject *self, PyObject *args) { long n; @@ -561,9 +559,7 @@ static char set_debug__doc__[] = ; static PyObject * -Py_set_debug(self, args) - PyObject *self; - PyObject *args; +Py_set_debug(PyObject *self, PyObject *args) { if (!PyArg_ParseTuple(args, "l", &debug)) return NULL; @@ -579,9 +575,7 @@ static char get_debug__doc__[] = ; static PyObject * -Py_get_debug(self, args) - PyObject *self; - PyObject *args; +Py_get_debug(PyObject *self, PyObject *args) { if(!PyArg_ParseTuple(args, "")) /* no args */ return NULL; @@ -597,9 +591,7 @@ static char set_thresh__doc__[] = ; static PyObject * -Py_set_thresh(self, args) - PyObject *self; - PyObject *args; +Py_set_thresh(PyObject *self, PyObject *args) { if (!PyArg_ParseTuple(args, "i|ii", &threshold0, &threshold1, &threshold2)) @@ -616,9 +608,7 @@ static char get_thresh__doc__[] = ; static PyObject * -Py_get_thresh(self, args) - PyObject *self; - PyObject *args; +Py_get_thresh(PyObject *self, PyObject *args) { if(!PyArg_ParseTuple(args, "")) /* no args */ return NULL; -- cgit v0.12