From bd4bc4e9e947617def66780efbbea4eb08990e56 Mon Sep 17 00:00:00 2001 From: Thomas Wouters Date: Sat, 22 Jul 2000 23:57:55 +0000 Subject: [PATCH] Even more ANSIfication: fix as many function pointers and declarations as possible. --- Modules/cryptmodule.c | 2 +- Modules/flmodule.c | 6 +++--- Modules/getpath.c | 2 +- Modules/nismodule.c | 2 +- Modules/parsermodule.c | 2 +- Modules/posixmodule.c | 10 +++++----- Modules/python.c | 2 +- Modules/selectmodule.c | 2 +- Modules/socketmodule.c | 2 +- Modules/timemodule.c | 5 +++-- 10 files changed, 18 insertions(+), 17 deletions(-) diff --git a/Modules/cryptmodule.c b/Modules/cryptmodule.c index 770965e5051..d3e07931920 100644 --- a/Modules/cryptmodule.c +++ b/Modules/cryptmodule.c @@ -12,7 +12,7 @@ static PyObject *crypt_crypt(PyObject *self, PyObject *args) { char *word, *salt; - extern char * crypt(); + extern char * crypt(const char *, const char *); if (!PyArg_Parse(args, "(ss)", &word, &salt)) { return NULL; diff --git a/Modules/flmodule.c b/Modules/flmodule.c index ffb4d4d5961..8bfd83aa091 100644 --- a/Modules/flmodule.c +++ b/Modules/flmodule.c @@ -1672,7 +1672,7 @@ forms_set_event_call_back(PyObject *dummy, PyObject *args) } static PyObject * -forms_do_or_check_forms(PyObject *dummy, PyObject *args, FL_OBJECT *(*func)()) +forms_do_or_check_forms(PyObject *dummy, PyObject *args, FL_OBJECT *(*func)(void)) { FL_OBJECT *generic; genericobject *g; @@ -1751,7 +1751,7 @@ forms_check_only_forms(PyObject *dummy, PyObject *args) #ifdef UNUSED static PyObject * -fl_call(void (*func)(), PyObject *args) +fl_call(void (*func)(void), PyObject *args) { if (!PyArg_NoArgs(args)) return NULL; @@ -2058,7 +2058,7 @@ forms_file_selector(PyObject *f, PyObject *args) static PyObject * -forms_file_selector_func(PyObject *args, char *(*func)()) +forms_file_selector_func(PyObject *args, char *(*func)(void)) { char *str; diff --git a/Modules/getpath.c b/Modules/getpath.c index 3c418d6c875..f96f7ed4836 100644 --- a/Modules/getpath.c +++ b/Modules/getpath.c @@ -349,7 +349,7 @@ search_for_exec_prefix(char *argv0_path, char *home) static void calculate_path(void) { - extern char *Py_GetProgramName(); + extern char *Py_GetProgramName(void); static char delimiter[2] = {DELIM, '\0'}; static char separator[2] = {SEP, '\0'}; diff --git a/Modules/nismodule.c b/Modules/nismodule.c index 3649fd529e1..36959cf0c13 100644 --- a/Modules/nismodule.c +++ b/Modules/nismodule.c @@ -20,7 +20,7 @@ #ifdef __sgi /* This is missing from rpcsvc/ypclnt.h */ -extern int yp_get_default_domain(); +extern int yp_get_default_domain(char **); #endif static PyObject *NisError; diff --git a/Modules/parsermodule.c b/Modules/parsermodule.c index b5414af8bed..91ffef11ee4 100644 --- a/Modules/parsermodule.c +++ b/Modules/parsermodule.c @@ -963,7 +963,7 @@ validate_terminal(node *terminal, int type, char *string) /* X (',' X) [','] */ static int -validate_repeating_list(node *tree, int ntype, int (*vfunc)(), +validate_repeating_list(node *tree, int ntype, int (*vfunc)(node *), const char *const name) { int nch = NCH(tree); diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c index c22be542d8c..fef4bbb2c34 100644 --- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c @@ -130,11 +130,11 @@ corresponding Unix manual entries for more information on calls."; #ifdef HAVE_UNISTD_H /* XXX These are for SunOS4.1.3 but shouldn't hurt elsewhere */ -extern int rename(); -extern int pclose(); -extern int lstat(); -extern int symlink(); -extern int fsync(); +extern int rename(const char *, const char *); +extern int pclose(FILE *); +extern int lstat(const char *, struct stat *); +extern int symlink(const char *, const char *); +extern int fsync(int fd); #else /* !HAVE_UNISTD_H */ #if defined(PYCC_VACPP) extern int mkdir(char *); diff --git a/Modules/python.c b/Modules/python.c index 7b456a9e728..316dd3b6636 100644 --- a/Modules/python.c +++ b/Modules/python.c @@ -2,7 +2,7 @@ #include "Python.h" -extern DL_EXPORT(int) Py_Main(); +extern DL_EXPORT(int) Py_Main(int, char **); int main(int argc, char **argv) diff --git a/Modules/selectmodule.c b/Modules/selectmodule.c index 1adde193668..2860f375884 100644 --- a/Modules/selectmodule.c +++ b/Modules/selectmodule.c @@ -27,7 +27,7 @@ redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. #ifdef __sgi /* This is missing from unistd.h */ -extern void bzero(); +extern void bzero(void *, int); #endif #ifndef DONT_HAVE_SYS_TYPES_H diff --git a/Modules/socketmodule.c b/Modules/socketmodule.c index 50cd3eb1095..5d6f24a2efc 100644 --- a/Modules/socketmodule.c +++ b/Modules/socketmodule.c @@ -111,7 +111,7 @@ Socket methods: #endif #if !defined(MS_WINDOWS) && !defined(PYOS_OS2) && !defined(__BEOS__) -extern int gethostname(); /* For Solaris, at least */ +extern int gethostname(char *, size_t); /* For Solaris, at least */ #endif #if defined(PYCC_VACPP) diff --git a/Modules/timemodule.c b/Modules/timemodule.c index b9aba51835f..005189a507d 100644 --- a/Modules/timemodule.c +++ b/Modules/timemodule.c @@ -49,7 +49,7 @@ redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. #ifdef HAVE_FTIME #include #if !defined(MS_WINDOWS) && !defined(PYOS_OS2) -extern int ftime(); +extern int ftime(struct timeb *); #endif /* MS_WINDOWS */ #endif /* HAVE_FTIME */ @@ -384,7 +384,8 @@ See the library reference manual for formatting codes."; #ifdef HAVE_STRPTIME #if 0 -extern char *strptime(); /* Enable this if it's not declared in */ +/* Enable this if it's not declared in */ +extern char *strptime(const char *, const char *, struct tm *); #endif static PyObject *