Skip to content

Commit bd4bc4e

Browse files
committed
Even more ANSIfication: fix as many function pointers and declarations as
possible.
1 parent 3b6448f commit bd4bc4e

File tree

10 files changed

+18
-17
lines changed

10 files changed

+18
-17
lines changed

Modules/cryptmodule.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
static PyObject *crypt_crypt(PyObject *self, PyObject *args)
1313
{
1414
char *word, *salt;
15-
extern char * crypt();
15+
extern char * crypt(const char *, const char *);
1616

1717
if (!PyArg_Parse(args, "(ss)", &word, &salt)) {
1818
return NULL;

Modules/flmodule.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1672,7 +1672,7 @@ forms_set_event_call_back(PyObject *dummy, PyObject *args)
16721672
}
16731673

16741674
static PyObject *
1675-
forms_do_or_check_forms(PyObject *dummy, PyObject *args, FL_OBJECT *(*func)())
1675+
forms_do_or_check_forms(PyObject *dummy, PyObject *args, FL_OBJECT *(*func)(void))
16761676
{
16771677
FL_OBJECT *generic;
16781678
genericobject *g;
@@ -1751,7 +1751,7 @@ forms_check_only_forms(PyObject *dummy, PyObject *args)
17511751

17521752
#ifdef UNUSED
17531753
static PyObject *
1754-
fl_call(void (*func)(), PyObject *args)
1754+
fl_call(void (*func)(void), PyObject *args)
17551755
{
17561756
if (!PyArg_NoArgs(args))
17571757
return NULL;
@@ -2058,7 +2058,7 @@ forms_file_selector(PyObject *f, PyObject *args)
20582058

20592059

20602060
static PyObject *
2061-
forms_file_selector_func(PyObject *args, char *(*func)())
2061+
forms_file_selector_func(PyObject *args, char *(*func)(void))
20622062
{
20632063
char *str;
20642064

Modules/getpath.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ search_for_exec_prefix(char *argv0_path, char *home)
349349
static void
350350
calculate_path(void)
351351
{
352-
extern char *Py_GetProgramName();
352+
extern char *Py_GetProgramName(void);
353353

354354
static char delimiter[2] = {DELIM, '\0'};
355355
static char separator[2] = {SEP, '\0'};

Modules/nismodule.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
#ifdef __sgi
2222
/* This is missing from rpcsvc/ypclnt.h */
23-
extern int yp_get_default_domain();
23+
extern int yp_get_default_domain(char **);
2424
#endif
2525

2626
static PyObject *NisError;

Modules/parsermodule.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -963,7 +963,7 @@ validate_terminal(node *terminal, int type, char *string)
963963
/* X (',' X) [',']
964964
*/
965965
static int
966-
validate_repeating_list(node *tree, int ntype, int (*vfunc)(),
966+
validate_repeating_list(node *tree, int ntype, int (*vfunc)(node *),
967967
const char *const name)
968968
{
969969
int nch = NCH(tree);

Modules/posixmodule.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -130,11 +130,11 @@ corresponding Unix manual entries for more information on calls.";
130130

131131
#ifdef HAVE_UNISTD_H
132132
/* XXX These are for SunOS4.1.3 but shouldn't hurt elsewhere */
133-
extern int rename();
134-
extern int pclose();
135-
extern int lstat();
136-
extern int symlink();
137-
extern int fsync();
133+
extern int rename(const char *, const char *);
134+
extern int pclose(FILE *);
135+
extern int lstat(const char *, struct stat *);
136+
extern int symlink(const char *, const char *);
137+
extern int fsync(int fd);
138138
#else /* !HAVE_UNISTD_H */
139139
#if defined(PYCC_VACPP)
140140
extern int mkdir(char *);

Modules/python.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
#include "Python.h"
44

5-
extern DL_EXPORT(int) Py_Main();
5+
extern DL_EXPORT(int) Py_Main(int, char **);
66

77
int
88
main(int argc, char **argv)

Modules/selectmodule.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.
2727

2828
#ifdef __sgi
2929
/* This is missing from unistd.h */
30-
extern void bzero();
30+
extern void bzero(void *, int);
3131
#endif
3232

3333
#ifndef DONT_HAVE_SYS_TYPES_H

Modules/socketmodule.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ Socket methods:
111111
#endif
112112

113113
#if !defined(MS_WINDOWS) && !defined(PYOS_OS2) && !defined(__BEOS__)
114-
extern int gethostname(); /* For Solaris, at least */
114+
extern int gethostname(char *, size_t); /* For Solaris, at least */
115115
#endif
116116

117117
#if defined(PYCC_VACPP)

Modules/timemodule.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.
4949
#ifdef HAVE_FTIME
5050
#include <sys/timeb.h>
5151
#if !defined(MS_WINDOWS) && !defined(PYOS_OS2)
52-
extern int ftime();
52+
extern int ftime(struct timeb *);
5353
#endif /* MS_WINDOWS */
5454
#endif /* HAVE_FTIME */
5555

@@ -384,7 +384,8 @@ See the library reference manual for formatting codes.";
384384
#ifdef HAVE_STRPTIME
385385

386386
#if 0
387-
extern char *strptime(); /* Enable this if it's not declared in <time.h> */
387+
/* Enable this if it's not declared in <time.h> */
388+
extern char *strptime(const char *, const char *, struct tm *);
388389
#endif
389390

390391
static PyObject *

0 commit comments

Comments
 (0)