Commit 709fe068 authored by Thomas Wouters's avatar Thomas Wouters

Mass ANSIfication of function definitions. Doesn't cover all 'extern'

declarations yet, those come later.
parent 7595e273
...@@ -17,8 +17,7 @@ redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. ...@@ -17,8 +17,7 @@ redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#include <ctype.h> #include <ctype.h>
double atof(s) double atof(char *s)
char *s;
{ {
double a = 0.0; double a = 0.0;
int e = 0; int e = 0;
......
This diff is collapsed.
This diff is collapsed.
...@@ -36,7 +36,7 @@ static int import_encodings_called = 0; ...@@ -36,7 +36,7 @@ static int import_encodings_called = 0;
*/ */
static static
int import_encodings() int import_encodings(void)
{ {
PyObject *mod; PyObject *mod;
...@@ -419,7 +419,7 @@ PyObject *PyCodec_Decode(PyObject *object, ...@@ -419,7 +419,7 @@ PyObject *PyCodec_Decode(PyObject *object,
return NULL; return NULL;
} }
void _PyCodecRegistry_Init() void _PyCodecRegistry_Init(void)
{ {
if (_PyCodec_SearchPath == NULL) if (_PyCodec_SearchPath == NULL)
_PyCodec_SearchPath = PyList_New(0); _PyCodec_SearchPath = PyList_New(0);
...@@ -430,7 +430,7 @@ void _PyCodecRegistry_Init() ...@@ -430,7 +430,7 @@ void _PyCodecRegistry_Init()
Py_FatalError("can't initialize codec registry"); Py_FatalError("can't initialize codec registry");
} }
void _PyCodecRegistry_Fini() void _PyCodecRegistry_Fini(void)
{ {
Py_XDECREF(_PyCodec_SearchPath); Py_XDECREF(_PyCodec_SearchPath);
_PyCodec_SearchPath = NULL; _PyCodec_SearchPath = NULL;
......
This diff is collapsed.
...@@ -16,8 +16,7 @@ ...@@ -16,8 +16,7 @@
#define BADEXIT -1 #define BADEXIT -1
int int
dup2(fd1, fd2) dup2(int fd1, int fd2)
int fd1, fd2;
{ {
if (fd1 != fd2) { if (fd1 != fd2) {
if (fcntl(fd1, F_GETFL) < 0) if (fcntl(fd1, F_GETFL) < 0)
......
...@@ -42,8 +42,7 @@ const struct filedescr _PyImport_DynLoadFiletab[] = { ...@@ -42,8 +42,7 @@ const struct filedescr _PyImport_DynLoadFiletab[] = {
}; };
static int static int
aix_getoldmodules(modlistptr) aix_getoldmodules(void **modlistptr)
void **modlistptr;
{ {
register ModulePtr modptr, prevmodptr; register ModulePtr modptr, prevmodptr;
register struct ld_info *ldiptr; register struct ld_info *ldiptr;
...@@ -115,9 +114,7 @@ aix_getoldmodules(modlistptr) ...@@ -115,9 +114,7 @@ aix_getoldmodules(modlistptr)
} }
static int static int
aix_bindnewmodule(newmoduleptr, modlistptr) aix_bindnewmodule(void *newmoduleptr, void *modlistptr)
void *newmoduleptr;
void *modlistptr;
{ {
register ModulePtr modptr; register ModulePtr modptr;
...@@ -131,8 +128,7 @@ aix_bindnewmodule(newmoduleptr, modlistptr) ...@@ -131,8 +128,7 @@ aix_bindnewmodule(newmoduleptr, modlistptr)
} }
static void static void
aix_loaderror(pathname) aix_loaderror(char *pathname)
char *pathname;
{ {
char *message[1024], errbuf[1024]; char *message[1024], errbuf[1024];
......
...@@ -30,10 +30,7 @@ extern char *strerror(int); ...@@ -30,10 +30,7 @@ extern char *strerror(int);
#endif #endif
void void
PyErr_Restore(type, value, traceback) PyErr_Restore(PyObject *type, PyObject *value, PyObject *traceback)
PyObject *type;
PyObject *value;
PyObject *traceback;
{ {
PyThreadState *tstate = PyThreadState_GET(); PyThreadState *tstate = PyThreadState_GET();
PyObject *oldtype, *oldvalue, *oldtraceback; PyObject *oldtype, *oldvalue, *oldtraceback;
...@@ -60,9 +57,7 @@ PyErr_Restore(type, value, traceback) ...@@ -60,9 +57,7 @@ PyErr_Restore(type, value, traceback)
} }
void void
PyErr_SetObject(exception, value) PyErr_SetObject(PyObject *exception, PyObject *value)
PyObject *exception;
PyObject *value;
{ {
Py_XINCREF(exception); Py_XINCREF(exception);
Py_XINCREF(value); Py_XINCREF(value);
...@@ -70,16 +65,13 @@ PyErr_SetObject(exception, value) ...@@ -70,16 +65,13 @@ PyErr_SetObject(exception, value)
} }
void void
PyErr_SetNone(exception) PyErr_SetNone(PyObject *exception)
PyObject *exception;
{ {
PyErr_SetObject(exception, (PyObject *)NULL); PyErr_SetObject(exception, (PyObject *)NULL);
} }
void void
PyErr_SetString(exception, string) PyErr_SetString(PyObject *exception, const char *string)
PyObject *exception;
const char *string;
{ {
PyObject *value = PyString_FromString(string); PyObject *value = PyString_FromString(string);
PyErr_SetObject(exception, value); PyErr_SetObject(exception, value);
...@@ -88,7 +80,7 @@ PyErr_SetString(exception, string) ...@@ -88,7 +80,7 @@ PyErr_SetString(exception, string)
PyObject * PyObject *
PyErr_Occurred() PyErr_Occurred(void)
{ {
PyThreadState *tstate = PyThreadState_Get(); PyThreadState *tstate = PyThreadState_Get();
...@@ -97,8 +89,7 @@ PyErr_Occurred() ...@@ -97,8 +89,7 @@ PyErr_Occurred()
int int
PyErr_GivenExceptionMatches(err, exc) PyErr_GivenExceptionMatches(PyObject *err, PyObject *exc)
PyObject *err, *exc;
{ {
if (err == NULL || exc == NULL) { if (err == NULL || exc == NULL) {
/* maybe caused by "import exceptions" that failed early on */ /* maybe caused by "import exceptions" that failed early on */
...@@ -129,8 +120,7 @@ PyErr_GivenExceptionMatches(err, exc) ...@@ -129,8 +120,7 @@ PyErr_GivenExceptionMatches(err, exc)
int int
PyErr_ExceptionMatches(exc) PyErr_ExceptionMatches(PyObject *exc)
PyObject *exc;
{ {
return PyErr_GivenExceptionMatches(PyErr_Occurred(), exc); return PyErr_GivenExceptionMatches(PyErr_Occurred(), exc);
} }
...@@ -140,10 +130,7 @@ PyErr_ExceptionMatches(exc) ...@@ -140,10 +130,7 @@ PyErr_ExceptionMatches(exc)
eval_code2(), do_raise(), and PyErr_Print() eval_code2(), do_raise(), and PyErr_Print()
*/ */
void void
PyErr_NormalizeException(exc, val, tb) PyErr_NormalizeException(PyObject **exc, PyObject **val, PyObject **tb)
PyObject **exc;
PyObject **val;
PyObject **tb;
{ {
PyObject *type = *exc; PyObject *type = *exc;
PyObject *value = *val; PyObject *value = *val;
...@@ -213,10 +200,7 @@ finally: ...@@ -213,10 +200,7 @@ finally:
void void
PyErr_Fetch(p_type, p_value, p_traceback) PyErr_Fetch(PyObject **p_type, PyObject **p_value, PyObject **p_traceback)
PyObject **p_type;
PyObject **p_value;
PyObject **p_traceback;
{ {
PyThreadState *tstate = PyThreadState_Get(); PyThreadState *tstate = PyThreadState_Get();
...@@ -230,7 +214,7 @@ PyErr_Fetch(p_type, p_value, p_traceback) ...@@ -230,7 +214,7 @@ PyErr_Fetch(p_type, p_value, p_traceback)
} }
void void
PyErr_Clear() PyErr_Clear(void)
{ {
PyErr_Restore(NULL, NULL, NULL); PyErr_Restore(NULL, NULL, NULL);
} }
...@@ -238,7 +222,7 @@ PyErr_Clear() ...@@ -238,7 +222,7 @@ PyErr_Clear()
/* Convenience functions to set a type error exception and return 0 */ /* Convenience functions to set a type error exception and return 0 */
int int
PyErr_BadArgument() PyErr_BadArgument(void)
{ {
PyErr_SetString(PyExc_TypeError, PyErr_SetString(PyExc_TypeError,
"illegal argument type for built-in operation"); "illegal argument type for built-in operation");
...@@ -246,7 +230,7 @@ PyErr_BadArgument() ...@@ -246,7 +230,7 @@ PyErr_BadArgument()
} }
PyObject * PyObject *
PyErr_NoMemory() PyErr_NoMemory(void)
{ {
/* raise the pre-allocated instance if it still exists */ /* raise the pre-allocated instance if it still exists */
if (PyExc_MemoryErrorInst) if (PyExc_MemoryErrorInst)
...@@ -261,9 +245,7 @@ PyErr_NoMemory() ...@@ -261,9 +245,7 @@ PyErr_NoMemory()
} }
PyObject * PyObject *
PyErr_SetFromErrnoWithFilename(exc, filename) PyErr_SetFromErrnoWithFilename(PyObject *exc, char *filename)
PyObject *exc;
char *filename;
{ {
PyObject *v; PyObject *v;
char *s; char *s;
...@@ -326,8 +308,7 @@ PyErr_SetFromErrnoWithFilename(exc, filename) ...@@ -326,8 +308,7 @@ PyErr_SetFromErrnoWithFilename(exc, filename)
PyObject * PyObject *
PyErr_SetFromErrno(exc) PyErr_SetFromErrno(PyObject *exc)
PyObject *exc;
{ {
return PyErr_SetFromErrnoWithFilename(exc, NULL); return PyErr_SetFromErrnoWithFilename(exc, NULL);
} }
...@@ -335,7 +316,7 @@ PyErr_SetFromErrno(exc) ...@@ -335,7 +316,7 @@ PyErr_SetFromErrno(exc)
#ifdef MS_WINDOWS #ifdef MS_WINDOWS
/* Windows specific error code handling */ /* Windows specific error code handling */
PyObject *PyErr_SetFromWindowsErrWithFilename( PyObject *PyErr_SetFromWindowsErrWithFilename(
int ierr, int ierr,
const char *filename) const char *filename)
{ {
int len; int len;
...@@ -378,32 +359,20 @@ PyObject *PyErr_SetFromWindowsErr(int ierr) ...@@ -378,32 +359,20 @@ PyObject *PyErr_SetFromWindowsErr(int ierr)
#endif /* MS_WINDOWS */ #endif /* MS_WINDOWS */
void void
PyErr_BadInternalCall() PyErr_BadInternalCall(void)
{ {
PyErr_SetString(PyExc_SystemError, PyErr_SetString(PyExc_SystemError,
"bad argument to internal function"); "bad argument to internal function");
} }
#ifdef HAVE_STDARG_PROTOTYPES
PyObject * PyObject *
PyErr_Format(PyObject *exception, const char *format, ...) PyErr_Format(PyObject *exception, const char *format, ...)
#else
PyObject *
PyErr_Format(exception, format, va_alist)
PyObject *exception;
const char *format;
va_dcl
#endif
{ {
va_list vargs; va_list vargs;
char buffer[500]; /* Caller is responsible for limiting the format */ char buffer[500]; /* Caller is responsible for limiting the format */
#ifdef HAVE_STDARG_PROTOTYPES
va_start(vargs, format); va_start(vargs, format);
#else
va_start(vargs);
#endif
vsprintf(buffer, format, vargs); vsprintf(buffer, format, vargs);
PyErr_SetString(exception, buffer); PyErr_SetString(exception, buffer);
...@@ -412,10 +381,7 @@ PyErr_Format(exception, format, va_alist) ...@@ -412,10 +381,7 @@ PyErr_Format(exception, format, va_alist)
PyObject * PyObject *
PyErr_NewException(name, base, dict) PyErr_NewException(char *name, PyObject *base, PyObject *dict)
char *name; /* modulename.classname */
PyObject *base;
PyObject *dict;
{ {
char *dot; char *dot;
PyObject *modulename = NULL; PyObject *modulename = NULL;
......
...@@ -30,9 +30,7 @@ extern int PyInitFrozenExtensions(); ...@@ -30,9 +30,7 @@ extern int PyInitFrozenExtensions();
/* Main program */ /* Main program */
int int
Py_FrozenMain(argc, argv) Py_FrozenMain(int argc, char **argv)
int argc;
char **argv;
{ {
char *p; char *p;
int n, sts; int n, sts;
......
...@@ -43,54 +43,24 @@ static int vgetargskeywords(PyObject *, PyObject *, ...@@ -43,54 +43,24 @@ static int vgetargskeywords(PyObject *, PyObject *,
char *, char **, va_list *); char *, char **, va_list *);
static char *skipitem(char **, va_list *); static char *skipitem(char **, va_list *);
#ifdef HAVE_STDARG_PROTOTYPES
/* VARARGS2 */
int PyArg_Parse(PyObject *args, char *format, ...) int PyArg_Parse(PyObject *args, char *format, ...)
#else
/* VARARGS */
int PyArg_Parse(va_alist) va_dcl
#endif
{ {
int retval; int retval;
va_list va; va_list va;
#ifdef HAVE_STDARG_PROTOTYPES
va_start(va, format); va_start(va, format);
#else
PyObject *args;
char *format;
va_start(va);
args = va_arg(va, PyObject *);
format = va_arg(va, char *);
#endif
retval = vgetargs1(args, format, &va, 1); retval = vgetargs1(args, format, &va, 1);
va_end(va); va_end(va);
return retval; return retval;
} }
#ifdef HAVE_STDARG_PROTOTYPES
/* VARARGS2 */
int PyArg_ParseTuple(PyObject *args, char *format, ...) int PyArg_ParseTuple(PyObject *args, char *format, ...)
#else
/* VARARGS */
int PyArg_ParseTuple(va_alist) va_dcl
#endif
{ {
int retval; int retval;
va_list va; va_list va;
#ifdef HAVE_STDARG_PROTOTYPES
va_start(va, format); va_start(va, format);
#else
PyObject *args;
char *format;
va_start(va);
args = va_arg(va, PyObject *);
format = va_arg(va, char *);
#endif
retval = vgetargs1(args, format, &va, 0); retval = vgetargs1(args, format, &va, 0);
va_end(va); va_end(va);
return retval; return retval;
...@@ -98,10 +68,7 @@ int PyArg_ParseTuple(va_alist) va_dcl ...@@ -98,10 +68,7 @@ int PyArg_ParseTuple(va_alist) va_dcl
int int
PyArg_VaParse(args, format, va) PyArg_VaParse(PyObject *args, char *format, va_list va)
PyObject *args;
char *format;
va_list va;
{ {
va_list lva; va_list lva;
...@@ -116,11 +83,7 @@ PyArg_VaParse(args, format, va) ...@@ -116,11 +83,7 @@ PyArg_VaParse(args, format, va)
static int static int
vgetargs1(args, format, p_va, compat) vgetargs1(PyObject *args, char *format, va_list *p_va, int compat)
PyObject *args;
char *format;
va_list *p_va;
int compat;
{ {
char msgbuf[256]; char msgbuf[256];
int levels[32]; int levels[32];
...@@ -254,12 +217,7 @@ vgetargs1(args, format, p_va, compat) ...@@ -254,12 +217,7 @@ vgetargs1(args, format, p_va, compat)
static void static void
seterror(iarg, msg, levels, fname, message) seterror(int iarg, char *msg, int *levels, char *fname, char *message)
int iarg;
char *msg;
int *levels;
char *fname;
char *message;
{ {
char buf[256]; char buf[256];
int i; int i;
...@@ -309,13 +267,8 @@ seterror(iarg, msg, levels, fname, message) ...@@ -309,13 +267,8 @@ seterror(iarg, msg, levels, fname, message)
*/ */
static char * static char *
converttuple(arg, p_format, p_va, levels, msgbuf, toplevel) converttuple(PyObject *arg, char **p_format, va_list *p_va, int *levels,
PyObject *arg; char *msgbuf, int toplevel)
char **p_format;
va_list *p_va;
int *levels;
char *msgbuf;
int toplevel;
{ {
int level = 0; int level = 0;
int n = 0; int n = 0;
...@@ -378,12 +331,8 @@ converttuple(arg, p_format, p_va, levels, msgbuf, toplevel) ...@@ -378,12 +331,8 @@ converttuple(arg, p_format, p_va, levels, msgbuf, toplevel)
/* Convert a single item. */ /* Convert a single item. */
static char * static char *
convertitem(arg, p_format, p_va, levels, msgbuf) convertitem(PyObject *arg, char **p_format, va_list *p_va, int *levels,
PyObject *arg; char *msgbuf)
char **p_format;
va_list *p_va;
int *levels;
char *msgbuf;
{ {
char *msg; char *msg;
char *format = *p_format; char *format = *p_format;
...@@ -409,11 +358,7 @@ convertitem(arg, p_format, p_va, levels, msgbuf) ...@@ -409,11 +358,7 @@ convertitem(arg, p_format, p_va, levels, msgbuf)
by appending ", <actual argument type>" to error message. */ by appending ", <actual argument type>" to error message. */
static char * static char *
convertsimple(arg, p_format, p_va, msgbuf) convertsimple(PyObject *arg, char **p_format, va_list *p_va, char *msgbuf)
PyObject *arg;
char **p_format;
va_list *p_va;
char *msgbuf;
{ {
char *msg = convertsimple1(arg, p_format, p_va); char *msg = convertsimple1(arg, p_format, p_va);
if (msg != NULL) { if (msg != NULL) {
...@@ -436,10 +381,7 @@ PyObject *_PyUnicode_AsUTF8String(PyObject *unicode, ...@@ -436,10 +381,7 @@ PyObject *_PyUnicode_AsUTF8String(PyObject *unicode,
Don't call if a tuple is expected. */ Don't call if a tuple is expected. */
static char * static char *
convertsimple1(arg, p_format, p_va) convertsimple1(PyObject *arg, char **p_format, va_list *p_va)
PyObject *arg;
char **p_format;
va_list *p_va;
{ {
char *format = *p_format; char *format = *p_format;
char c = *format++; char c = *format++;
...@@ -961,34 +903,15 @@ convertsimple1(arg, p_format, p_va) ...@@ -961,34 +903,15 @@ convertsimple1(arg, p_format, p_va)
/* Support for keyword arguments donated by /* Support for keyword arguments donated by
Geoff Philbrick <philbric@delphi.hks.com> */ Geoff Philbrick <philbric@delphi.hks.com> */
#ifdef HAVE_STDARG_PROTOTYPES
/* VARARGS2 */
int PyArg_ParseTupleAndKeywords(PyObject *args, int PyArg_ParseTupleAndKeywords(PyObject *args,
PyObject *keywords, PyObject *keywords,
char *format, char *format,
char **kwlist, ...) char **kwlist, ...)
#else
/* VARARGS */
int PyArg_ParseTupleAndKeywords(va_alist) va_dcl
#endif
{ {
int retval; int retval;
va_list va; va_list va;
#ifdef HAVE_STDARG_PROTOTYPES
va_start(va, kwlist); va_start(va, kwlist);
#else
PyObject *args;
PyObject *keywords;
char *format;
char **kwlist;
va_start(va);
args = va_arg(va, PyObject *);
keywords = va_arg(va, PyObject *);
format = va_arg(va, char *);
kwlist = va_arg(va, char **);
#endif
retval = vgetargskeywords(args, keywords, format, kwlist, &va); retval = vgetargskeywords(args, keywords, format, kwlist, &va);
va_end(va); va_end(va);
return retval; return retval;
...@@ -996,12 +919,8 @@ int PyArg_ParseTupleAndKeywords(va_alist) va_dcl ...@@ -996,12 +919,8 @@ int PyArg_ParseTupleAndKeywords(va_alist) va_dcl
static int static int
vgetargskeywords(args, keywords, format, kwlist, p_va) vgetargskeywords(PyObject *args, PyObject *keywords, char *format,
PyObject *args; char **kwlist, va_list *p_va)
PyObject *keywords;
char *format;
char **kwlist;
va_list *p_va;
{ {
char msgbuf[256]; char msgbuf[256];
int levels[32]; int levels[32];
...@@ -1204,9 +1123,7 @@ vgetargskeywords(args, keywords, format, kwlist, p_va) ...@@ -1204,9 +1123,7 @@ vgetargskeywords(args, keywords, format, kwlist, p_va)
static char * static char *
skipitem(p_format, p_va) skipitem(char **p_format, va_list *p_va)
char **p_format;
va_list *p_va;
{ {
char *format = *p_format; char *format = *p_format;
char c = *format++; char c = *format++;
......
...@@ -31,7 +31,7 @@ redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. ...@@ -31,7 +31,7 @@ redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#endif /* !COMPILER */ #endif /* !COMPILER */
const char * const char *
Py_GetCompiler() Py_GetCompiler(void)
{ {
return COMPILER; return COMPILER;
} }
...@@ -23,7 +23,7 @@ static char cprt[] = ...@@ -23,7 +23,7 @@ static char cprt[] =
Copyright 1995-2000 Corporation for National Research Initiatives (CNRI)"; Copyright 1995-2000 Corporation for National Research Initiatives (CNRI)";
const char * const char *
Py_GetCopyright() Py_GetCopyright(void)
{ {
return cprt; return cprt;
} }
...@@ -26,12 +26,10 @@ redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. ...@@ -26,12 +26,10 @@ redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#define MAXPATHLEN 1024 #define MAXPATHLEN 1024
#endif #endif
extern char *getwd(); extern char *getwd(char *);
char * char *
getcwd(buf, size) getcwd(char *buf, int size)
char *buf;
int size;
{ {
char localbuf[MAXPATHLEN+1]; char localbuf[MAXPATHLEN+1];
char *ret; char *ret;
...@@ -62,9 +60,7 @@ getcwd(buf, size) ...@@ -62,9 +60,7 @@ getcwd(buf, size)
#endif #endif
char * char *
getcwd(buf, size) getcwd(char *buf, int size)
char *buf;
int size;
{ {
FILE *fp; FILE *fp;
char *p; char *p;
......
...@@ -26,9 +26,7 @@ redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. ...@@ -26,9 +26,7 @@ redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#endif #endif
time_t time_t
PyOS_GetLastModificationTime(path, fp) PyOS_GetLastModificationTime(char *path, FILE *fp)
char *path;
FILE *fp;
{ {
struct stat st; struct stat st;
if (fstat(fileno(fp), &st) != 0) if (fstat(fileno(fp), &st) != 0)
......
...@@ -41,12 +41,9 @@ char * optarg = NULL; /* optional argument */ ...@@ -41,12 +41,9 @@ char * optarg = NULL; /* optional argument */
#ifndef __BEOS__ #ifndef __BEOS__
int getopt(argc,argv,optstring) int getopt(int argc, char *argv[], char optstring[])
int argc;
char *argv[];
char optstring[];
#else #else
int getopt( int argc, char *const *argv, const char *optstring ) int getopt(int argc, char *const *argv, const char *optstring)
#endif #endif
{ {
static char *opt_ptr = ""; static char *opt_ptr = "";
......
...@@ -15,7 +15,7 @@ redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. ...@@ -15,7 +15,7 @@ redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#endif #endif
const char * const char *
Py_GetPlatform() Py_GetPlatform(void)
{ {
return PLATFORM; return PLATFORM;
} }
...@@ -15,7 +15,7 @@ redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. ...@@ -15,7 +15,7 @@ redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#include "patchlevel.h" #include "patchlevel.h"
const char * const char *
Py_GetVersion() Py_GetVersion(void)
{ {
static char version[250]; static char version[250];
sprintf(version, "%.80s (%.80s) %.80s", PY_VERSION, sprintf(version, "%.80s (%.80s) %.80s", PY_VERSION,
......
...@@ -4,9 +4,7 @@ ...@@ -4,9 +4,7 @@
#include "myproto.h" #include "myproto.h"
#include "mymath.h" #include "mymath.h"
double hypot(x, y) double hypot(double x, double y)
double x;
double y;
{ {
double yx; double yx;
......
This diff is collapsed.
...@@ -28,10 +28,7 @@ extern dl_funcptr _PyImport_GetDynLoadFunc(const char *name, ...@@ -28,10 +28,7 @@ extern dl_funcptr _PyImport_GetDynLoadFunc(const char *name,
PyObject * PyObject *
_PyImport_LoadDynamicModule(name, pathname, fp) _PyImport_LoadDynamicModule(char *name, char *pathname, FILE *fp)
char *name;
char *pathname;
FILE *fp;
{ {
PyObject *m, *d, *s; PyObject *m, *d, *s;
char *lastdot, *shortname, *packagecontext; char *lastdot, *shortname, *packagecontext;
......
...@@ -55,9 +55,7 @@ typedef struct { ...@@ -55,9 +55,7 @@ typedef struct {
else w_more(c, p) else w_more(c, p)
static void static void
w_more(c, p) w_more(char c, WFILE *p)
char c;
WFILE *p;
{ {
int size, newsize; int size, newsize;
if (p->str == NULL) if (p->str == NULL)
...@@ -76,10 +74,7 @@ w_more(c, p) ...@@ -76,10 +74,7 @@ w_more(c, p)
} }
static void static void
w_string(s, n, p) w_string(char *s, int n, WFILE *p)
char *s;
int n;
WFILE *p;
{ {
if (p->fp != NULL) { if (p->fp != NULL) {
fwrite(s, 1, n, p->fp); fwrite(s, 1, n, p->fp);
...@@ -93,18 +88,14 @@ w_string(s, n, p) ...@@ -93,18 +88,14 @@ w_string(s, n, p)
} }
static void static void
w_short(x, p) w_short(int x, WFILE *p)
int x;
WFILE *p;
{ {
w_byte( x & 0xff, p); w_byte( x & 0xff, p);
w_byte((x>> 8) & 0xff, p); w_byte((x>> 8) & 0xff, p);
} }
static void static void
w_long(x, p) w_long(long x, WFILE *p)
long x;
WFILE *p;
{ {
w_byte((int)( x & 0xff), p); w_byte((int)( x & 0xff), p);
w_byte((int)((x>> 8) & 0xff), p); w_byte((int)((x>> 8) & 0xff), p);
...@@ -114,9 +105,7 @@ w_long(x, p) ...@@ -114,9 +105,7 @@ w_long(x, p)
#if SIZEOF_LONG > 4 #if SIZEOF_LONG > 4
static void static void
w_long64(x, p) w_long64(long x, WFILE *p)
long x;
WFILE *p;
{ {
w_long(x, p); w_long(x, p);
w_long(x>>32, p); w_long(x>>32, p);
...@@ -124,9 +113,7 @@ w_long64(x, p) ...@@ -124,9 +113,7 @@ w_long64(x, p)
#endif #endif
static void static void
w_object(v, p) w_object(PyObject *v, WFILE *p)
PyObject *v;
WFILE *p;
{ {
int i, n; int i, n;
PyBufferProcs *pb; PyBufferProcs *pb;
...@@ -286,9 +273,7 @@ w_object(v, p) ...@@ -286,9 +273,7 @@ w_object(v, p)
} }
void void
PyMarshal_WriteLongToFile(x, fp) PyMarshal_WriteLongToFile(long x, FILE *fp)
long x;
FILE *fp;
{ {
WFILE wf; WFILE wf;
wf.fp = fp; wf.fp = fp;
...@@ -298,9 +283,7 @@ PyMarshal_WriteLongToFile(x, fp) ...@@ -298,9 +283,7 @@ PyMarshal_WriteLongToFile(x, fp)
} }
void void
PyMarshal_WriteObjectToFile(x, fp) PyMarshal_WriteObjectToFile(PyObject *x, FILE *fp)
PyObject *x;
FILE *fp;
{ {
WFILE wf; WFILE wf;
wf.fp = fp; wf.fp = fp;
...@@ -316,10 +299,7 @@ typedef WFILE RFILE; /* Same struct with different invariants */ ...@@ -316,10 +299,7 @@ typedef WFILE RFILE; /* Same struct with different invariants */
#define r_byte(p) ((p)->fp ? getc((p)->fp) : rs_byte(p)) #define r_byte(p) ((p)->fp ? getc((p)->fp) : rs_byte(p))
static int static int
r_string(s, n, p) r_string(char *s, int n, RFILE *p)
char *s;
int n;
RFILE *p;
{ {
if (p->fp != NULL) if (p->fp != NULL)
return fread(s, 1, n, p->fp); return fread(s, 1, n, p->fp);
...@@ -331,8 +311,7 @@ r_string(s, n, p) ...@@ -331,8 +311,7 @@ r_string(s, n, p)
} }
static int static int
r_short(p) r_short(RFILE *p)
RFILE *p;
{ {
register short x; register short x;
x = r_byte(p); x = r_byte(p);
...@@ -342,8 +321,7 @@ r_short(p) ...@@ -342,8 +321,7 @@ r_short(p)
} }
static long static long
r_long(p) r_long(RFILE *p)
RFILE *p;
{ {
register long x; register long x;
register FILE *fp = p->fp; register FILE *fp = p->fp;
...@@ -368,8 +346,7 @@ r_long(p) ...@@ -368,8 +346,7 @@ r_long(p)
} }
static long static long
r_long64(p) r_long64(RFILE *p)
RFILE *p;
{ {
register long x; register long x;
x = r_long(p); x = r_long(p);
...@@ -388,8 +365,7 @@ r_long64(p) ...@@ -388,8 +365,7 @@ r_long64(p)
} }
static PyObject * static PyObject *
r_object(p) r_object(RFILE *p)
RFILE *p;
{ {
PyObject *v, *v2; PyObject *v, *v2;
long i, n; long i, n;
...@@ -634,8 +610,7 @@ r_object(p) ...@@ -634,8 +610,7 @@ r_object(p)
} }
long long
PyMarshal_ReadLongFromFile(fp) PyMarshal_ReadLongFromFile(FILE *fp)
FILE *fp;
{ {
RFILE rf; RFILE rf;
rf.fp = fp; rf.fp = fp;
...@@ -643,8 +618,7 @@ PyMarshal_ReadLongFromFile(fp) ...@@ -643,8 +618,7 @@ PyMarshal_ReadLongFromFile(fp)
} }
PyObject * PyObject *
PyMarshal_ReadObjectFromFile(fp) PyMarshal_ReadObjectFromFile(FILE *fp)
FILE *fp;
{ {
RFILE rf; RFILE rf;
if (PyErr_Occurred()) { if (PyErr_Occurred()) {
...@@ -656,9 +630,7 @@ PyMarshal_ReadObjectFromFile(fp) ...@@ -656,9 +630,7 @@ PyMarshal_ReadObjectFromFile(fp)
} }
PyObject * PyObject *
PyMarshal_ReadObjectFromString(str, len) PyMarshal_ReadObjectFromString(char *str, int len)
char *str;
int len;
{ {
RFILE rf; RFILE rf;
if (PyErr_Occurred()) { if (PyErr_Occurred()) {
...@@ -673,8 +645,7 @@ PyMarshal_ReadObjectFromString(str, len) ...@@ -673,8 +645,7 @@ PyMarshal_ReadObjectFromString(str, len)
} }
PyObject * PyObject *
PyMarshal_WriteObjectToString(x) /* wrs_object() */ PyMarshal_WriteObjectToString(PyObject *x) /* wrs_object() */
PyObject *x;
{ {
WFILE wf; WFILE wf;
wf.fp = NULL; wf.fp = NULL;
...@@ -703,9 +674,7 @@ PyMarshal_WriteObjectToString(x) /* wrs_object() */ ...@@ -703,9 +674,7 @@ PyMarshal_WriteObjectToString(x) /* wrs_object() */
/* And an interface for Python programs... */ /* And an interface for Python programs... */
static PyObject * static PyObject *
marshal_dump(self, args) marshal_dump(PyObject *self, PyObject *args)
PyObject *self;
PyObject *args;
{ {
WFILE wf; WFILE wf;
PyObject *x; PyObject *x;
...@@ -734,9 +703,7 @@ marshal_dump(self, args) ...@@ -734,9 +703,7 @@ marshal_dump(self, args)
} }
static PyObject * static PyObject *
marshal_load(self, args) marshal_load(PyObject *self, PyObject *args)
PyObject *self;
PyObject *args;
{ {
RFILE rf; RFILE rf;
PyObject *f; PyObject *f;
...@@ -761,9 +728,7 @@ marshal_load(self, args) ...@@ -761,9 +728,7 @@ marshal_load(self, args)
} }
static PyObject * static PyObject *
marshal_dumps(self, args) marshal_dumps(PyObject *self, PyObject *args)
PyObject *self;
PyObject *args;
{ {
PyObject *x; PyObject *x;
if (!PyArg_ParseTuple(args, "O:dumps", &x)) if (!PyArg_ParseTuple(args, "O:dumps", &x))
...@@ -772,9 +737,7 @@ marshal_dumps(self, args) ...@@ -772,9 +737,7 @@ marshal_dumps(self, args)
} }
static PyObject * static PyObject *
marshal_loads(self, args) marshal_loads(PyObject *self, PyObject *args)
PyObject *self;
PyObject *args;
{ {
RFILE rf; RFILE rf;
PyObject *v; PyObject *v;
...@@ -804,7 +767,7 @@ static PyMethodDef marshal_methods[] = { ...@@ -804,7 +767,7 @@ static PyMethodDef marshal_methods[] = {
}; };
void void
PyMarshal_Init() PyMarshal_Init(void)
{ {
(void) Py_InitModule("marshal", marshal_methods); (void) Py_InitModule("marshal", marshal_methods);
} }
...@@ -10,13 +10,10 @@ redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. ...@@ -10,13 +10,10 @@ redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.
/* A perhaps slow but I hope correct implementation of memmove */ /* A perhaps slow but I hope correct implementation of memmove */
extern char *memcpy(); extern char *memcpy(char *, char *, int);
char * char *
memmove(dst, src, n) memmove(char *dst, char *src, int n)
char *dst;
char *src;
int n;
{ {
char *realdst = dst; char *realdst = dst;
if (n <= 0) if (n <= 0)
......
...@@ -42,12 +42,8 @@ static char api_version_warning[] = ...@@ -42,12 +42,8 @@ static char api_version_warning[] =
This Python has API version %d, module %s has version %d.\n"; This Python has API version %d, module %s has version %d.\n";
PyObject * PyObject *
Py_InitModule4(name, methods, doc, passthrough, module_api_version) Py_InitModule4(char *name, PyMethodDef *methods, char *doc,
char *name; PyObject *passthrough, int module_api_version)
PyMethodDef *methods;
char *doc;
PyObject *passthrough;
int module_api_version;
{ {
PyObject *m, *d, *v; PyObject *m, *d, *v;
PyMethodDef *ml; PyMethodDef *ml;
...@@ -84,10 +80,7 @@ Py_InitModule4(name, methods, doc, passthrough, module_api_version) ...@@ -84,10 +80,7 @@ Py_InitModule4(name, methods, doc, passthrough, module_api_version)
/* Helper for mkvalue() to scan the length of a format */ /* Helper for mkvalue() to scan the length of a format */
static int countformat(char *format, int endchar); static int countformat(char *format, int endchar)
static int countformat(format, endchar)
char *format;
int endchar;
{ {
int count = 0; int count = 0;
int level = 0; int level = 0;
...@@ -137,11 +130,7 @@ static PyObject *do_mkvalue(char**, va_list *); ...@@ -137,11 +130,7 @@ static PyObject *do_mkvalue(char**, va_list *);
static PyObject * static PyObject *
do_mkdict(p_format, p_va, endchar, n) do_mkdict(char **p_format, va_list *p_va, int endchar, int n)
char **p_format;
va_list *p_va;
int endchar;
int n;
{ {
PyObject *d; PyObject *d;
int i; int i;
...@@ -183,11 +172,7 @@ do_mkdict(p_format, p_va, endchar, n) ...@@ -183,11 +172,7 @@ do_mkdict(p_format, p_va, endchar, n)
} }
static PyObject * static PyObject *
do_mklist(p_format, p_va, endchar, n) do_mklist(char **p_format, va_list *p_va, int endchar, int n)
char **p_format;
va_list *p_va;
int endchar;
int n;
{ {
PyObject *v; PyObject *v;
int i; int i;
...@@ -224,11 +209,7 @@ _ustrlen(Py_UNICODE *u) ...@@ -224,11 +209,7 @@ _ustrlen(Py_UNICODE *u)
} }
static PyObject * static PyObject *
do_mktuple(p_format, p_va, endchar, n) do_mktuple(char **p_format, va_list *p_va, int endchar, int n)
char **p_format;
va_list *p_va;
int endchar;
int n;
{ {
PyObject *v; PyObject *v;
int i; int i;
...@@ -256,9 +237,7 @@ do_mktuple(p_format, p_va, endchar, n) ...@@ -256,9 +237,7 @@ do_mktuple(p_format, p_va, endchar, n)
} }
static PyObject * static PyObject *
do_mkvalue(p_format, p_va) do_mkvalue(char **p_format, va_list *p_va)
char **p_format;
va_list *p_va;
{ {
for (;;) { for (;;) {
switch (*(*p_format)++) { switch (*(*p_format)++) {
...@@ -401,32 +380,18 @@ do_mkvalue(p_format, p_va) ...@@ -401,32 +380,18 @@ do_mkvalue(p_format, p_va)
} }
#ifdef HAVE_STDARG_PROTOTYPES
/* VARARGS 2 */
PyObject *Py_BuildValue(char *format, ...) PyObject *Py_BuildValue(char *format, ...)
#else
/* VARARGS */
PyObject *Py_BuildValue(va_alist) va_dcl
#endif
{ {
va_list va; va_list va;
PyObject* retval; PyObject* retval;
#ifdef HAVE_STDARG_PROTOTYPES
va_start(va, format); va_start(va, format);
#else
char *format;
va_start(va);
format = va_arg(va, char *);
#endif
retval = Py_VaBuildValue(format, va); retval = Py_VaBuildValue(format, va);
va_end(va); va_end(va);
return retval; return retval;
} }
PyObject * PyObject *
Py_VaBuildValue(format, va) Py_VaBuildValue(char *format, va_list va)
char *format;
va_list va;
{ {
char *f = format; char *f = format;
int n = countformat(f, '\0'); int n = countformat(f, '\0');
...@@ -450,26 +415,14 @@ Py_VaBuildValue(format, va) ...@@ -450,26 +415,14 @@ Py_VaBuildValue(format, va)
} }
#ifdef HAVE_STDARG_PROTOTYPES
PyObject * PyObject *
PyEval_CallFunction(PyObject *obj, char *format, ...) PyEval_CallFunction(PyObject *obj, char *format, ...)
#else
PyObject *
PyEval_CallFunction(obj, format, va_alist)
PyObject *obj;
char *format;
va_dcl
#endif
{ {
va_list vargs; va_list vargs;
PyObject *args; PyObject *args;
PyObject *res; PyObject *res;
#ifdef HAVE_STDARG_PROTOTYPES
va_start(vargs, format); va_start(vargs, format);
#else
va_start(vargs);
#endif
args = Py_VaBuildValue(format, vargs); args = Py_VaBuildValue(format, vargs);
va_end(vargs); va_end(vargs);
...@@ -484,17 +437,8 @@ PyEval_CallFunction(obj, format, va_alist) ...@@ -484,17 +437,8 @@ PyEval_CallFunction(obj, format, va_alist)
} }
#ifdef HAVE_STDARG_PROTOTYPES
PyObject * PyObject *
PyEval_CallMethod(PyObject *obj, char *methodname, char *format, ...) PyEval_CallMethod(PyObject *obj, char *methodname, char *format, ...)
#else
PyObject *
PyEval_CallMethod(obj, methodname, format, va_alist)
PyObject *obj;
char *methodname;
char *format;
va_dcl
#endif
{ {
va_list vargs; va_list vargs;
PyObject *meth; PyObject *meth;
...@@ -505,11 +449,7 @@ PyEval_CallMethod(obj, methodname, format, va_alist) ...@@ -505,11 +449,7 @@ PyEval_CallMethod(obj, methodname, format, va_alist)
if (meth == NULL) if (meth == NULL)
return NULL; return NULL;
#ifdef HAVE_STDARG_PROTOTYPES
va_start(vargs, format); va_start(vargs, format);
#else
va_start(vargs);
#endif
args = Py_VaBuildValue(format, vargs); args = Py_VaBuildValue(format, vargs);
va_end(vargs); va_end(vargs);
......
...@@ -44,10 +44,7 @@ redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. ...@@ -44,10 +44,7 @@ redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#endif #endif
unsigned long unsigned long
PyOS_strtoul(str, ptr, base) PyOS_strtoul(register char *str, char **ptr, int base)
register char * str;
char ** ptr;
int base;
{ {
register unsigned long result; /* return value of the function */ register unsigned long result; /* return value of the function */
register int c; /* current input character */ register int c; /* current input character */
...@@ -137,10 +134,7 @@ int base; ...@@ -137,10 +134,7 @@ int base;
} }
long long
PyOS_strtol(str, ptr, base) PyOS_strtol(char *str, char **ptr, int base)
char * str;
char ** ptr;
int base;
{ {
long result; long result;
char sign; char sign;
......
...@@ -17,8 +17,7 @@ int PyFPE_counter = 0; ...@@ -17,8 +17,7 @@ int PyFPE_counter = 0;
warning when compiling an empty file. */ warning when compiling an empty file. */
double double
PyFPE_dummy(dummy) PyFPE_dummy(void *dummy)
void *dummy;
{ {
return 1.0; return 1.0;
} }
...@@ -37,7 +37,7 @@ PyThreadState *_PyThreadState_Current = NULL; ...@@ -37,7 +37,7 @@ PyThreadState *_PyThreadState_Current = NULL;
PyInterpreterState * PyInterpreterState *
PyInterpreterState_New() PyInterpreterState_New(void)
{ {
PyInterpreterState *interp = PyMem_NEW(PyInterpreterState, 1); PyInterpreterState *interp = PyMem_NEW(PyInterpreterState, 1);
...@@ -58,8 +58,7 @@ PyInterpreterState_New() ...@@ -58,8 +58,7 @@ PyInterpreterState_New()
void void
PyInterpreterState_Clear(interp) PyInterpreterState_Clear(PyInterpreterState *interp)
PyInterpreterState *interp;
{ {
PyThreadState *p; PyThreadState *p;
HEAD_LOCK(); HEAD_LOCK();
...@@ -73,8 +72,7 @@ PyInterpreterState_Clear(interp) ...@@ -73,8 +72,7 @@ PyInterpreterState_Clear(interp)
static void static void
zapthreads(interp) zapthreads(PyInterpreterState *interp)
PyInterpreterState *interp;
{ {
PyThreadState *p; PyThreadState *p;
/* No need to lock the mutex here because this should only happen /* No need to lock the mutex here because this should only happen
...@@ -86,8 +84,7 @@ zapthreads(interp) ...@@ -86,8 +84,7 @@ zapthreads(interp)
void void
PyInterpreterState_Delete(interp) PyInterpreterState_Delete(PyInterpreterState *interp)
PyInterpreterState *interp;
{ {
PyInterpreterState **p; PyInterpreterState **p;
zapthreads(interp); zapthreads(interp);
...@@ -106,8 +103,7 @@ PyInterpreterState_Delete(interp) ...@@ -106,8 +103,7 @@ PyInterpreterState_Delete(interp)
PyThreadState * PyThreadState *
PyThreadState_New(interp) PyThreadState_New(PyInterpreterState *interp)
PyInterpreterState *interp;
{ {
PyThreadState *tstate = PyMem_NEW(PyThreadState, 1); PyThreadState *tstate = PyMem_NEW(PyThreadState, 1);
...@@ -143,8 +139,7 @@ PyThreadState_New(interp) ...@@ -143,8 +139,7 @@ PyThreadState_New(interp)
void void
PyThreadState_Clear(tstate) PyThreadState_Clear(PyThreadState *tstate)
PyThreadState *tstate;
{ {
if (Py_VerboseFlag && tstate->frame != NULL) if (Py_VerboseFlag && tstate->frame != NULL)
fprintf(stderr, fprintf(stderr,
...@@ -168,8 +163,7 @@ PyThreadState_Clear(tstate) ...@@ -168,8 +163,7 @@ PyThreadState_Clear(tstate)
void void
PyThreadState_Delete(tstate) PyThreadState_Delete(PyThreadState *tstate)
PyThreadState *tstate;
{ {
PyInterpreterState *interp; PyInterpreterState *interp;
PyThreadState **p; PyThreadState **p;
...@@ -195,7 +189,7 @@ PyThreadState_Delete(tstate) ...@@ -195,7 +189,7 @@ PyThreadState_Delete(tstate)
PyThreadState * PyThreadState *
PyThreadState_Get() PyThreadState_Get(void)
{ {
if (_PyThreadState_Current == NULL) if (_PyThreadState_Current == NULL)
Py_FatalError("PyThreadState_Get: no current thread"); Py_FatalError("PyThreadState_Get: no current thread");
...@@ -205,8 +199,7 @@ PyThreadState_Get() ...@@ -205,8 +199,7 @@ PyThreadState_Get()
PyThreadState * PyThreadState *
PyThreadState_Swap(new) PyThreadState_Swap(PyThreadState *new)
PyThreadState *new;
{ {
PyThreadState *old = _PyThreadState_Current; PyThreadState *old = _PyThreadState_Current;
...@@ -222,7 +215,7 @@ PyThreadState_Swap(new) ...@@ -222,7 +215,7 @@ PyThreadState_Swap(new)
likely MemoryError) and the caller should pass on the exception. */ likely MemoryError) and the caller should pass on the exception. */
PyObject * PyObject *
PyThreadState_GetDict() PyThreadState_GetDict(void)
{ {
if (_PyThreadState_Current == NULL) if (_PyThreadState_Current == NULL)
Py_FatalError("PyThreadState_GetDict: no current thread"); Py_FatalError("PyThreadState_GetDict: no current thread");
......
...@@ -37,7 +37,7 @@ redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. ...@@ -37,7 +37,7 @@ redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#ifdef macintosh #ifdef macintosh
#include "macglue.h" #include "macglue.h"
#endif #endif
extern char *Py_GetPath(); extern char *Py_GetPath(void);
extern grammar _PyParser_Grammar; /* From graminit.c */ extern grammar _PyParser_Grammar; /* From graminit.c */
...@@ -59,10 +59,10 @@ static void call_ll_exitfuncs(void); ...@@ -59,10 +59,10 @@ static void call_ll_exitfuncs(void);
int _Py_AskYesNo(char *prompt); int _Py_AskYesNo(char *prompt);
#endif #endif
extern void _PyUnicode_Init(); extern void _PyUnicode_Init(void);
extern void _PyUnicode_Fini(); extern void _PyUnicode_Fini(void);
extern void _PyCodecRegistry_Init(); extern void _PyCodecRegistry_Init(void);
extern void _PyCodecRegistry_Fini(); extern void _PyCodecRegistry_Fini(void);
int Py_DebugFlag; /* Needed by parser.c */ int Py_DebugFlag; /* Needed by parser.c */
...@@ -78,7 +78,7 @@ static int initialized = 0; ...@@ -78,7 +78,7 @@ static int initialized = 0;
/* API to access the initialized flag -- useful for esoteric use */ /* API to access the initialized flag -- useful for esoteric use */
int int
Py_IsInitialized() Py_IsInitialized(void)
{ {
return initialized; return initialized;
} }
...@@ -96,7 +96,7 @@ Py_IsInitialized() ...@@ -96,7 +96,7 @@ Py_IsInitialized()
*/ */
void void
Py_Initialize() Py_Initialize(void)
{ {
PyInterpreterState *interp; PyInterpreterState *interp;
PyThreadState *tstate; PyThreadState *tstate;
...@@ -185,7 +185,7 @@ extern void dump_counts(void); ...@@ -185,7 +185,7 @@ extern void dump_counts(void);
*/ */
void void
Py_Finalize() Py_Finalize(void)
{ {
PyInterpreterState *interp; PyInterpreterState *interp;
PyThreadState *tstate; PyThreadState *tstate;
...@@ -283,7 +283,7 @@ Py_Finalize() ...@@ -283,7 +283,7 @@ Py_Finalize()
*/ */
PyThreadState * PyThreadState *
Py_NewInterpreter() Py_NewInterpreter(void)
{ {
PyInterpreterState *interp; PyInterpreterState *interp;
PyThreadState *tstate, *save_tstate; PyThreadState *tstate, *save_tstate;
...@@ -352,8 +352,7 @@ Py_NewInterpreter() ...@@ -352,8 +352,7 @@ Py_NewInterpreter()
*/ */
void void
Py_EndInterpreter(tstate) Py_EndInterpreter(PyThreadState *tstate)
PyThreadState *tstate;
{ {
PyInterpreterState *interp = tstate->interp; PyInterpreterState *interp = tstate->interp;
...@@ -373,15 +372,14 @@ Py_EndInterpreter(tstate) ...@@ -373,15 +372,14 @@ Py_EndInterpreter(tstate)
static char *progname = "python"; static char *progname = "python";
void void
Py_SetProgramName(pn) Py_SetProgramName(char *pn)
char *pn;
{ {
if (pn && *pn) if (pn && *pn)
progname = pn; progname = pn;
} }
char * char *
Py_GetProgramName() Py_GetProgramName(void)
{ {
return progname; return progname;
} }
...@@ -389,14 +387,13 @@ Py_GetProgramName() ...@@ -389,14 +387,13 @@ Py_GetProgramName()
static char *default_home = NULL; static char *default_home = NULL;
void void
Py_SetPythonHome(home) Py_SetPythonHome(char *home)
char *home;
{ {
default_home = home; default_home = home;
} }
char * char *
Py_GetPythonHome() Py_GetPythonHome(void)
{ {
char *home = default_home; char *home = default_home;
if (home == NULL) if (home == NULL)
...@@ -407,7 +404,7 @@ Py_GetPythonHome() ...@@ -407,7 +404,7 @@ Py_GetPythonHome()
/* Create __main__ module */ /* Create __main__ module */
static void static void
initmain() initmain(void)
{ {
PyObject *m, *d; PyObject *m, *d;
m = PyImport_AddModule("__main__"); m = PyImport_AddModule("__main__");
...@@ -426,7 +423,7 @@ initmain() ...@@ -426,7 +423,7 @@ initmain()
/* Import the site module (not into __main__ though) */ /* Import the site module (not into __main__ though) */
static void static void
initsite() initsite(void)
{ {
PyObject *m, *f; PyObject *m, *f;
m = PyImport_ImportModule("site"); m = PyImport_ImportModule("site");
...@@ -451,9 +448,7 @@ initsite() ...@@ -451,9 +448,7 @@ initsite()
/* Parse input from a file and execute it */ /* Parse input from a file and execute it */
int int
PyRun_AnyFile(fp, filename) PyRun_AnyFile(FILE *fp, char *filename)
FILE *fp;
char *filename;
{ {
if (filename == NULL) if (filename == NULL)
filename = "???"; filename = "???";
...@@ -464,9 +459,7 @@ PyRun_AnyFile(fp, filename) ...@@ -464,9 +459,7 @@ PyRun_AnyFile(fp, filename)
} }
int int
PyRun_InteractiveLoop(fp, filename) PyRun_InteractiveLoop(FILE *fp, char *filename)
FILE *fp;
char *filename;
{ {
PyObject *v; PyObject *v;
int ret; int ret;
...@@ -495,9 +488,7 @@ PyRun_InteractiveLoop(fp, filename) ...@@ -495,9 +488,7 @@ PyRun_InteractiveLoop(fp, filename)
} }
int int
PyRun_InteractiveOne(fp, filename) PyRun_InteractiveOne(FILE *fp, char *filename)
FILE *fp;
char *filename;
{ {
PyObject *m, *d, *v, *w; PyObject *m, *d, *v, *w;
node *n; node *n;
...@@ -549,9 +540,7 @@ PyRun_InteractiveOne(fp, filename) ...@@ -549,9 +540,7 @@ PyRun_InteractiveOne(fp, filename)
} }
int int
PyRun_SimpleFile(fp, filename) PyRun_SimpleFile(FILE *fp, char *filename)
FILE *fp;
char *filename;
{ {
PyObject *m, *d, *v; PyObject *m, *d, *v;
char *ext; char *ext;
...@@ -592,8 +581,7 @@ PyRun_SimpleFile(fp, filename) ...@@ -592,8 +581,7 @@ PyRun_SimpleFile(fp, filename)
} }
int int
PyRun_SimpleString(command) PyRun_SimpleString(char *command)
char *command;
{ {
PyObject *m, *d, *v; PyObject *m, *d, *v;
m = PyImport_AddModule("__main__"); m = PyImport_AddModule("__main__");
...@@ -612,13 +600,8 @@ PyRun_SimpleString(command) ...@@ -612,13 +600,8 @@ PyRun_SimpleString(command)
} }
static int static int
parse_syntax_error(err, message, filename, lineno, offset, text) parse_syntax_error(PyObject *err, PyObject **message, char **filename,
PyObject* err; int *lineno, int *offset, char **text)
PyObject** message;
char** filename;
int* lineno;
int* offset;
char** text;
{ {
long hold; long hold;
PyObject *v; PyObject *v;
...@@ -675,14 +658,13 @@ finally: ...@@ -675,14 +658,13 @@ finally:
} }
void void
PyErr_Print() PyErr_Print(void)
{ {
PyErr_PrintEx(1); PyErr_PrintEx(1);
} }
void void
PyErr_PrintEx(set_sys_last_vars) PyErr_PrintEx(int set_sys_last_vars)
int set_sys_last_vars;
{ {
int err = 0; int err = 0;
PyObject *exception, *v, *tb, *f; PyObject *exception, *v, *tb, *f;
...@@ -853,31 +835,22 @@ PyErr_PrintEx(set_sys_last_vars) ...@@ -853,31 +835,22 @@ PyErr_PrintEx(set_sys_last_vars)
} }
PyObject * PyObject *
PyRun_String(str, start, globals, locals) PyRun_String(char *str, int start, PyObject *globals, PyObject *locals)
char *str;
int start;
PyObject *globals, *locals;
{ {
return run_err_node(PyParser_SimpleParseString(str, start), return run_err_node(PyParser_SimpleParseString(str, start),
"<string>", globals, locals); "<string>", globals, locals);
} }
PyObject * PyObject *
PyRun_File(fp, filename, start, globals, locals) PyRun_File(FILE *fp, char *filename, int start, PyObject *globals,
FILE *fp; PyObject *locals)
char *filename;
int start;
PyObject *globals, *locals;
{ {
return run_err_node(PyParser_SimpleParseFile(fp, filename, start), return run_err_node(PyParser_SimpleParseFile(fp, filename, start),
filename, globals, locals); filename, globals, locals);
} }
static PyObject * static PyObject *
run_err_node(n, filename, globals, locals) run_err_node(node *n, char *filename, PyObject *globals, PyObject *locals)
node *n;
char *filename;
PyObject *globals, *locals;
{ {
if (n == NULL) if (n == NULL)
return NULL; return NULL;
...@@ -885,10 +858,7 @@ run_err_node(n, filename, globals, locals) ...@@ -885,10 +858,7 @@ run_err_node(n, filename, globals, locals)
} }
static PyObject * static PyObject *
run_node(n, filename, globals, locals) run_node(node *n, char *filename, PyObject *globals, PyObject *locals)
node *n;
char *filename;
PyObject *globals, *locals;
{ {
PyCodeObject *co; PyCodeObject *co;
PyObject *v; PyObject *v;
...@@ -902,10 +872,7 @@ run_node(n, filename, globals, locals) ...@@ -902,10 +872,7 @@ run_node(n, filename, globals, locals)
} }
static PyObject * static PyObject *
run_pyc_file(fp, filename, globals, locals) run_pyc_file(FILE *fp, char *filename, PyObject *globals, PyObject *locals)
FILE *fp;
char *filename;
PyObject *globals, *locals;
{ {
PyCodeObject *co; PyCodeObject *co;
PyObject *v; PyObject *v;
...@@ -934,10 +901,7 @@ run_pyc_file(fp, filename, globals, locals) ...@@ -934,10 +901,7 @@ run_pyc_file(fp, filename, globals, locals)
} }
PyObject * PyObject *
Py_CompileString(str, filename, start) Py_CompileString(char *str, char *filename, int start)
char *str;
char *filename;
int start;
{ {
node *n; node *n;
PyCodeObject *co; PyCodeObject *co;
...@@ -952,10 +916,7 @@ Py_CompileString(str, filename, start) ...@@ -952,10 +916,7 @@ Py_CompileString(str, filename, start)
/* Simplified interface to parsefile -- return node or set exception */ /* Simplified interface to parsefile -- return node or set exception */
node * node *
PyParser_SimpleParseFile(fp, filename, start) PyParser_SimpleParseFile(FILE *fp, char *filename, int start)
FILE *fp;
char *filename;
int start;
{ {
node *n; node *n;
perrdetail err; perrdetail err;
...@@ -969,9 +930,7 @@ PyParser_SimpleParseFile(fp, filename, start) ...@@ -969,9 +930,7 @@ PyParser_SimpleParseFile(fp, filename, start)
/* Simplified interface to parsestring -- return node or set exception */ /* Simplified interface to parsestring -- return node or set exception */
node * node *
PyParser_SimpleParseString(str, start) PyParser_SimpleParseString(char *str, int start)
char *str;
int start;
{ {
node *n; node *n;
perrdetail err; perrdetail err;
...@@ -984,8 +943,7 @@ PyParser_SimpleParseString(str, start) ...@@ -984,8 +943,7 @@ PyParser_SimpleParseString(str, start)
/* Set the error appropriate to the given input error code (see errcode.h) */ /* Set the error appropriate to the given input error code (see errcode.h) */
static void static void
err_input(err) err_input(perrdetail *err)
perrdetail *err;
{ {
PyObject *v, *w, *errtype; PyObject *v, *w, *errtype;
char *msg = NULL; char *msg = NULL;
...@@ -1053,8 +1011,7 @@ err_input(err) ...@@ -1053,8 +1011,7 @@ err_input(err)
/* Print fatal error message and abort */ /* Print fatal error message and abort */
void void
Py_FatalError(msg) Py_FatalError(char *msg)
char *msg;
{ {
fprintf(stderr, "Fatal Python error: %s\n", msg); fprintf(stderr, "Fatal Python error: %s\n", msg);
#ifdef macintosh #ifdef macintosh
...@@ -1079,11 +1036,10 @@ int _PyThread_Started = 0; /* Set by threadmodule.c and maybe others */ ...@@ -1079,11 +1036,10 @@ int _PyThread_Started = 0; /* Set by threadmodule.c and maybe others */
#endif #endif
#define NEXITFUNCS 32 #define NEXITFUNCS 32
static void (*exitfuncs[NEXITFUNCS])(); static void (*exitfuncs[NEXITFUNCS])(void);
static int nexitfuncs = 0; static int nexitfuncs = 0;
int Py_AtExit(func) int Py_AtExit(void (*func)(void))
void (*func)(void);
{ {
if (nexitfuncs >= NEXITFUNCS) if (nexitfuncs >= NEXITFUNCS)
return -1; return -1;
...@@ -1092,7 +1048,7 @@ int Py_AtExit(func) ...@@ -1092,7 +1048,7 @@ int Py_AtExit(func)
} }
static void static void
call_sys_exitfunc() call_sys_exitfunc(void)
{ {
PyObject *exitfunc = PySys_GetObject("exitfunc"); PyObject *exitfunc = PySys_GetObject("exitfunc");
...@@ -1115,7 +1071,7 @@ call_sys_exitfunc() ...@@ -1115,7 +1071,7 @@ call_sys_exitfunc()
} }
static void static void
call_ll_exitfuncs() call_ll_exitfuncs(void)
{ {
while (nexitfuncs > 0) while (nexitfuncs > 0)
(*exitfuncs[--nexitfuncs])(); (*exitfuncs[--nexitfuncs])();
...@@ -1125,8 +1081,7 @@ call_ll_exitfuncs() ...@@ -1125,8 +1081,7 @@ call_ll_exitfuncs()
} }
void void
Py_Exit(sts) Py_Exit(int sts)
int sts;
{ {
Py_Finalize(); Py_Finalize();
...@@ -1138,7 +1093,7 @@ Py_Exit(sts) ...@@ -1138,7 +1093,7 @@ Py_Exit(sts)
} }
static void static void
initsigs() initsigs(void)
{ {
#ifdef HAVE_SIGNAL_H #ifdef HAVE_SIGNAL_H
#ifdef SIGPIPE #ifdef SIGPIPE
...@@ -1152,8 +1107,7 @@ initsigs() ...@@ -1152,8 +1107,7 @@ initsigs()
/* Ask a yes/no question */ /* Ask a yes/no question */
int int
_Py_AskYesNo(prompt) _Py_AskYesNo(char *prompt)
char *prompt;
{ {
char buf[256]; char buf[256];
...@@ -1170,8 +1124,7 @@ _Py_AskYesNo(prompt) ...@@ -1170,8 +1124,7 @@ _Py_AskYesNo(prompt)
Pretend that stdin is always interactive, other files never. */ Pretend that stdin is always interactive, other files never. */
int int
isatty(fd) isatty(int fd)
int fd;
{ {
return fd == fileno(stdin); return fd == fileno(stdin);
} }
...@@ -1185,9 +1138,7 @@ isatty(fd) ...@@ -1185,9 +1138,7 @@ isatty(fd)
* the descriptor is NULL or "<stdin>" or "???". * the descriptor is NULL or "<stdin>" or "???".
*/ */
int int
Py_FdIsInteractive(fp, filename) Py_FdIsInteractive(FILE *fp, char *filename)
FILE *fp;
char *filename;
{ {
if (isatty((int)fileno(fp))) if (isatty((int)fileno(fp)))
return 1; return 1;
......
...@@ -19,7 +19,7 @@ redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. ...@@ -19,7 +19,7 @@ redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.
/* ARGSUSED */ /* ARGSUSED */
int int
PyErr_CheckSignals() PyErr_CheckSignals(void)
{ {
if (!PyOS_InterruptOccurred()) if (!PyOS_InterruptOccurred())
return 0; return 0;
......
...@@ -3,8 +3,7 @@ ...@@ -3,8 +3,7 @@
#include "pgenheaders.h" #include "pgenheaders.h"
char * char *
strdup(str) strdup(const char *str)
const char *str;
{ {
if (str != NULL) { if (str != NULL) {
register char *copy = malloc(strlen(str) + 1); register char *copy = malloc(strlen(str) + 1);
......
...@@ -17,8 +17,7 @@ extern int sys_nerr; ...@@ -17,8 +17,7 @@ extern int sys_nerr;
extern char *sys_errlist[]; extern char *sys_errlist[];
char * char *
strerror(err) strerror(int err)
int err;
{ {
static char buf[20]; static char buf[20];
if (err >= 0 && err < sys_nerr) if (err >= 0 && err < sys_nerr)
......
...@@ -52,17 +52,15 @@ static int MDMAXEXPT = { 309}; ...@@ -52,17 +52,15 @@ static int MDMAXEXPT = { 309};
static char MDMAXFRAC[] = "17976931348623157"; static char MDMAXFRAC[] = "17976931348623157";
static double HUGE = 1.7976931348623157e308; static double HUGE = 1.7976931348623157e308;
extern double atof(); /* Only called when result known to be ok */ extern double atof(const char *); /* Only called when result known to be ok */
#ifndef DONT_HAVE_ERRNO_H #ifndef DONT_HAVE_ERRNO_H
#include <errno.h> #include <errno.h>
#endif #endif
extern int errno; extern int errno;
double strtod(str, ptr) double strtod(char *str, char **ptr)
char *str; {
char **ptr;
{
int sign, scale, dotseen; int sign, scale, dotseen;
int esign, expt; int esign, expt;
char *save; char *save;
...@@ -155,4 +153,4 @@ double strtod(str, ptr) ...@@ -155,4 +153,4 @@ double strtod(str, ptr)
(void) sprintf(dp, "E%d", expt); (void) sprintf(dp, "E%d", expt);
errno = 0; errno = 0;
return atof(buffer)*sign; return atof(buffer)*sign;
} }
...@@ -15,8 +15,7 @@ redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. ...@@ -15,8 +15,7 @@ redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#include "structmember.h" #include "structmember.h"
static PyObject * static PyObject *
listmembers(mlist) listmembers(struct memberlist *mlist)
struct memberlist *mlist;
{ {
int i, n; int i, n;
PyObject *v; PyObject *v;
...@@ -39,10 +38,7 @@ listmembers(mlist) ...@@ -39,10 +38,7 @@ listmembers(mlist)
} }
PyObject * PyObject *
PyMember_Get(addr, mlist, name) PyMember_Get(char *addr, struct memberlist *mlist, char *name)
char *addr;
struct memberlist *mlist;
char *name;
{ {
struct memberlist *l; struct memberlist *l;
...@@ -139,11 +135,7 @@ PyMember_Get(addr, mlist, name) ...@@ -139,11 +135,7 @@ PyMember_Get(addr, mlist, name)
} }
int int
PyMember_Set(addr, mlist, name, v) PyMember_Set(char *addr, struct memberlist *mlist, char *name, PyObject *v)
char *addr;
struct memberlist *mlist;
char *name;
PyObject *v;
{ {
struct memberlist *l; struct memberlist *l;
PyObject *oldv; PyObject *oldv;
......
...@@ -38,8 +38,7 @@ extern const char *PyWin_DLLVersionString; ...@@ -38,8 +38,7 @@ extern const char *PyWin_DLLVersionString;
#endif #endif
PyObject * PyObject *
PySys_GetObject(name) PySys_GetObject(char *name)
char *name;
{ {
PyThreadState *tstate = PyThreadState_Get(); PyThreadState *tstate = PyThreadState_Get();
PyObject *sd = tstate->interp->sysdict; PyObject *sd = tstate->interp->sysdict;
...@@ -49,9 +48,7 @@ PySys_GetObject(name) ...@@ -49,9 +48,7 @@ PySys_GetObject(name)
} }
FILE * FILE *
PySys_GetFile(name, def) PySys_GetFile(char *name, FILE *def)
char *name;
FILE *def;
{ {
FILE *fp = NULL; FILE *fp = NULL;
PyObject *v = PySys_GetObject(name); PyObject *v = PySys_GetObject(name);
...@@ -63,9 +60,7 @@ PySys_GetFile(name, def) ...@@ -63,9 +60,7 @@ PySys_GetFile(name, def)
} }
int int
PySys_SetObject(name, v) PySys_SetObject(char *name, PyObject *v)
char *name;
PyObject *v;
{ {
PyThreadState *tstate = PyThreadState_Get(); PyThreadState *tstate = PyThreadState_Get();
PyObject *sd = tstate->interp->sysdict; PyObject *sd = tstate->interp->sysdict;
...@@ -80,9 +75,7 @@ PySys_SetObject(name, v) ...@@ -80,9 +75,7 @@ PySys_SetObject(name, v)
} }
static PyObject * static PyObject *
sys_exc_info(self, args) sys_exc_info(PyObject *self, PyObject *args)
PyObject *self;
PyObject *args;
{ {
PyThreadState *tstate; PyThreadState *tstate;
if (!PyArg_ParseTuple(args, ":exc_info")) if (!PyArg_ParseTuple(args, ":exc_info"))
...@@ -103,9 +96,7 @@ Return information about the exception that is currently being handled.\n\ ...@@ -103,9 +96,7 @@ Return information about the exception that is currently being handled.\n\
This should be called from inside an except clause only."; This should be called from inside an except clause only.";
static PyObject * static PyObject *
sys_exit(self, args) sys_exit(PyObject *self, PyObject *args)
PyObject *self;
PyObject *args;
{ {
/* Raise SystemExit so callers may catch it or clean up. */ /* Raise SystemExit so callers may catch it or clean up. */
PyErr_SetObject(PyExc_SystemExit, args); PyErr_SetObject(PyExc_SystemExit, args);
...@@ -122,9 +113,7 @@ If it is another kind of object, it will be printed and the system\n\ ...@@ -122,9 +113,7 @@ If it is another kind of object, it will be printed and the system\n\
exit status will be one (i.e., failure)."; exit status will be one (i.e., failure).";
static PyObject * static PyObject *
sys_getdefaultencoding(self, args) sys_getdefaultencoding(PyObject *self, PyObject *args)
PyObject *self;
PyObject *args;
{ {
if (!PyArg_ParseTuple(args, ":getdefaultencoding")) if (!PyArg_ParseTuple(args, ":getdefaultencoding"))
return NULL; return NULL;
...@@ -138,9 +127,7 @@ Return the current default string encoding used by the Unicode \n\ ...@@ -138,9 +127,7 @@ Return the current default string encoding used by the Unicode \n\
implementation."; implementation.";
static PyObject * static PyObject *
sys_setdefaultencoding(self, args) sys_setdefaultencoding(PyObject *self, PyObject *args)
PyObject *self;
PyObject *args;
{ {
char *encoding; char *encoding;
if (!PyArg_ParseTuple(args, "s:setdefaultencoding", &encoding)) if (!PyArg_ParseTuple(args, "s:setdefaultencoding", &encoding))
...@@ -157,9 +144,7 @@ static char setdefaultencoding_doc[] = ...@@ -157,9 +144,7 @@ static char setdefaultencoding_doc[] =
Set the current default string encoding used by the Unicode implementation."; Set the current default string encoding used by the Unicode implementation.";
static PyObject * static PyObject *
sys_settrace(self, args) sys_settrace(PyObject *self, PyObject *args)
PyObject *self;
PyObject *args;
{ {
PyThreadState *tstate = PyThreadState_Get(); PyThreadState *tstate = PyThreadState_Get();
if (args == Py_None) if (args == Py_None)
...@@ -179,9 +164,7 @@ Set the global debug tracing function. It will be called on each\n\ ...@@ -179,9 +164,7 @@ Set the global debug tracing function. It will be called on each\n\
function call. See the debugger chapter in the library manual."; function call. See the debugger chapter in the library manual.";
static PyObject * static PyObject *
sys_setprofile(self, args) sys_setprofile(PyObject *self, PyObject *args)
PyObject *self;
PyObject *args;
{ {
PyThreadState *tstate = PyThreadState_Get(); PyThreadState *tstate = PyThreadState_Get();
if (args == Py_None) if (args == Py_None)
...@@ -201,9 +184,7 @@ Set the profiling function. It will be called on each function call\n\ ...@@ -201,9 +184,7 @@ Set the profiling function. It will be called on each function call\n\
and return. See the profiler chapter in the library manual."; and return. See the profiler chapter in the library manual.";
static PyObject * static PyObject *
sys_setcheckinterval(self, args) sys_setcheckinterval(PyObject *self, PyObject *args)
PyObject *self;
PyObject *args;
{ {
PyThreadState *tstate = PyThreadState_Get(); PyThreadState *tstate = PyThreadState_Get();
if (!PyArg_ParseTuple(args, "i:setcheckinterval", &tstate->interp->checkinterval)) if (!PyArg_ParseTuple(args, "i:setcheckinterval", &tstate->interp->checkinterval))
...@@ -223,9 +204,7 @@ n instructions. This also affects how often thread switches occur."; ...@@ -223,9 +204,7 @@ n instructions. This also affects how often thread switches occur.";
#include <malloc.h> #include <malloc.h>
static PyObject * static PyObject *
sys_mdebug(self, args) sys_mdebug(PyObject *self, PyObject *args)
PyObject *self;
PyObject *args;
{ {
int flag; int flag;
if (!PyArg_ParseTuple(args, "i:mdebug", &flag)) if (!PyArg_ParseTuple(args, "i:mdebug", &flag))
...@@ -237,9 +216,7 @@ sys_mdebug(self, args) ...@@ -237,9 +216,7 @@ sys_mdebug(self, args)
#endif /* USE_MALLOPT */ #endif /* USE_MALLOPT */
static PyObject * static PyObject *
sys_getrefcount(self, args) sys_getrefcount(PyObject *self, PyObject *args)
PyObject *self;
PyObject *args;
{ {
PyObject *arg; PyObject *arg;
if (!PyArg_ParseTuple(args, "O:getrefcount", &arg)) if (!PyArg_ParseTuple(args, "O:getrefcount", &arg))
...@@ -267,8 +244,7 @@ temporary reference in the argument list, so it is at least 2."; ...@@ -267,8 +244,7 @@ temporary reference in the argument list, so it is at least 2.";
#ifdef COUNT_ALLOCS #ifdef COUNT_ALLOCS
static PyObject * static PyObject *
sys_getcounts(self, args) sys_getcounts(PyObject *self, PyObject *args)
PyObject *self, *args;
{ {
extern PyObject *get_counts(void); extern PyObject *get_counts(void);
...@@ -315,7 +291,7 @@ static PyMethodDef sys_methods[] = { ...@@ -315,7 +291,7 @@ static PyMethodDef sys_methods[] = {
}; };
static PyObject * static PyObject *
list_builtin_module_names() list_builtin_module_names(void)
{ {
PyObject *list = PyList_New(0); PyObject *list = PyList_New(0);
int i; int i;
...@@ -407,7 +383,7 @@ settrace() -- set the global debug tracing function\n\ ...@@ -407,7 +383,7 @@ settrace() -- set the global debug tracing function\n\
#endif #endif
PyObject * PyObject *
_PySys_Init() _PySys_Init(void)
{ {
extern int fclose(FILE *); extern int fclose(FILE *);
PyObject *m, *v, *sysdict; PyObject *m, *v, *sysdict;
...@@ -495,9 +471,7 @@ _PySys_Init() ...@@ -495,9 +471,7 @@ _PySys_Init()
} }
static PyObject * static PyObject *
makepathobject(path, delim) makepathobject(char *path, int delim)
char *path;
int delim;
{ {
int i, n; int i, n;
char *p; char *p;
...@@ -530,8 +504,7 @@ makepathobject(path, delim) ...@@ -530,8 +504,7 @@ makepathobject(path, delim)
} }
void void
PySys_SetPath(path) PySys_SetPath(char *path)
char *path;
{ {
PyObject *v; PyObject *v;
if ((v = makepathobject(path, DELIM)) == NULL) if ((v = makepathobject(path, DELIM)) == NULL)
...@@ -542,9 +515,7 @@ PySys_SetPath(path) ...@@ -542,9 +515,7 @@ PySys_SetPath(path)
} }
static PyObject * static PyObject *
makeargvobject(argc, argv) makeargvobject(int argc, char **argv)
int argc;
char **argv;
{ {
PyObject *av; PyObject *av;
if (argc <= 0 || argv == NULL) { if (argc <= 0 || argv == NULL) {
...@@ -570,9 +541,7 @@ makeargvobject(argc, argv) ...@@ -570,9 +541,7 @@ makeargvobject(argc, argv)
} }
void void
PySys_SetArgv(argc, argv) PySys_SetArgv(int argc, char **argv)
int argc;
char **argv;
{ {
PyObject *av = makeargvobject(argc, argv); PyObject *av = makeargvobject(argc, argv);
PyObject *path = PySys_GetObject("path"); PyObject *path = PySys_GetObject("path");
...@@ -674,11 +643,7 @@ PySys_SetArgv(argc, argv) ...@@ -674,11 +643,7 @@ PySys_SetArgv(argc, argv)
*/ */
static void static void
mywrite(name, fp, format, va) mywrite(char *name, FILE *fp, const char *format, va_list va)
char *name;
FILE *fp;
const char *format;
va_list va;
{ {
PyObject *file; PyObject *file;
PyObject *error_type, *error_value, *error_traceback; PyObject *error_type, *error_value, *error_traceback;
...@@ -700,43 +665,21 @@ mywrite(name, fp, format, va) ...@@ -700,43 +665,21 @@ mywrite(name, fp, format, va)
} }
void void
#ifdef HAVE_STDARG_PROTOTYPES
PySys_WriteStdout(const char *format, ...) PySys_WriteStdout(const char *format, ...)
#else
PySys_WriteStdout(va_alist)
va_dcl
#endif
{ {
va_list va; va_list va;
#ifdef HAVE_STDARG_PROTOTYPES
va_start(va, format); va_start(va, format);
#else
char *format;
va_start(va);
format = va_arg(va, char *);
#endif
mywrite("stdout", stdout, format, va); mywrite("stdout", stdout, format, va);
va_end(va); va_end(va);
} }
void void
#ifdef HAVE_STDARG_PROTOTYPES
PySys_WriteStderr(const char *format, ...) PySys_WriteStderr(const char *format, ...)
#else
PySys_WriteStderr(va_alist)
va_dcl
#endif
{ {
va_list va; va_list va;
#ifdef HAVE_STDARG_PROTOTYPES
va_start(va, format); va_start(va, format);
#else
char *format;
va_start(va);
format = va_arg(va, char *);
#endif
mywrite("stderr", stderr, format, va); mywrite("stderr", stderr, format, va);
va_end(va); va_end(va);
} }
...@@ -29,7 +29,7 @@ redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. ...@@ -29,7 +29,7 @@ redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#include <stdlib.h> #include <stdlib.h>
#else #else
#ifdef Py_DEBUG #ifdef Py_DEBUG
extern char *getenv(); extern char *getenv(const char *);
#endif #endif
#endif #endif
...@@ -73,17 +73,6 @@ extern char *getenv(); ...@@ -73,17 +73,6 @@ extern char *getenv();
#endif /* _POSIX_THREADS */ #endif /* _POSIX_THREADS */
#ifdef __STDC__
#define _P(args) args
#define _P0() (void)
#define _P1(v,t) (t)
#define _P2(v1,t1,v2,t2) (t1,t2)
#else
#define _P(args) ()
#define _P0() ()
#define _P1(v,t) (v) t;
#define _P2(v1,t1,v2,t2) (v1,v2) t1; t2;
#endif /* __STDC__ */
#ifdef Py_DEBUG #ifdef Py_DEBUG
static int thread_debug = 0; static int thread_debug = 0;
...@@ -98,7 +87,7 @@ static int initialized; ...@@ -98,7 +87,7 @@ static int initialized;
static void PyThread__init_thread(); /* Forward */ static void PyThread__init_thread(); /* Forward */
void PyThread_init_thread _P0() void PyThread_init_thread(void)
{ {
#ifdef Py_DEBUG #ifdef Py_DEBUG
char *p = getenv("THREADDEBUG"); char *p = getenv("THREADDEBUG");
......
...@@ -14,7 +14,8 @@ redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. ...@@ -14,7 +14,8 @@ redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.
/* /*
* Initialization. * Initialization.
*/ */
static void PyThread__init_thread _P0() static void
PyThread__init_thread(void)
{ {
cthread_init(); cthread_init();
} }
...@@ -22,7 +23,8 @@ static void PyThread__init_thread _P0() ...@@ -22,7 +23,8 @@ static void PyThread__init_thread _P0()
/* /*
* Thread support. * Thread support.
*/ */
int PyThread_start_new_thread _P2(func, void (*func) _P((void *)), arg, void *arg) int
PyThread_start_new_thread(func, void (*func)(void *), void *arg)
{ {
int success = 0; /* init not needed when SOLARIS_THREADS and */ int success = 0; /* init not needed when SOLARIS_THREADS and */
/* C_THREADS implemented properly */ /* C_THREADS implemented properly */
...@@ -37,14 +39,16 @@ int PyThread_start_new_thread _P2(func, void (*func) _P((void *)), arg, void *ar ...@@ -37,14 +39,16 @@ int PyThread_start_new_thread _P2(func, void (*func) _P((void *)), arg, void *ar
return success < 0 ? 0 : 1; return success < 0 ? 0 : 1;
} }
long PyThread_get_thread_ident _P0() long
PyThread_get_thread_ident(void)
{ {
if (!initialized) if (!initialized)
PyThread_init_thread(); PyThread_init_thread();
return (long) cthread_self(); return (long) cthread_self();
} }
static void do_PyThread_exit_thread _P1(no_cleanup, int no_cleanup) static void
do_PyThread_exit_thread(int no_cleanup)
{ {
dprintf(("PyThread_exit_thread called\n")); dprintf(("PyThread_exit_thread called\n"));
if (!initialized) if (!initialized)
...@@ -55,18 +59,21 @@ static void do_PyThread_exit_thread _P1(no_cleanup, int no_cleanup) ...@@ -55,18 +59,21 @@ static void do_PyThread_exit_thread _P1(no_cleanup, int no_cleanup)
cthread_exit(0); cthread_exit(0);
} }
void PyThread_exit_thread _P0() void
PyThread_exit_thread(void)
{ {
do_PyThread_exit_thread(0); do_PyThread_exit_thread(0);
} }
void PyThread__exit_thread _P0() void
PyThread__exit_thread(void)
{ {
do_PyThread_exit_thread(1); do_PyThread_exit_thread(1);
} }
#ifndef NO_EXIT_PROG #ifndef NO_EXIT_PROG
static void do_PyThread_exit_prog _P2(status, int status, no_cleanup, int no_cleanup) static
void do_PyThread_exit_prog(int status, int no_cleanup)
{ {
dprintf(("PyThread_exit_prog(%d) called\n", status)); dprintf(("PyThread_exit_prog(%d) called\n", status));
if (!initialized) if (!initialized)
...@@ -80,12 +87,14 @@ static void do_PyThread_exit_prog _P2(status, int status, no_cleanup, int no_cle ...@@ -80,12 +87,14 @@ static void do_PyThread_exit_prog _P2(status, int status, no_cleanup, int no_cle
exit(status); exit(status);
} }
void PyThread_exit_prog _P1(status, int status) void
PyThread_exit_prog(int status)
{ {
do_PyThread_exit_prog(status, 0); do_PyThread_exit_prog(status, 0);
} }
void PyThread__exit_prog _P1(status, int status) void
PyThread__exit_prog(int status)
{ {
do_PyThread_exit_prog(status, 1); do_PyThread_exit_prog(status, 1);
} }
...@@ -94,7 +103,8 @@ void PyThread__exit_prog _P1(status, int status) ...@@ -94,7 +103,8 @@ void PyThread__exit_prog _P1(status, int status)
/* /*
* Lock support. * Lock support.
*/ */
PyThread_type_lock PyThread_allocate_lock _P0() PyThread_type_lock
PyThread_allocate_lock(void)
{ {
mutex_t lock; mutex_t lock;
...@@ -112,13 +122,15 @@ PyThread_type_lock PyThread_allocate_lock _P0() ...@@ -112,13 +122,15 @@ PyThread_type_lock PyThread_allocate_lock _P0()
return (PyThread_type_lock) lock; return (PyThread_type_lock) lock;
} }
void PyThread_free_lock _P1(lock, PyThread_type_lock lock) void
PyThread_free_lock(PyThread_type_lock lock)
{ {
dprintf(("PyThread_free_lock(%p) called\n", lock)); dprintf(("PyThread_free_lock(%p) called\n", lock));
mutex_free(lock); mutex_free(lock);
} }
int PyThread_acquire_lock _P2(lock, PyThread_type_lock lock, waitflag, int waitflag) int
PyThread_acquire_lock(PyThread_type_lock lock, int waitflag)
{ {
int success = FALSE; int success = FALSE;
...@@ -133,7 +145,8 @@ int PyThread_acquire_lock _P2(lock, PyThread_type_lock lock, waitflag, int waitf ...@@ -133,7 +145,8 @@ int PyThread_acquire_lock _P2(lock, PyThread_type_lock lock, waitflag, int waitf
return success; return success;
} }
void PyThread_release_lock _P1(lock, PyThread_type_lock lock) void
PyThread_release_lock(PyThread_type_lock lock)
{ {
dprintf(("PyThread_release_lock(%p) called\n", lock)); dprintf(("PyThread_release_lock(%p) called\n", lock));
mutex_unlock((mutex_t )lock); mutex_unlock((mutex_t )lock);
...@@ -153,7 +166,8 @@ void PyThread_release_lock _P1(lock, PyThread_type_lock lock) ...@@ -153,7 +166,8 @@ void PyThread_release_lock _P1(lock, PyThread_type_lock lock)
* semaphore using a condition. * semaphore using a condition.
* *
*/ */
PyThread_type_sema PyThread_allocate_sema _P1(value, int value) PyThread_type_sema
PyThread_allocate_sema(int value)
{ {
char *sema = 0; char *sema = 0;
dprintf(("PyThread_allocate_sema called\n")); dprintf(("PyThread_allocate_sema called\n"));
...@@ -164,19 +178,22 @@ PyThread_type_sema PyThread_allocate_sema _P1(value, int value) ...@@ -164,19 +178,22 @@ PyThread_type_sema PyThread_allocate_sema _P1(value, int value)
return (PyThread_type_sema) sema; return (PyThread_type_sema) sema;
} }
void PyThread_free_sema _P1(sema, PyThread_type_sema sema) void
PyThread_free_sema(PyThread_type_sema sema)
{ {
dprintf(("PyThread_free_sema(%p) called\n", sema)); dprintf(("PyThread_free_sema(%p) called\n", sema));
} }
int PyThread_down_sema _P2(sema, PyThread_type_sema sema, waitflag, int waitflag) int
PyThread_down_sema(PyThread_type_sema sema, int waitflag)
{ {
dprintf(("PyThread_down_sema(%p, %d) called\n", sema, waitflag)); dprintf(("PyThread_down_sema(%p, %d) called\n", sema, waitflag));
dprintf(("PyThread_down_sema(%p) return\n", sema)); dprintf(("PyThread_down_sema(%p) return\n", sema));
return -1; return -1;
} }
void PyThread_up_sema _P1(sema, PyThread_type_sema sema) void
PyThread_up_sema(PyThread_type_sema sema)
{ {
dprintf(("PyThread_up_sema(%p)\n", sema)); dprintf(("PyThread_up_sema(%p)\n", sema));
} }
...@@ -11,14 +11,16 @@ redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. ...@@ -11,14 +11,16 @@ redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.
/* /*
* Initialization. * Initialization.
*/ */
static void PyThread__init_thread _P0() static void
PyThread__init_thread(void)
{ {
} }
/* /*
* Thread support. * Thread support.
*/ */
int PyThread_start_new_thread _P2(func, void (*func) _P((void *)), arg, void *arg) int
PyThread_start_new_thread(void (*func)(void *), void *arg)
{ {
int success = 0; /* init not needed when SOLARIS_THREADS and */ int success = 0; /* init not needed when SOLARIS_THREADS and */
/* C_THREADS implemented properly */ /* C_THREADS implemented properly */
...@@ -29,13 +31,15 @@ int PyThread_start_new_thread _P2(func, void (*func) _P((void *)), arg, void *ar ...@@ -29,13 +31,15 @@ int PyThread_start_new_thread _P2(func, void (*func) _P((void *)), arg, void *ar
return success < 0 ? 0 : 1; return success < 0 ? 0 : 1;
} }
long PyThread_get_thread_ident _P0() long
PyThread_get_thread_ident(void)
{ {
if (!initialized) if (!initialized)
PyThread_init_thread(); PyThread_init_thread();
} }
static void do_PyThread_exit_thread _P1(no_cleanup, int no_cleanup) static
void do_PyThread_exit_thread(int no_cleanup)
{ {
dprintf(("PyThread_exit_thread called\n")); dprintf(("PyThread_exit_thread called\n"));
if (!initialized) if (!initialized)
...@@ -45,18 +49,21 @@ static void do_PyThread_exit_thread _P1(no_cleanup, int no_cleanup) ...@@ -45,18 +49,21 @@ static void do_PyThread_exit_thread _P1(no_cleanup, int no_cleanup)
exit(0); exit(0);
} }
void PyThread_exit_thread _P0() void
PyThread_exit_thread(void)
{ {
do_PyThread_exit_thread(0); do_PyThread_exit_thread(0);
} }
void PyThread__exit_thread _P0() void
PyThread__exit_thread(void)
{ {
do_PyThread_exit_thread(1); do_PyThread_exit_thread(1);
} }
#ifndef NO_EXIT_PROG #ifndef NO_EXIT_PROG
static void do_PyThread_exit_prog _P2(status, int status, no_cleanup, int no_cleanup) static
void do_PyThread_exit_prog(int status, int no_cleanup)
{ {
dprintf(("PyThread_exit_prog(%d) called\n", status)); dprintf(("PyThread_exit_prog(%d) called\n", status));
if (!initialized) if (!initialized)
...@@ -66,12 +73,14 @@ static void do_PyThread_exit_prog _P2(status, int status, no_cleanup, int no_cle ...@@ -66,12 +73,14 @@ static void do_PyThread_exit_prog _P2(status, int status, no_cleanup, int no_cle
exit(status); exit(status);
} }
void PyThread_exit_prog _P1(status, int status) void
PyThread_exit_prog(int status)
{ {
do_PyThread_exit_prog(status, 0); do_PyThread_exit_prog(status, 0);
} }
void PyThread__exit_prog _P1(status, int status) void
PyThread__exit_prog(int status)
{ {
do_PyThread_exit_prog(status, 1); do_PyThread_exit_prog(status, 1);
} }
...@@ -80,7 +89,8 @@ void PyThread__exit_prog _P1(status, int status) ...@@ -80,7 +89,8 @@ void PyThread__exit_prog _P1(status, int status)
/* /*
* Lock support. * Lock support.
*/ */
PyThread_type_lock PyThread_allocate_lock _P0() PyThread_type_lock
PyThread_allocate_lock(void)
{ {
dprintf(("PyThread_allocate_lock called\n")); dprintf(("PyThread_allocate_lock called\n"));
...@@ -91,12 +101,14 @@ PyThread_type_lock PyThread_allocate_lock _P0() ...@@ -91,12 +101,14 @@ PyThread_type_lock PyThread_allocate_lock _P0()
return (PyThread_type_lock) lock; return (PyThread_type_lock) lock;
} }
void PyThread_free_lock _P1(lock, PyThread_type_lock lock) void
PyThread_free_lock(PyThread_type_lock lock)
{ {
dprintf(("PyThread_free_lock(%p) called\n", lock)); dprintf(("PyThread_free_lock(%p) called\n", lock));
} }
int PyThread_acquire_lock _P2(lock, PyThread_type_lock lock, waitflag, int waitflag) int
PyThread_acquire_lock(PyThread_type_lock lock, int waitflag)
{ {
int success; int success;
...@@ -105,7 +117,8 @@ int PyThread_acquire_lock _P2(lock, PyThread_type_lock lock, waitflag, int waitf ...@@ -105,7 +117,8 @@ int PyThread_acquire_lock _P2(lock, PyThread_type_lock lock, waitflag, int waitf
return success; return success;
} }
void PyThread_release_lock _P1(lock, PyThread_type_lock lock) void
PyThread_release_lock(PyThread_type_lock lock)
{ {
dprintf(("PyThread_release_lock(%p) called\n", lock)); dprintf(("PyThread_release_lock(%p) called\n", lock));
} }
...@@ -113,7 +126,8 @@ void PyThread_release_lock _P1(lock, PyThread_type_lock lock) ...@@ -113,7 +126,8 @@ void PyThread_release_lock _P1(lock, PyThread_type_lock lock)
/* /*
* Semaphore support. * Semaphore support.
*/ */
PyThread_type_sema PyThread_allocate_sema _P1(value, int value) PyThread_type_sema
PyThread_allocate_sema(int value)
{ {
dprintf(("PyThread_allocate_sema called\n")); dprintf(("PyThread_allocate_sema called\n"));
if (!initialized) if (!initialized)
...@@ -123,19 +137,22 @@ PyThread_type_sema PyThread_allocate_sema _P1(value, int value) ...@@ -123,19 +137,22 @@ PyThread_type_sema PyThread_allocate_sema _P1(value, int value)
return (PyThread_type_sema) sema; return (PyThread_type_sema) sema;
} }
void PyThread_free_sema _P1(sema, PyThread_type_sema sema) void
PyThread_free_sema(PyThread_type_sema sema)
{ {
dprintf(("PyThread_free_sema(%p) called\n", sema)); dprintf(("PyThread_free_sema(%p) called\n", sema));
} }
int PyThread_down_sema _P2(sema, PyThread_type_sema sema, waitflag, int waitflag) int
PyThread_down_sema(PyThread_type_sema sema, int waitflag)
{ {
dprintf(("PyThread_down_sema(%p, %d) called\n", sema, waitflag)); dprintf(("PyThread_down_sema(%p, %d) called\n", sema, waitflag));
dprintf(("PyThread_down_sema(%p) return\n", sema)); dprintf(("PyThread_down_sema(%p) return\n", sema));
return -1; return -1;
} }
void PyThread_up_sema _P1(sema, PyThread_type_sema sema) void
PyThread_up_sema(PyThread_type_sema sema)
{ {
dprintf(("PyThread_up_sema(%p)\n", sema)); dprintf(("PyThread_up_sema(%p)\n", sema));
} }
...@@ -25,7 +25,7 @@ struct lock { ...@@ -25,7 +25,7 @@ struct lock {
/* /*
* Initialization. * Initialization.
*/ */
static void PyThread__init_thread _P0() static void PyThread__init_thread(void)
{ {
lwp_setstkcache(STACKSIZE, NSTACKS); lwp_setstkcache(STACKSIZE, NSTACKS);
} }
...@@ -35,7 +35,7 @@ static void PyThread__init_thread _P0() ...@@ -35,7 +35,7 @@ static void PyThread__init_thread _P0()
*/ */
int PyThread_start_new_thread _P2(func, void (*func) _P((void *)), arg, void *arg) int PyThread_start_new_thread(void (*func)(void *), void *arg)
{ {
thread_t tid; thread_t tid;
int success; int success;
...@@ -46,7 +46,7 @@ int PyThread_start_new_thread _P2(func, void (*func) _P((void *)), arg, void *ar ...@@ -46,7 +46,7 @@ int PyThread_start_new_thread _P2(func, void (*func) _P((void *)), arg, void *ar
return success < 0 ? 0 : 1; return success < 0 ? 0 : 1;
} }
long PyThread_get_thread_ident _P0() long PyThread_get_thread_ident(void)
{ {
thread_t tid; thread_t tid;
if (!initialized) if (!initialized)
...@@ -56,7 +56,7 @@ long PyThread_get_thread_ident _P0() ...@@ -56,7 +56,7 @@ long PyThread_get_thread_ident _P0()
return tid.thread_id; return tid.thread_id;
} }
static void do_PyThread_exit_thread _P1(no_cleanup, int no_cleanup) static void do_PyThread_exit_thread(int no_cleanup)
{ {
dprintf(("PyThread_exit_thread called\n")); dprintf(("PyThread_exit_thread called\n"));
if (!initialized) if (!initialized)
...@@ -67,18 +67,18 @@ static void do_PyThread_exit_thread _P1(no_cleanup, int no_cleanup) ...@@ -67,18 +67,18 @@ static void do_PyThread_exit_thread _P1(no_cleanup, int no_cleanup)
lwp_destroy(SELF); lwp_destroy(SELF);
} }
void PyThread_exit_thread _P0() void PyThread_exit_thread(void)
{ {
do_PyThread_exit_thread(0); do_PyThread_exit_thread(0);
} }
void PyThread__exit_thread _P0() void PyThread__exit_thread(void)
{ {
do_PyThread_exit_thread(1); do_PyThread_exit_thread(1);
} }
#ifndef NO_EXIT_PROG #ifndef NO_EXIT_PROG
static void do_PyThread_exit_prog _P2(status, int status, no_cleanup, int no_cleanup) static void do_PyThread_exit_prog(int status, int no_cleanup)
{ {
dprintf(("PyThread_exit_prog(%d) called\n", status)); dprintf(("PyThread_exit_prog(%d) called\n", status));
if (!initialized) if (!initialized)
...@@ -89,12 +89,12 @@ static void do_PyThread_exit_prog _P2(status, int status, no_cleanup, int no_cle ...@@ -89,12 +89,12 @@ static void do_PyThread_exit_prog _P2(status, int status, no_cleanup, int no_cle
pod_exit(status); pod_exit(status);
} }
void PyThread_exit_prog _P1(status, int status) void PyThread_exit_prog(int status)
{ {
do_PyThread_exit_prog(status, 0); do_PyThread_exit_prog(status, 0);
} }
void PyThread__exit_prog _P1(status, int status) void PyThread__exit_prog(int status)
{ {
do_PyThread_exit_prog(status, 1); do_PyThread_exit_prog(status, 1);
} }
...@@ -103,7 +103,7 @@ void PyThread__exit_prog _P1(status, int status) ...@@ -103,7 +103,7 @@ void PyThread__exit_prog _P1(status, int status)
/* /*
* Lock support. * Lock support.
*/ */
PyThread_type_lock PyThread_allocate_lock _P0() PyThread_type_lock PyThread_allocate_lock(void)
{ {
struct lock *lock; struct lock *lock;
extern char *malloc(); extern char *malloc();
...@@ -120,14 +120,14 @@ PyThread_type_lock PyThread_allocate_lock _P0() ...@@ -120,14 +120,14 @@ PyThread_type_lock PyThread_allocate_lock _P0()
return (PyThread_type_lock) lock; return (PyThread_type_lock) lock;
} }
void PyThread_free_lock _P1(lock, PyThread_type_lock lock) void PyThread_free_lock(PyThread_type_lock lock)
{ {
dprintf(("PyThread_free_lock(%p) called\n", lock)); dprintf(("PyThread_free_lock(%p) called\n", lock));
mon_destroy(((struct lock *) lock)->lock_monitor); mon_destroy(((struct lock *) lock)->lock_monitor);
free((char *) lock); free((char *) lock);
} }
int PyThread_acquire_lock _P2(lock, PyThread_type_lock lock, waitflag, int waitflag) int PyThread_acquire_lock(PyThread_type_lock lock, int waitflag)
{ {
int success; int success;
...@@ -148,7 +148,7 @@ int PyThread_acquire_lock _P2(lock, PyThread_type_lock lock, waitflag, int waitf ...@@ -148,7 +148,7 @@ int PyThread_acquire_lock _P2(lock, PyThread_type_lock lock, waitflag, int waitf
return success; return success;
} }
void PyThread_release_lock _P1(lock, PyThread_type_lock lock) void PyThread_release_lock(PyThread_type_lock lock)
{ {
dprintf(("PyThread_release_lock(%p) called\n", lock)); dprintf(("PyThread_release_lock(%p) called\n", lock));
(void) mon_enter(((struct lock *) lock)->lock_monitor); (void) mon_enter(((struct lock *) lock)->lock_monitor);
...@@ -160,7 +160,7 @@ void PyThread_release_lock _P1(lock, PyThread_type_lock lock) ...@@ -160,7 +160,7 @@ void PyThread_release_lock _P1(lock, PyThread_type_lock lock)
/* /*
* Semaphore support. * Semaphore support.
*/ */
PyThread_type_sema PyThread_allocate_sema _P1(value, int value) PyThread_type_sema PyThread_allocate_sema(int value)
{ {
PyThread_type_sema sema = 0; PyThread_type_sema sema = 0;
dprintf(("PyThread_allocate_sema called\n")); dprintf(("PyThread_allocate_sema called\n"));
...@@ -171,19 +171,19 @@ PyThread_type_sema PyThread_allocate_sema _P1(value, int value) ...@@ -171,19 +171,19 @@ PyThread_type_sema PyThread_allocate_sema _P1(value, int value)
return (PyThread_type_sema) sema; return (PyThread_type_sema) sema;
} }
void PyThread_free_sema _P1(sema, PyThread_type_sema sema) void PyThread_free_sema(PyThread_type_sema sema)
{ {
dprintf(("PyThread_free_sema(%p) called\n", sema)); dprintf(("PyThread_free_sema(%p) called\n", sema));
} }
int PyThread_down_sema _P2(sema, PyThread_type_sema sema, waitflag, int waitflag) int PyThread_down_sema(PyThread_type_sema sema, int waitflag)
{ {
dprintf(("PyThread_down_sema(%p, %d) called\n", sema, waitflag)); dprintf(("PyThread_down_sema(%p, %d) called\n", sema, waitflag));
dprintf(("PyThread_down_sema(%p) return\n", sema)); dprintf(("PyThread_down_sema(%p) return\n", sema));
return -1; return -1;
} }
void PyThread_up_sema _P1(sema, PyThread_type_sema sema) void PyThread_up_sema(PyThread_type_sema sema)
{ {
dprintf(("PyThread_up_sema(%p)\n", sema)); dprintf(("PyThread_up_sema(%p)\n", sema));
} }
...@@ -122,7 +122,7 @@ BOOL LeaveNonRecursiveMutex(PNRMUTEX mutex) ...@@ -122,7 +122,7 @@ BOOL LeaveNonRecursiveMutex(PNRMUTEX mutex)
SetEvent(mutex->hevent) ; /* Other threads are waiting, wake one on them up */ SetEvent(mutex->hevent) ; /* Other threads are waiting, wake one on them up */
} }
PNRMUTEX AllocNonRecursiveMutex() PNRMUTEX AllocNonRecursiveMutex(void)
{ {
PNRMUTEX mutex = (PNRMUTEX)malloc(sizeof(NRMUTEX)) ; PNRMUTEX mutex = (PNRMUTEX)malloc(sizeof(NRMUTEX)) ;
if (mutex && !InitializeNonRecursiveMutex(mutex)) if (mutex && !InitializeNonRecursiveMutex(mutex))
...@@ -231,7 +231,7 @@ void PyThread_exit_prog(int status) ...@@ -231,7 +231,7 @@ void PyThread_exit_prog(int status)
do_PyThread_exit_prog(status, 0); do_PyThread_exit_prog(status, 0);
} }
void PyThread__exit_prog _P1(int status) void PyThread__exit_prog(int status)
{ {
do_PyThread_exit_prog(status, 1); do_PyThread_exit_prog(status, 1);
} }
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -99,7 +99,7 @@ void PyThread_exit_prog(int status) ...@@ -99,7 +99,7 @@ void PyThread_exit_prog(int status)
do_PyThread_exit_prog(status, 0); do_PyThread_exit_prog(status, 0);
} }
void PyThread__exit_prog _P1(int status) void PyThread__exit_prog(int status)
{ {
do_PyThread_exit_prog(status, 1); do_PyThread_exit_prog(status, 1);
} }
......
...@@ -36,16 +36,13 @@ static struct memberlist tb_memberlist[] = { ...@@ -36,16 +36,13 @@ static struct memberlist tb_memberlist[] = {
}; };
static PyObject * static PyObject *
tb_getattr(tb, name) tb_getattr(tracebackobject *tb, char *name)
tracebackobject *tb;
char *name;
{ {
return PyMember_Get((char *)tb, tb_memberlist, name); return PyMember_Get((char *)tb, tb_memberlist, name);
} }
static void static void
tb_dealloc(tb) tb_dealloc(tracebackobject *tb)
tracebackobject *tb;
{ {
Py_TRASHCAN_SAFE_BEGIN(tb) Py_TRASHCAN_SAFE_BEGIN(tb)
Py_XDECREF(tb->tb_next); Py_XDECREF(tb->tb_next);
...@@ -75,10 +72,8 @@ PyTypeObject Tracebacktype = { ...@@ -75,10 +72,8 @@ PyTypeObject Tracebacktype = {
}; };
static tracebackobject * static tracebackobject *
newtracebackobject(next, frame, lasti, lineno) newtracebackobject(tracebackobject *next, PyFrameObject *frame, int lasti,
tracebackobject *next; int lineno)
PyFrameObject *frame;
int lasti, lineno;
{ {
tracebackobject *tb; tracebackobject *tb;
if ((next != NULL && !is_tracebackobject(next)) || if ((next != NULL && !is_tracebackobject(next)) ||
...@@ -99,8 +94,7 @@ newtracebackobject(next, frame, lasti, lineno) ...@@ -99,8 +94,7 @@ newtracebackobject(next, frame, lasti, lineno)
} }
int int
PyTraceBack_Here(frame) PyTraceBack_Here(PyFrameObject *frame)
PyFrameObject *frame;
{ {
PyThreadState *tstate = frame->f_tstate; PyThreadState *tstate = frame->f_tstate;
tracebackobject *oldtb = (tracebackobject *) tstate->curexc_traceback; tracebackobject *oldtb = (tracebackobject *) tstate->curexc_traceback;
...@@ -114,11 +108,7 @@ PyTraceBack_Here(frame) ...@@ -114,11 +108,7 @@ PyTraceBack_Here(frame)
} }
static int static int
tb_displayline(f, filename, lineno, name) tb_displayline(PyObject *f, char *filename, int lineno, char *name)
PyObject *f;
char *filename;
int lineno;
char *name;
{ {
int err = 0; int err = 0;
FILE *xfp; FILE *xfp;
...@@ -206,10 +196,7 @@ tb_displayline(f, filename, lineno, name) ...@@ -206,10 +196,7 @@ tb_displayline(f, filename, lineno, name)
} }
static int static int
tb_printinternal(tb, f, limit) tb_printinternal(tracebackobject *tb, PyObject *f, int limit)
tracebackobject *tb;
PyObject *f;
int limit;
{ {
int err = 0; int err = 0;
int depth = 0; int depth = 0;
...@@ -238,9 +225,7 @@ tb_printinternal(tb, f, limit) ...@@ -238,9 +225,7 @@ tb_printinternal(tb, f, limit)
} }
int int
PyTraceBack_Print(v, f) PyTraceBack_Print(PyObject *v, PyObject *f)
PyObject *v;
PyObject *f;
{ {
int err; int err;
PyObject *limitv; PyObject *limitv;
......
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