Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit f3f33dc

Browse files
committed
Bunch of minor ANSIfications: 'void initfunc()' -> 'void initfunc(void)',
and a couple of functions that were missed in the previous batches. Not terribly tested, but very carefully scrutinized, three times. All these were found by the little findkrc.py that I posted to python-dev, which means there might be more lurking. Cases such as this: long func(a, b) long a; long b; /* flagword */ { and other cases where the last ; in the argument list isn't followed by a newline and an opening curly bracket. Regexps to catch all are welcome, of course ;)
1 parent ff4df6d commit f3f33dc

59 files changed

Lines changed: 103 additions & 117 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Modules/_codecsmodule.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -624,7 +624,7 @@ static PyMethodDef _codecs_functions[] = {
624624
};
625625

626626
DL_EXPORT(void)
627-
init_codecs()
627+
init_codecs(void)
628628
{
629629
Py_InitModule("_codecs", _codecs_functions);
630630
}

Modules/_cursesmodule.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1270,9 +1270,7 @@ static PyMethodDef PyCursesWindow_Methods[] = {
12701270
};
12711271

12721272
static PyObject *
1273-
PyCursesWindow_GetAttr(self, name)
1274-
PyCursesWindowObject *self;
1275-
char *name;
1273+
PyCursesWindow_GetAttr(PyCursesWindowObject *self, char *name)
12761274
{
12771275
return Py_FindMethod(PyCursesWindow_Methods, (PyObject *)self, name);
12781276
}
@@ -2161,7 +2159,7 @@ static PyMethodDef PyCurses_methods[] = {
21612159
/* Initialization function for the module */
21622160

21632161
void
2164-
init_curses()
2162+
init_curses(void)
21652163
{
21662164
PyObject *m, *d, *v;
21672165

Modules/_localemodule.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,7 @@ static struct PyMethodDef PyLocale_Methods[] = {
400400
};
401401

402402
DL_EXPORT(void)
403-
init_locale()
403+
init_locale(void)
404404
{
405405
PyObject *m, *d, *x;
406406

Modules/_sre.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2097,7 +2097,7 @@ void
20972097
#if defined(WIN32)
20982098
__declspec(dllexport)
20992099
#endif
2100-
init_sre()
2100+
init_sre(void)
21012101
{
21022102
/* Patch object types */
21032103
Pattern_Type.ob_type = Match_Type.ob_type =

Modules/_tkinter.c

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1912,9 +1912,7 @@ Tkinter_Flatten(PyObject* self, PyObject* args)
19121912
}
19131913

19141914
static PyObject *
1915-
Tkinter_Create(self, args)
1916-
PyObject *self;
1917-
PyObject *args;
1915+
Tkinter_Create(PyObject *self, PyObject *args)
19181916
{
19191917
char *screenName = NULL;
19201918
char *baseName = NULL;
@@ -1967,7 +1965,7 @@ MyFileProc(void *clientData, int mask)
19671965
static PyThreadState *event_tstate = NULL;
19681966

19691967
static int
1970-
EventHook()
1968+
EventHook(void)
19711969
{
19721970
#ifndef MS_WINDOWS
19731971
int tfile;
@@ -2026,7 +2024,7 @@ EventHook()
20262024
#endif
20272025

20282026
static void
2029-
EnableEventHook()
2027+
EnableEventHook(void)
20302028
{
20312029
#ifdef WAIT_FOR_STDIN
20322030
if (PyOS_InputHook == NULL) {
@@ -2039,7 +2037,7 @@ EnableEventHook()
20392037
}
20402038

20412039
static void
2042-
DisableEventHook()
2040+
DisableEventHook(void)
20432041
{
20442042
#ifdef WAIT_FOR_STDIN
20452043
if (Tk_GetNumMainWindows() == 0 && PyOS_InputHook == EventHook) {
@@ -2071,7 +2069,7 @@ ins_string(PyObject *d, char *name, char *val)
20712069

20722070

20732071
DL_EXPORT(void)
2074-
init_tkinter()
2072+
init_tkinter(void)
20752073
{
20762074
PyObject *m, *d;
20772075

@@ -2218,7 +2216,7 @@ init_tkinter_shlib(CFragInitBlockPtr data)
22182216
** the resources from the application. Again, we ignore errors.
22192217
*/
22202218
static
2221-
mac_addlibresources()
2219+
mac_addlibresources(void)
22222220
{
22232221
if ( !loaded_from_shlib )
22242222
return;

Modules/almodule.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2037,7 +2037,7 @@ static char al_module_documentation[] =
20372037
;
20382038

20392039
void
2040-
inital()
2040+
inital(void)
20412041
{
20422042
PyObject *m, *d, *x;
20432043

Modules/arraymodule.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1407,7 +1407,7 @@ statichere PyTypeObject Arraytype = {
14071407
};
14081408

14091409
DL_EXPORT(void)
1410-
initarray()
1410+
initarray(void)
14111411
{
14121412
PyObject *m, *d;
14131413

Modules/audioop.c

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -284,10 +284,7 @@ audioop_rms(PyObject *self, PyObject *args)
284284
return PyInt_FromLong(val);
285285
}
286286

287-
static double _sum2(a, b, len)
288-
short *a;
289-
short *b;
290-
int len;
287+
static double _sum2(short *a, short *b, int len)
291288
{
292289
int i;
293290
double sum = 0.0;
@@ -899,8 +896,7 @@ audioop_lin2lin(PyObject *self, PyObject *args)
899896
}
900897

901898
static int
902-
gcd(a, b)
903-
int a, b;
899+
gcd(int a, int b)
904900
{
905901
while (b > 0) {
906902
int tmp = a % b;
@@ -1344,7 +1340,7 @@ static PyMethodDef audioop_methods[] = {
13441340
};
13451341

13461342
DL_EXPORT(void)
1347-
initaudioop()
1343+
initaudioop(void)
13481344
{
13491345
PyObject *m, *d;
13501346
m = Py_InitModule("audioop", audioop_methods);

Modules/binascii.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -899,7 +899,7 @@ static struct PyMethodDef binascii_module_methods[] = {
899899
static char doc_binascii[] = "Conversion between binary data and ASCII";
900900

901901
DL_EXPORT(void)
902-
initbinascii()
902+
initbinascii(void)
903903
{
904904
PyObject *m, *d, *x;
905905

Modules/cdmodule.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -766,7 +766,7 @@ static PyMethodDef CD_methods[] = {
766766
};
767767

768768
void
769-
initcd()
769+
initcd(void)
770770
{
771771
PyObject *m, *d;
772772

0 commit comments

Comments
 (0)