Nuke all remaining occurrences of Py_PROTO and Py_FPROTO.

This commit is contained in:
Tim Peters 2000-07-09 03:09:57 +00:00
parent 4be47c0f76
commit dbd9ba6a6c
53 changed files with 295 additions and 303 deletions

View file

@ -76,22 +76,22 @@
static struct PycStringIO_CAPI { static struct PycStringIO_CAPI {
/* Read a string. If the last argument is -1, the remainder will be read. */ /* Read a string. If the last argument is -1, the remainder will be read. */
int(*cread) Py_FPROTO((PyObject *, char **, int)); int(*cread)(PyObject *, char **, int);
/* Read a line */ /* Read a line */
int(*creadline) Py_FPROTO((PyObject *, char **)); int(*creadline)(PyObject *, char **);
/* Write a string */ /* Write a string */
int(*cwrite) Py_FPROTO((PyObject *, char *, int)); int(*cwrite)(PyObject *, char *, int);
/* Get the cStringIO object as a Python string */ /* Get the cStringIO object as a Python string */
PyObject *(*cgetvalue) Py_FPROTO((PyObject *)); PyObject *(*cgetvalue)(PyObject *);
/* Create a new output object */ /* Create a new output object */
PyObject *(*NewOutput) Py_FPROTO((int)); PyObject *(*NewOutput)(int);
/* Create an input object from a Python string */ /* Create an input object from a Python string */
PyObject *(*NewInput) Py_FPROTO((PyObject *)); PyObject *(*NewInput)(PyObject *);
/* The Python types for cStringIO input and output objects. /* The Python types for cStringIO input and output objects.
Note that you can do input on an output object. Note that you can do input on an output object.

View file

@ -20,9 +20,9 @@ extern DL_IMPORT(PyTypeObject) PyCFunction_Type;
#define PyCFunction_Check(op) ((op)->ob_type == &PyCFunction_Type) #define PyCFunction_Check(op) ((op)->ob_type == &PyCFunction_Type)
typedef PyObject *(*PyCFunction) Py_FPROTO((PyObject *, PyObject *)); typedef PyObject *(*PyCFunction)(PyObject *, PyObject *);
typedef PyObject *(*PyCFunctionWithKeywords) typedef PyObject *(*PyCFunctionWithKeywords)(PyObject *, PyObject *,
Py_FPROTO((PyObject *, PyObject *, PyObject *)); PyObject *);
extern DL_IMPORT(PyCFunction) PyCFunction_GetFunction(PyObject *); extern DL_IMPORT(PyCFunction) PyCFunction_GetFunction(PyObject *);
extern DL_IMPORT(PyObject *) PyCFunction_GetSelf(PyObject *); extern DL_IMPORT(PyObject *) PyCFunction_GetSelf(PyObject *);

View file

@ -90,9 +90,9 @@ extern "C" {
#ifndef PyCore_MALLOC_PROTO #ifndef PyCore_MALLOC_PROTO
#undef PyCore_REALLOC_PROTO #undef PyCore_REALLOC_PROTO
#undef PyCore_FREE_PROTO #undef PyCore_FREE_PROTO
#define PyCore_MALLOC_PROTO Py_PROTO((size_t)) #define PyCore_MALLOC_PROTO (size_t)
#define PyCore_REALLOC_PROTO Py_PROTO((ANY *, size_t)) #define PyCore_REALLOC_PROTO (ANY *, size_t)
#define PyCore_FREE_PROTO Py_PROTO((ANY *)) #define PyCore_FREE_PROTO (ANY *)
#endif #endif
#ifdef NEED_TO_DECLARE_MALLOC_AND_FRIEND #ifdef NEED_TO_DECLARE_MALLOC_AND_FRIEND
@ -138,9 +138,9 @@ extern void PyCore_FREE_FUNC PyCore_FREE_PROTO;
returns a non-NULL pointer, even if the underlying malloc returns a non-NULL pointer, even if the underlying malloc
doesn't. Returned pointers must be checked for NULL explicitly. doesn't. Returned pointers must be checked for NULL explicitly.
No action is performed on failure. */ No action is performed on failure. */
extern DL_IMPORT(ANY *) PyMem_Malloc Py_PROTO((size_t)); extern DL_IMPORT(ANY *) PyMem_Malloc(size_t);
extern DL_IMPORT(ANY *) PyMem_Realloc Py_PROTO((ANY *, size_t)); extern DL_IMPORT(ANY *) PyMem_Realloc(ANY *, size_t);
extern DL_IMPORT(void) PyMem_Free Py_PROTO((ANY *)); extern DL_IMPORT(void) PyMem_Free(ANY *);
/* Starting from Python 1.6, the wrappers Py_{Malloc,Realloc,Free} are /* Starting from Python 1.6, the wrappers Py_{Malloc,Realloc,Free} are
no longer supported. They used to call PyErr_NoMemory() on failure. */ no longer supported. They used to call PyErr_NoMemory() on failure. */
@ -198,7 +198,7 @@ extern DL_IMPORT(void) PyMem_Free Py_PROTO((ANY *));
#define PyCore_MALLOC_FUNC d_malloc #define PyCore_MALLOC_FUNC d_malloc
... ...
#define PyCore_MALLOC_PROTO Py_PROTO((size_t, char *, unsigned long)) #define PyCore_MALLOC_PROTO (size_t, char *, unsigned long)
... ...
#define NEED_TO_DECLARE_MALLOC_AND_FRIEND #define NEED_TO_DECLARE_MALLOC_AND_FRIEND

View file

@ -10,7 +10,7 @@
#endif #endif
#ifndef HAVE_HYPOT #ifndef HAVE_HYPOT
extern double hypot Py_PROTO((double, double)); extern double hypot(double, double);
#ifdef MWERKS_BEFORE_PRO4 #ifdef MWERKS_BEFORE_PRO4
#define hypot we_dont_want_faulty_hypot_decl #define hypot we_dont_want_faulty_hypot_decl
#endif #endif

View file

@ -14,6 +14,11 @@ See the file "Misc/COPYRIGHT" for information on usage and
redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.
******************************************************************/ ******************************************************************/
/***************************************
THIS FILE IS OBSOLETE
DON'T USE Py_PROTO or Py_FPROTO anymore.
***************************************/
#ifdef HAVE_PROTOTYPES #ifdef HAVE_PROTOTYPES
#define Py_PROTO(x) x #define Py_PROTO(x) x
#else #else

View file

@ -31,8 +31,8 @@ struct arrayobject; /* Forward */
struct arraydescr { struct arraydescr {
int typecode; int typecode;
int itemsize; int itemsize;
PyObject * (*getitem) Py_FPROTO((struct arrayobject *, int)); PyObject * (*getitem)(struct arrayobject *, int);
int (*setitem) Py_FPROTO((struct arrayobject *, int, PyObject *)); int (*setitem)(struct arrayobject *, int, PyObject *);
}; };
typedef struct arrayobject { typedef struct arrayobject {
@ -46,15 +46,15 @@ staticforward PyTypeObject Arraytype;
#define is_arrayobject(op) ((op)->ob_type == &Arraytype) #define is_arrayobject(op) ((op)->ob_type == &Arraytype)
/* Forward */ /* Forward */
static PyObject *newarrayobject Py_PROTO((int, struct arraydescr *)); static PyObject *newarrayobject(int, struct arraydescr *);
#if 0 #if 0
static int getarraysize Py_PROTO((PyObject *)); static int getarraysize(PyObject *);
#endif #endif
static PyObject *getarrayitem Py_PROTO((PyObject *, int)); static PyObject *getarrayitem(PyObject *, int);
static int setarrayitem Py_PROTO((PyObject *, int, PyObject *)); static int setarrayitem(PyObject *, int, PyObject *);
#if 0 #if 0
static int insarrayitem Py_PROTO((PyObject *, int, PyObject *)); static int insarrayitem(PyObject *, int, PyObject *);
static int addarrayitem Py_PROTO((PyObject *, PyObject *)); static int addarrayitem(PyObject *, PyObject *);
#endif #endif
static PyObject * static PyObject *

View file

@ -38,34 +38,34 @@ typedef char *string;
#define getishortarraysize PyArg_GetShortArraySize #define getishortarraysize PyArg_GetShortArraySize
#define getistringarg PyArg_GetString #define getistringarg PyArg_GetString
extern int PyArg_GetObject Py_PROTO((PyObject *args, int nargs, extern int PyArg_GetObject(PyObject *args, int nargs,
int i, PyObject **p_a)); int i, PyObject **p_a);
extern int PyArg_GetLong Py_PROTO((PyObject *args, int nargs, extern int PyArg_GetLong(PyObject *args, int nargs,
int i, long *p_a)); int i, long *p_a);
extern int PyArg_GetShort Py_PROTO((PyObject *args, int nargs, extern int PyArg_GetShort(PyObject *args, int nargs,
int i, short *p_a)); int i, short *p_a);
extern int PyArg_GetFloat Py_PROTO((PyObject *args, int nargs, extern int PyArg_GetFloat(PyObject *args, int nargs,
int i, float *p_a)); int i, float *p_a);
extern int PyArg_GetString Py_PROTO((PyObject *args, int nargs, extern int PyArg_GetString(PyObject *args, int nargs,
int i, string *p_a)); int i, string *p_a);
extern int PyArg_GetChar Py_PROTO((PyObject *args, int nargs, extern int PyArg_GetChar(PyObject *args, int nargs,
int i, char *p_a)); int i, char *p_a);
extern int PyArg_GetLongArray Py_PROTO((PyObject *args, int nargs, extern int PyArg_GetLongArray(PyObject *args, int nargs,
int i, int n, long *p_a)); int i, int n, long *p_a);
extern int PyArg_GetShortArray Py_PROTO((PyObject *args, int nargs, extern int PyArg_GetShortArray(PyObject *args, int nargs,
int i, int n, short *p_a)); int i, int n, short *p_a);
extern int PyArg_GetDoubleArray Py_PROTO((PyObject *args, int nargs, extern int PyArg_GetDoubleArray(PyObject *args, int nargs,
int i, int n, double *p_a)); int i, int n, double *p_a);
extern int PyArg_GetFloatArray Py_PROTO((PyObject *args, int nargs, extern int PyArg_GetFloatArray(PyObject *args, int nargs,
int i, int n, float *p_a)); int i, int n, float *p_a);
extern int PyArg_GetLongArraySize Py_PROTO((PyObject *args, int nargs, extern int PyArg_GetLongArraySize(PyObject *args, int nargs,
int i, long *p_a)); int i, long *p_a);
extern int PyArg_GetShortArraySize Py_PROTO((PyObject *args, int nargs, extern int PyArg_GetShortArraySize(PyObject *args, int nargs,
int i, short *p_a)); int i, short *p_a);
extern int PyArg_GetDoubleArraySize Py_PROTO((PyObject *args, int nargs, extern int PyArg_GetDoubleArraySize(PyObject *args, int nargs,
int i, double *p_a)); int i, double *p_a);
extern int PyArg_GetFloatArraySize Py_PROTO((PyObject *args, int nargs, extern int PyArg_GetFloatArraySize(PyObject *args, int nargs,
int i, float *p_a)); int i, float *p_a);
#ifdef __cplusplus #ifdef __cplusplus
} }

View file

@ -347,7 +347,7 @@ math_error()
static PyObject * static PyObject *
math_1(args, func) math_1(args, func)
PyObject *args; PyObject *args;
Py_complex (*func) Py_FPROTO((Py_complex)); Py_complex (*func)(Py_complex);
{ {
Py_complex x; Py_complex x;
if (!PyArg_ParseTuple(args, "D", &x)) if (!PyArg_ParseTuple(args, "D", &x))

View file

@ -107,7 +107,7 @@ gl_varray(self, args)
PyObject *v, *w=NULL; PyObject *v, *w=NULL;
int i, n, width; int i, n, width;
double vec[3]; double vec[3];
PyObject * (*getitem) Py_FPROTO((PyObject *, int)); PyObject * (*getitem)(PyObject *, int);
if (!PyArg_GetObject(args, 1, 0, &v)) if (!PyArg_GetObject(args, 1, 0, &v))
return NULL; return NULL;
@ -208,7 +208,7 @@ gen_nvarray(args, inorm)
PyObject *v, *w, *wnorm, *wvec; PyObject *v, *w, *wnorm, *wvec;
int i, n; int i, n;
float norm[3], vec[3]; float norm[3], vec[3];
PyObject * (*getitem) Py_FPROTO((PyObject *, int)); PyObject * (*getitem)(PyObject *, int);
if (!PyArg_GetObject(args, 1, 0, &v)) if (!PyArg_GetObject(args, 1, 0, &v))
return NULL; return NULL;

View file

@ -1012,8 +1012,8 @@ mpz_mpzcoerce(z)
} /* mpz_mpzcoerce() */ } /* mpz_mpzcoerce() */
/* Forward */ /* Forward */
static void mpz_divm Py_PROTO((MP_INT *res, const MP_INT *num, static void mpz_divm(MP_INT *res, const MP_INT *num,
const MP_INT *den, const MP_INT *mod)); const MP_INT *den, const MP_INT *mod);
static PyObject * static PyObject *
MPZ_powm(self, args) MPZ_powm(self, args)

View file

@ -71,7 +71,7 @@ nis_mapname (map, pfix)
return map; return map;
} }
typedef int (*foreachfunc) Py_PROTO((int, char *, int, char *, int, char *)); typedef int (*foreachfunc)(int, char *, int, char *, int, char *);
struct ypcallback_data { struct ypcallback_data {
PyObject *dict; PyObject *dict;

View file

@ -39,7 +39,7 @@ extern Function *rl_event_hook;
/* Pointers needed from outside (but not declared in a header file). */ /* Pointers needed from outside (but not declared in a header file). */
extern int (*PyOS_InputHook)(); extern int (*PyOS_InputHook)();
extern char *(*PyOS_ReadlineFunctionPointer) Py_PROTO((char *)); extern char *(*PyOS_ReadlineFunctionPointer)(char *);
/* Exported function to send one line to readline's init file parser */ /* Exported function to send one line to readline's init file parser */

View file

@ -95,12 +95,12 @@ typedef struct {
#define CHANOFFSET(z) (3-(z)) /* this is byte order dependent */ #define CHANOFFSET(z) (3-(z)) /* this is byte order dependent */
static void expandrow Py_PROTO((unsigned char *, unsigned char *, int)); static void expandrow(unsigned char *, unsigned char *, int);
static void setalpha Py_PROTO((unsigned char *, int)); static void setalpha(unsigned char *, int);
static void copybw Py_PROTO((Py_Int32 *, int)); static void copybw(Py_Int32 *, int);
static void interleaverow Py_PROTO((unsigned char*, unsigned char*, int, int)); static void interleaverow(unsigned char*, unsigned char*, int, int);
static int compressrow Py_PROTO((unsigned char *, unsigned char *, int, int)); static int compressrow(unsigned char *, unsigned char *, int, int);
static void lumrow Py_PROTO((unsigned char *, unsigned char *, int)); static void lumrow(unsigned char *, unsigned char *, int);
#ifdef ADD_TAGS #ifdef ADD_TAGS
#define TAGLEN (5) #define TAGLEN (5)

View file

@ -123,7 +123,7 @@ signal_handler(sig_num)
is_tripped++; is_tripped++;
Handlers[sig_num].tripped = 1; Handlers[sig_num].tripped = 1;
Py_AddPendingCall( Py_AddPendingCall(
(int (*) Py_PROTO((ANY *)))PyErr_CheckSignals, NULL); (int (*)(ANY *))PyErr_CheckSignals, NULL);
#ifdef WITH_THREAD #ifdef WITH_THREAD
} }
#endif #endif
@ -638,7 +638,7 @@ PyErr_SetInterrupt()
{ {
is_tripped++; is_tripped++;
Handlers[SIGINT].tripped = 1; Handlers[SIGINT].tripped = 1;
Py_AddPendingCall((int (*) Py_PROTO((ANY *)))PyErr_CheckSignals, NULL); Py_AddPendingCall((int (*)(ANY *))PyErr_CheckSignals, NULL);
} }
void void

View file

@ -1112,7 +1112,7 @@ will allow before refusing new connections.";
static PyObject * static PyObject *
BUILD_FUNC_DEF_2(PySocketSock_makefile,PySocketSockObject *,s, PyObject *,args) BUILD_FUNC_DEF_2(PySocketSock_makefile,PySocketSockObject *,s, PyObject *,args)
{ {
extern int fclose Py_PROTO((FILE *)); extern int fclose(FILE *);
char *mode = "r"; char *mode = "r";
int bufsize = -1; int bufsize = -1;
#ifdef MS_WIN32 #ifdef MS_WIN32

View file

@ -878,7 +878,7 @@ strop_atof(self, args)
PyObject *self; /* Not used */ PyObject *self; /* Not used */
PyObject *args; PyObject *args;
{ {
extern double strtod Py_PROTO((const char *, char **)); extern double strtod(const char *, char **);
char *s, *end; char *s, *end;
double x; double x;
char buffer[256]; /* For errors */ char buffer[256]; /* For errors */

View file

@ -406,11 +406,10 @@ typedef struct _formatdef {
char format; char format;
int size; int size;
int alignment; int alignment;
PyObject* (*unpack) Py_PROTO((const char *, PyObject* (*unpack)(const char *,
const struct _formatdef *)); const struct _formatdef *);
int (*pack) Py_PROTO((char *, int (*pack)(char *, PyObject *,
PyObject *, const struct _formatdef *);
const struct _formatdef *));
} formatdef; } formatdef;
static PyObject * static PyObject *

View file

@ -37,7 +37,7 @@ typedef struct {
static PyObject *SvError; /* exception sv.error */ static PyObject *SvError; /* exception sv.error */
static PyObject *newcaptureobject Py_PROTO((svobject *, void *, int)); static PyObject *newcaptureobject(svobject *, void *, int);
/* Set a SV-specific error from svideo_errno and return NULL */ /* Set a SV-specific error from svideo_errno and return NULL */
static PyObject * static PyObject *

View file

@ -90,8 +90,8 @@ extern int ftime();
#endif #endif
/* Forward declarations */ /* Forward declarations */
static int floatsleep Py_PROTO((double)); static int floatsleep(double);
static double floattime Py_PROTO(()); static double floattime();
/* For Y2K check */ /* For Y2K check */
static PyObject *moddict; static PyObject *moddict;
@ -255,7 +255,7 @@ tmtotuple(p)
static PyObject * static PyObject *
time_convert(when, function) time_convert(when, function)
time_t when; time_t when;
struct tm * (*function) Py_PROTO((const time_t *)); struct tm * (*function)(const time_t *);
{ {
struct tm *p; struct tm *p;
errno = 0; errno = 0;
@ -786,8 +786,8 @@ floatsleep(double secs)
#ifdef MSDOS #ifdef MSDOS
struct timeb t1, t2; struct timeb t1, t2;
double frac; double frac;
extern double fmod Py_PROTO((double, double)); extern double fmod(double, double);
extern double floor Py_PROTO((double)); extern double floor(double);
if (secs <= 0.0) if (secs <= 0.0)
return; return;
frac = fmod(secs, 1.0); frac = fmod(secs, 1.0);

View file

@ -310,7 +310,7 @@ PyNumber_Or(v, w)
BINOP(v, w, "__or__", "__ror__", PyNumber_Or); BINOP(v, w, "__or__", "__ror__", PyNumber_Or);
if (v->ob_type->tp_as_number != NULL) { if (v->ob_type->tp_as_number != NULL) {
PyObject *x = NULL; PyObject *x = NULL;
PyObject * (*f) Py_FPROTO((PyObject *, PyObject *)); PyObject * (*f)(PyObject *, PyObject *);
if (PyNumber_Coerce(&v, &w) != 0) if (PyNumber_Coerce(&v, &w) != 0)
return NULL; return NULL;
if ((f = v->ob_type->tp_as_number->nb_or) != NULL) if ((f = v->ob_type->tp_as_number->nb_or) != NULL)
@ -332,7 +332,7 @@ PyNumber_Xor(v, w)
BINOP(v, w, "__xor__", "__rxor__", PyNumber_Xor); BINOP(v, w, "__xor__", "__rxor__", PyNumber_Xor);
if (v->ob_type->tp_as_number != NULL) { if (v->ob_type->tp_as_number != NULL) {
PyObject *x = NULL; PyObject *x = NULL;
PyObject * (*f) Py_FPROTO((PyObject *, PyObject *)); PyObject * (*f)(PyObject *, PyObject *);
if (PyNumber_Coerce(&v, &w) != 0) if (PyNumber_Coerce(&v, &w) != 0)
return NULL; return NULL;
if ((f = v->ob_type->tp_as_number->nb_xor) != NULL) if ((f = v->ob_type->tp_as_number->nb_xor) != NULL)
@ -352,7 +352,7 @@ PyNumber_And(v, w)
BINOP(v, w, "__and__", "__rand__", PyNumber_And); BINOP(v, w, "__and__", "__rand__", PyNumber_And);
if (v->ob_type->tp_as_number != NULL) { if (v->ob_type->tp_as_number != NULL) {
PyObject *x = NULL; PyObject *x = NULL;
PyObject * (*f) Py_FPROTO((PyObject *, PyObject *)); PyObject * (*f)(PyObject *, PyObject *);
if (PyNumber_Coerce(&v, &w) != 0) if (PyNumber_Coerce(&v, &w) != 0)
return NULL; return NULL;
if ((f = v->ob_type->tp_as_number->nb_and) != NULL) if ((f = v->ob_type->tp_as_number->nb_and) != NULL)
@ -372,7 +372,7 @@ PyNumber_Lshift(v, w)
BINOP(v, w, "__lshift__", "__rlshift__", PyNumber_Lshift); BINOP(v, w, "__lshift__", "__rlshift__", PyNumber_Lshift);
if (v->ob_type->tp_as_number != NULL) { if (v->ob_type->tp_as_number != NULL) {
PyObject *x = NULL; PyObject *x = NULL;
PyObject * (*f) Py_FPROTO((PyObject *, PyObject *)); PyObject * (*f)(PyObject *, PyObject *);
if (PyNumber_Coerce(&v, &w) != 0) if (PyNumber_Coerce(&v, &w) != 0)
return NULL; return NULL;
if ((f = v->ob_type->tp_as_number->nb_lshift) != NULL) if ((f = v->ob_type->tp_as_number->nb_lshift) != NULL)
@ -392,7 +392,7 @@ PyNumber_Rshift(v, w)
BINOP(v, w, "__rshift__", "__rrshift__", PyNumber_Rshift); BINOP(v, w, "__rshift__", "__rrshift__", PyNumber_Rshift);
if (v->ob_type->tp_as_number != NULL) { if (v->ob_type->tp_as_number != NULL) {
PyObject *x = NULL; PyObject *x = NULL;
PyObject * (*f) Py_FPROTO((PyObject *, PyObject *)); PyObject * (*f)(PyObject *, PyObject *);
if (PyNumber_Coerce(&v, &w) != 0) if (PyNumber_Coerce(&v, &w) != 0)
return NULL; return NULL;
if ((f = v->ob_type->tp_as_number->nb_rshift) != NULL) if ((f = v->ob_type->tp_as_number->nb_rshift) != NULL)
@ -417,7 +417,7 @@ PyNumber_Add(v, w)
return (*m->sq_concat)(v, w); return (*m->sq_concat)(v, w);
else if (v->ob_type->tp_as_number != NULL) { else if (v->ob_type->tp_as_number != NULL) {
PyObject *x = NULL; PyObject *x = NULL;
PyObject * (*f) Py_FPROTO((PyObject *, PyObject *)); PyObject * (*f)(PyObject *, PyObject *);
if (PyNumber_Coerce(&v, &w) != 0) if (PyNumber_Coerce(&v, &w) != 0)
return NULL; return NULL;
if ((f = v->ob_type->tp_as_number->nb_add) != NULL) if ((f = v->ob_type->tp_as_number->nb_add) != NULL)
@ -437,7 +437,7 @@ PyNumber_Subtract(v, w)
BINOP(v, w, "__sub__", "__rsub__", PyNumber_Subtract); BINOP(v, w, "__sub__", "__rsub__", PyNumber_Subtract);
if (v->ob_type->tp_as_number != NULL) { if (v->ob_type->tp_as_number != NULL) {
PyObject *x = NULL; PyObject *x = NULL;
PyObject * (*f) Py_FPROTO((PyObject *, PyObject *)); PyObject * (*f)(PyObject *, PyObject *);
if (PyNumber_Coerce(&v, &w) != 0) if (PyNumber_Coerce(&v, &w) != 0)
return NULL; return NULL;
if ((f = v->ob_type->tp_as_number->nb_subtract) != NULL) if ((f = v->ob_type->tp_as_number->nb_subtract) != NULL)
@ -469,7 +469,7 @@ PyNumber_Multiply(v, w)
} }
if (tp->tp_as_number != NULL) { if (tp->tp_as_number != NULL) {
PyObject *x = NULL; PyObject *x = NULL;
PyObject * (*f) Py_FPROTO((PyObject *, PyObject *)); PyObject * (*f)(PyObject *, PyObject *);
if (PyInstance_Check(v)) { if (PyInstance_Check(v)) {
/* Instances of user-defined classes get their /* Instances of user-defined classes get their
other argument uncoerced, so they may other argument uncoerced, so they may
@ -515,7 +515,7 @@ PyNumber_Divide(v, w)
BINOP(v, w, "__div__", "__rdiv__", PyNumber_Divide); BINOP(v, w, "__div__", "__rdiv__", PyNumber_Divide);
if (v->ob_type->tp_as_number != NULL) { if (v->ob_type->tp_as_number != NULL) {
PyObject *x = NULL; PyObject *x = NULL;
PyObject * (*f) Py_FPROTO((PyObject *, PyObject *)); PyObject * (*f)(PyObject *, PyObject *);
if (PyNumber_Coerce(&v, &w) != 0) if (PyNumber_Coerce(&v, &w) != 0)
return NULL; return NULL;
if ((f = v->ob_type->tp_as_number->nb_divide) != NULL) if ((f = v->ob_type->tp_as_number->nb_divide) != NULL)
@ -539,7 +539,7 @@ PyNumber_Remainder(v, w)
BINOP(v, w, "__mod__", "__rmod__", PyNumber_Remainder); BINOP(v, w, "__mod__", "__rmod__", PyNumber_Remainder);
if (v->ob_type->tp_as_number != NULL) { if (v->ob_type->tp_as_number != NULL) {
PyObject *x = NULL; PyObject *x = NULL;
PyObject * (*f) Py_FPROTO((PyObject *, PyObject *)); PyObject * (*f)(PyObject *, PyObject *);
if (PyNumber_Coerce(&v, &w) != 0) if (PyNumber_Coerce(&v, &w) != 0)
return NULL; return NULL;
if ((f = v->ob_type->tp_as_number->nb_remainder) != NULL) if ((f = v->ob_type->tp_as_number->nb_remainder) != NULL)
@ -559,7 +559,7 @@ PyNumber_Divmod(v, w)
BINOP(v, w, "__divmod__", "__rdivmod__", PyNumber_Divmod); BINOP(v, w, "__divmod__", "__rdivmod__", PyNumber_Divmod);
if (v->ob_type->tp_as_number != NULL) { if (v->ob_type->tp_as_number != NULL) {
PyObject *x = NULL; PyObject *x = NULL;
PyObject * (*f) Py_FPROTO((PyObject *, PyObject *)); PyObject * (*f)(PyObject *, PyObject *);
if (PyNumber_Coerce(&v, &w) != 0) if (PyNumber_Coerce(&v, &w) != 0)
return NULL; return NULL;
if ((f = v->ob_type->tp_as_number->nb_divmod) != NULL) if ((f = v->ob_type->tp_as_number->nb_divmod) != NULL)
@ -579,7 +579,7 @@ do_pow(v, w)
PyObject *v, *w; PyObject *v, *w;
{ {
PyObject *res; PyObject *res;
PyObject * (*f) Py_FPROTO((PyObject *, PyObject *, PyObject *)); PyObject * (*f)(PyObject *, PyObject *, PyObject *);
BINOP(v, w, "__pow__", "__rpow__", do_pow); BINOP(v, w, "__pow__", "__rpow__", do_pow);
if (v->ob_type->tp_as_number == NULL || if (v->ob_type->tp_as_number == NULL ||
w->ob_type->tp_as_number == NULL) { w->ob_type->tp_as_number == NULL) {
@ -604,7 +604,7 @@ PyNumber_Power(v, w, z)
{ {
PyObject *res; PyObject *res;
PyObject *v1, *z1, *w2, *z2; PyObject *v1, *z1, *w2, *z2;
PyObject * (*f) Py_FPROTO((PyObject *, PyObject *, PyObject *)); PyObject * (*f)(PyObject *, PyObject *, PyObject *);
if (z == Py_None) if (z == Py_None)
return do_pow(v, w); return do_pow(v, w);

View file

@ -14,10 +14,10 @@ redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#include "structmember.h" #include "structmember.h"
/* Forward */ /* Forward */
static PyObject *class_lookup static PyObject *class_lookup(PyClassObject *, PyObject *,
Py_PROTO((PyClassObject *, PyObject *, PyClassObject **)); PyClassObject **);
static PyObject *instance_getattr1 Py_PROTO((PyInstanceObject *, PyObject *)); static PyObject *instance_getattr1(PyInstanceObject *, PyObject *);
static PyObject *instance_getattr2 Py_PROTO((PyInstanceObject *, PyObject *)); static PyObject *instance_getattr2(PyInstanceObject *, PyObject *);
static PyObject *getattrstr, *setattrstr, *delattrstr; static PyObject *getattrstr, *setattrstr, *delattrstr;
@ -1203,8 +1203,8 @@ generic_unary_op(self, methodname)
/* Forward */ /* Forward */
static int halfbinop Py_PROTO((PyObject *, PyObject *, char *, PyObject **, static int halfbinop(PyObject *, PyObject *, char *, PyObject **,
PyObject * (*) Py_PROTO((PyObject *, PyObject *)), int )); PyObject * (*)(PyObject *, PyObject *), int);
/* Implement a binary operator involving at least one class instance. */ /* Implement a binary operator involving at least one class instance. */
@ -1215,7 +1215,7 @@ PyInstance_DoBinOp(v, w, opname, ropname, thisfunc)
PyObject *w; PyObject *w;
char *opname; char *opname;
char *ropname; char *ropname;
PyObject * (*thisfunc) Py_PROTO((PyObject *, PyObject *)); PyObject * (*thisfunc)(PyObject *, PyObject *);
{ {
char buf[256]; char buf[256];
PyObject *result = NULL; PyObject *result = NULL;
@ -1249,7 +1249,7 @@ halfbinop(v, w, opname, r_result, thisfunc, swapped)
PyObject *w; PyObject *w;
char *opname; char *opname;
PyObject **r_result; PyObject **r_result;
PyObject * (*thisfunc) Py_PROTO((PyObject *, PyObject *)); PyObject * (*thisfunc)(PyObject *, PyObject *);
int swapped; int swapped;
{ {
PyObject *func; PyObject *func;

View file

@ -15,20 +15,20 @@ redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.
/* Declarations for objects of type PyCObject */ /* Declarations for objects of type PyCObject */
typedef void (*destructor1) Py_PROTO((void *)); typedef void (*destructor1)(void *);
typedef void (*destructor2) Py_PROTO((void *, void*)); typedef void (*destructor2)(void *, void*);
typedef struct { typedef struct {
PyObject_HEAD PyObject_HEAD
void *cobject; void *cobject;
void *desc; void *desc;
void (*destructor) Py_PROTO((void *)); void (*destructor)(void *);
} PyCObject; } PyCObject;
PyObject * PyObject *
PyCObject_FromVoidPtr(cobj, destr) PyCObject_FromVoidPtr(cobj, destr)
void *cobj; void *cobj;
void (*destr) Py_PROTO((void *)); void (*destr)(void *);
{ {
PyCObject *self; PyCObject *self;
@ -45,7 +45,7 @@ PyObject *
PyCObject_FromVoidPtrAndDesc(cobj, desc, destr) PyCObject_FromVoidPtrAndDesc(cobj, desc, destr)
void *cobj; void *cobj;
void *desc; void *desc;
void (*destr) Py_PROTO((void *, void *)); void (*destr)(void *, void *);
{ {
PyCObject *self; PyCObject *self;

View file

@ -69,7 +69,7 @@ typedef struct {
FILE *f_fp; FILE *f_fp;
PyObject *f_name; PyObject *f_name;
PyObject *f_mode; PyObject *f_mode;
int (*f_close) Py_PROTO((FILE *)); int (*f_close)(FILE *);
int f_softspace; /* Flag used by 'print' command */ int f_softspace; /* Flag used by 'print' command */
int f_binary; /* Flag which indicates whether the file is open int f_binary; /* Flag which indicates whether the file is open
open in binary (1) or test (0) mode */ open in binary (1) or test (0) mode */
@ -100,7 +100,7 @@ PyFile_FromFile(fp, name, mode, close)
FILE *fp; FILE *fp;
char *name; char *name;
char *mode; char *mode;
int (*close) Py_FPROTO((FILE *)); int (*close)(FILE *);
{ {
PyFileObject *f = PyObject_NEW(PyFileObject, &PyFile_Type); PyFileObject *f = PyObject_NEW(PyFileObject, &PyFile_Type);
if (f == NULL) if (f == NULL)
@ -126,7 +126,7 @@ PyObject *
PyFile_FromString(name, mode) PyFile_FromString(name, mode)
char *name, *mode; char *name, *mode;
{ {
extern int fclose Py_PROTO((FILE *)); extern int fclose(FILE *);
PyFileObject *f; PyFileObject *f;
f = (PyFileObject *) PyFile_FromFile((FILE *)NULL, name, mode, fclose); f = (PyFileObject *) PyFile_FromFile((FILE *)NULL, name, mode, fclose);
if (f == NULL) if (f == NULL)

View file

@ -64,8 +64,8 @@ redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#endif #endif
#if !defined(__STDC__) && !defined(macintosh) #if !defined(__STDC__) && !defined(macintosh)
extern double fmod Py_PROTO((double, double)); extern double fmod(double, double);
extern double pow Py_PROTO((double, double)); extern double pow(double, double);
#endif #endif
#ifdef sun #ifdef sun
@ -137,7 +137,7 @@ PyFloat_FromString(v, pend)
PyObject *v; PyObject *v;
char **pend; char **pend;
{ {
extern double strtod Py_PROTO((const char *, char **)); extern double strtod(const char *, char **);
const char *s, *last, *end; const char *s, *last, *end;
double x; double x;
char buffer[256]; /* For errors */ char buffer[256]; /* For errors */

View file

@ -1001,7 +1001,7 @@ PyTypeObject *_Py_cobject_hack = &PyCObject_Type;
/* Hack to force loading of abstract.o */ /* Hack to force loading of abstract.o */
int (*_Py_abstract_hack) Py_FPROTO((PyObject *)) = &PyObject_Length; int (*_Py_abstract_hack)(PyObject *) = &PyObject_Length;
/* Python's malloc wrappers (see mymalloc.h) */ /* Python's malloc wrappers (see mymalloc.h) */

View file

@ -26,8 +26,8 @@ redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#include "parser.h" #include "parser.h"
/* Forward references */ /* Forward references */
static void fixdfa Py_PROTO((grammar *, dfa *)); static void fixdfa(grammar *, dfa *);
static void fixstate Py_PROTO((grammar *, state *)); static void fixstate(grammar *, state *);
void void
PyGrammar_AddAccelerators(g) PyGrammar_AddAccelerators(g)

View file

@ -17,7 +17,7 @@ redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.
extern int Py_DebugFlag; extern int Py_DebugFlag;
/* Forward */ /* Forward */
static void calcfirstset Py_PROTO((grammar *, dfa *)); static void calcfirstset(grammar *, dfa *);
void void
addfirstsets(g) addfirstsets(g)

View file

@ -142,7 +142,7 @@ findlabel(ll, type, str)
} }
/* Forward */ /* Forward */
static void translabel Py_PROTO((grammar *, label *)); static void translabel(grammar *, label *);
void void
translatelabels(g) translatelabels(g)

View file

@ -22,7 +22,7 @@ redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#include "intrcheck.h" #include "intrcheck.h"
/* Copied here from ceval.h -- can't include that file. */ /* Copied here from ceval.h -- can't include that file. */
int Py_AddPendingCall Py_PROTO((int (*func) Py_PROTO((ANY *)), ANY *arg)); int Py_AddPendingCall(int (*func)(ANY *), ANY *arg);
#ifdef QUICKWIN #ifdef QUICKWIN
@ -152,7 +152,7 @@ intcatcher(sig)
int sig; /* Not used by required by interface */ int sig; /* Not used by required by interface */
#endif /* _M_IX86 */ #endif /* _M_IX86 */
{ {
extern void Py_Exit Py_PROTO((int)); extern void Py_Exit(int);
static char message[] = static char message[] =
"python: to interrupt a truly hanging Python program, interrupt once more.\n"; "python: to interrupt a truly hanging Python program, interrupt once more.\n";
switch (interrupted++) { switch (interrupted++) {

View file

@ -15,8 +15,8 @@ redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#include "node.h" #include "node.h"
/* Forward */ /* Forward */
static void list1node Py_PROTO((FILE *, node *)); static void list1node(FILE *, node *);
static void listnode Py_PROTO((FILE *, node *)); static void listnode(FILE *, node *);
void void
PyNode_ListTree(n) PyNode_ListTree(n)

View file

@ -118,7 +118,7 @@ PyOS_StdioReadline(prompt)
Note: Python expects in return a buffer allocated with PyMem_Malloc. */ Note: Python expects in return a buffer allocated with PyMem_Malloc. */
char *(*PyOS_ReadlineFunctionPointer) Py_PROTO((char *)); char *(*PyOS_ReadlineFunctionPointer)(char *);
/* Interface used by tokenizer.c and bltinmodule.c */ /* Interface used by tokenizer.c and bltinmodule.c */

View file

@ -64,7 +64,7 @@ PyNode_AddChild(n1, type, str, lineno)
} }
/* Forward */ /* Forward */
static void freechildren Py_PROTO((node *)); static void freechildren(node *);
void void

View file

@ -33,7 +33,7 @@ extern int Py_DebugFlag;
/* STACK DATA TYPE */ /* STACK DATA TYPE */
static void s_reset Py_PROTO((stack *)); static void s_reset(stack *);
static void static void
s_reset(s) s_reset(s)
@ -44,7 +44,7 @@ s_reset(s)
#define s_empty(s) ((s)->s_top == &(s)->s_base[MAXSTACK]) #define s_empty(s) ((s)->s_top == &(s)->s_base[MAXSTACK])
static int s_push Py_PROTO((stack *, dfa *, node *)); static int s_push(stack *, dfa *, node *);
static int static int
s_push(s, d, parent) s_push(s, d, parent)
@ -66,7 +66,7 @@ s_push(s, d, parent)
#ifdef Py_DEBUG #ifdef Py_DEBUG
static void s_pop Py_PROTO((stack *)); static void s_pop(stack *);
static void static void
s_pop(s) s_pop(s)
@ -122,7 +122,7 @@ PyParser_Delete(ps)
/* PARSER STACK OPERATIONS */ /* PARSER STACK OPERATIONS */
static int shift Py_PROTO((stack *, int, char *, int, int)); static int shift(stack *, int, char *, int, int);
static int static int
shift(s, type, str, newstate, lineno) shift(s, type, str, newstate, lineno)
@ -141,7 +141,7 @@ shift(s, type, str, newstate, lineno)
return 0; return 0;
} }
static int push Py_PROTO((stack *, int, dfa *, int, int)); static int push(stack *, int, dfa *, int, int);
static int static int
push(s, type, d, newstate, lineno) push(s, type, d, newstate, lineno)
@ -165,7 +165,7 @@ push(s, type, d, newstate, lineno)
/* PARSER PROPER */ /* PARSER PROPER */
static int classify Py_PROTO((grammar *, int, char *)); static int classify(grammar *, int, char *);
static int static int
classify(g, type, str) classify(g, type, str)

View file

@ -36,11 +36,10 @@ typedef struct {
node *p_tree; /* Top of parse tree */ node *p_tree; /* Top of parse tree */
} parser_state; } parser_state;
parser_state *PyParser_New Py_PROTO((grammar *g, int start)); parser_state *PyParser_New(grammar *g, int start);
void PyParser_Delete Py_PROTO((parser_state *ps)); void PyParser_Delete(parser_state *ps);
int PyParser_AddToken int PyParser_AddToken(parser_state *ps, int type, char *str, int lineno);
Py_PROTO((parser_state *ps, int type, char *str, int lineno)); void PyGrammar_AddAccelerators(grammar *g);
void PyGrammar_AddAccelerators Py_PROTO((grammar *g));
#ifdef __cplusplus #ifdef __cplusplus
} }

View file

@ -22,8 +22,7 @@ int Py_TabcheckFlag;
/* Forward */ /* Forward */
static node *parsetok Py_PROTO((struct tok_state *, grammar *, int, static node *parsetok(struct tok_state *, grammar *, int, perrdetail *);
perrdetail *));
/* Parse input coming from a string. Return error code, print some errors. */ /* Parse input coming from a string. Return error code, print some errors. */

View file

@ -45,14 +45,14 @@ typedef struct _nfa {
} nfa; } nfa;
/* Forward */ /* Forward */
static void compile_rhs Py_PROTO((labellist *ll, static void compile_rhs(labellist *ll,
nfa *nf, node *n, int *pa, int *pb)); nfa *nf, node *n, int *pa, int *pb);
static void compile_alt Py_PROTO((labellist *ll, static void compile_alt(labellist *ll,
nfa *nf, node *n, int *pa, int *pb)); nfa *nf, node *n, int *pa, int *pb);
static void compile_item Py_PROTO((labellist *ll, static void compile_item(labellist *ll,
nfa *nf, node *n, int *pa, int *pb)); nfa *nf, node *n, int *pa, int *pb);
static void compile_atom Py_PROTO((labellist *ll, static void compile_atom(labellist *ll,
nfa *nf, node *n, int *pa, int *pb)); nfa *nf, node *n, int *pa, int *pb);
static int static int
addnfastate(nf) addnfastate(nf)
@ -111,7 +111,7 @@ typedef struct _nfagrammar {
} nfagrammar; } nfagrammar;
/* Forward */ /* Forward */
static void compile_rule Py_PROTO((nfagrammar *gr, node *n)); static void compile_rule(nfagrammar *gr, node *n);
static nfagrammar * static nfagrammar *
newnfagrammar() newnfagrammar()
@ -420,10 +420,10 @@ typedef struct _ss_dfa {
} ss_dfa; } ss_dfa;
/* Forward */ /* Forward */
static void printssdfa Py_PROTO((int xx_nstates, ss_state *xx_state, int nbits, static void printssdfa(int xx_nstates, ss_state *xx_state, int nbits,
labellist *ll, char *msg)); labellist *ll, char *msg);
static void simplify Py_PROTO((int xx_nstates, ss_state *xx_state)); static void simplify(int xx_nstates, ss_state *xx_state);
static void convert Py_PROTO((dfa *d, int xx_nstates, ss_state *xx_state)); static void convert(dfa *d, int xx_nstates, ss_state *xx_state);
static void static void
makedfa(gr, nf, d) makedfa(gr, nf, d)

View file

@ -16,10 +16,10 @@ redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.
/* Parser generator interface */ /* Parser generator interface */
extern grammar *meta_grammar Py_PROTO((void)); extern grammar *meta_grammar(void);
struct _node; struct _node;
extern grammar *pgen Py_PROTO((struct _node *)); extern grammar *pgen(struct _node *);
#ifdef __cplusplus #ifdef __cplusplus
} }

View file

@ -32,10 +32,10 @@ int Py_DebugFlag;
int Py_VerboseFlag; int Py_VerboseFlag;
/* Forward */ /* Forward */
grammar *getgrammar Py_PROTO((char *filename)); grammar *getgrammar(char *filename);
#ifdef THINK_C #ifdef THINK_C
int main Py_PROTO((int, char **)); int main(int, char **);
char *askfile Py_PROTO((void)); char *askfile(void);
#endif #endif
void void

View file

@ -14,10 +14,10 @@ redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#include "grammar.h" #include "grammar.h"
/* Forward */ /* Forward */
static void printarcs Py_PROTO((int, dfa *, FILE *)); static void printarcs(int, dfa *, FILE *);
static void printstates Py_PROTO((grammar *, FILE *)); static void printstates(grammar *, FILE *);
static void printdfas Py_PROTO((grammar *, FILE *)); static void printdfas(grammar *, FILE *);
static void printlabels Py_PROTO((grammar *, FILE *)); static void printlabels(grammar *, FILE *);
void void
printgrammar(g, fp) printgrammar(g, fp)

View file

@ -17,7 +17,7 @@ redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#include "tokenizer.h" #include "tokenizer.h"
#include "errcode.h" #include "errcode.h"
extern char *PyOS_Readline Py_PROTO((char *)); extern char *PyOS_Readline(char *);
/* Return malloc'ed string including trailing \n; /* Return malloc'ed string including trailing \n;
empty malloc'ed string for EOF; empty malloc'ed string for EOF;
NULL if interrupted */ NULL if interrupted */
@ -34,9 +34,9 @@ extern char *PyOS_Readline Py_PROTO((char *));
#endif #endif
/* Forward */ /* Forward */
static struct tok_state *tok_new Py_PROTO((void)); static struct tok_state *tok_new(void);
static int tok_nextc Py_PROTO((struct tok_state *tok)); static int tok_nextc(struct tok_state *tok);
static void tok_backup Py_PROTO((struct tok_state *tok, int c)); static void tok_backup(struct tok_state *tok, int c);
/* Token names */ /* Token names */

View file

@ -49,11 +49,10 @@ struct tok_state {
int altindstack[MAXINDENT]; /* Stack of alternate indents */ int altindstack[MAXINDENT]; /* Stack of alternate indents */
}; };
extern struct tok_state *PyTokenizer_FromString Py_PROTO((char *)); extern struct tok_state *PyTokenizer_FromString(char *);
extern struct tok_state *PyTokenizer_FromFile extern struct tok_state *PyTokenizer_FromFile(FILE *, char *, char *);
Py_PROTO((FILE *, char *, char *)); extern void PyTokenizer_Free(struct tok_state *);
extern void PyTokenizer_Free Py_PROTO((struct tok_state *)); extern int PyTokenizer_Get(struct tok_state *, char **, char **);
extern int PyTokenizer_Get Py_PROTO((struct tok_state *, char **, char **));
#ifdef __cplusplus #ifdef __cplusplus
} }

View file

@ -28,8 +28,8 @@ redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#endif #endif
/* Forward */ /* Forward */
static PyObject *filterstring Py_PROTO((PyObject *, PyObject *)); static PyObject *filterstring(PyObject *, PyObject *);
static PyObject *filtertuple Py_PROTO((PyObject *, PyObject *)); static PyObject *filtertuple (PyObject *, PyObject *);
static PyObject * static PyObject *
builtin___import__(self, args) builtin___import__(self, args)
@ -428,7 +428,7 @@ static PyObject *
complex_from_string(v) complex_from_string(v)
PyObject *v; PyObject *v;
{ {
extern double strtod Py_PROTO((const char *, char **)); extern double strtod(const char *, char **);
const char *s, *start; const char *s, *start;
char *end; char *end;
double x=0.0, y=0.0, z; double x=0.0, y=0.0, z;
@ -1225,7 +1225,7 @@ static char hex_doc[] =
Return the hexadecimal representation of an integer or long integer."; Return the hexadecimal representation of an integer or long integer.";
static PyObject *builtin_raw_input Py_PROTO((PyObject *, PyObject *)); static PyObject *builtin_raw_input(PyObject *, PyObject *);
static PyObject * static PyObject *
builtin_input(self, args) builtin_input(self, args)

View file

@ -43,34 +43,32 @@ redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.
/* Forward declarations */ /* Forward declarations */
static PyObject *eval_code2 Py_PROTO((PyCodeObject *, static PyObject *eval_code2(PyCodeObject *,
PyObject *, PyObject *, PyObject *, PyObject *,
PyObject **, int, PyObject **, int,
PyObject **, int, PyObject **, int,
PyObject **, int, PyObject **, int,
PyObject *)); PyObject *);
#ifdef LLTRACE #ifdef LLTRACE
static int prtrace Py_PROTO((PyObject *, char *)); static int prtrace(PyObject *, char *);
#endif #endif
static void call_exc_trace Py_PROTO((PyObject **, PyObject**, static void call_exc_trace(PyObject **, PyObject**, PyFrameObject *);
PyFrameObject *)); static int call_trace(PyObject **, PyObject **,
static int call_trace Py_PROTO((PyObject **, PyObject **, PyFrameObject *, char *, PyObject *);
PyFrameObject *, char *, PyObject *)); static PyObject *call_builtin(PyObject *, PyObject *, PyObject *);
static PyObject *call_builtin Py_PROTO((PyObject *, PyObject *, PyObject *)); static PyObject *call_function(PyObject *, PyObject *, PyObject *);
static PyObject *call_function Py_PROTO((PyObject *, PyObject *, PyObject *)); static PyObject *loop_subscript(PyObject *, PyObject *);
static PyObject *loop_subscript Py_PROTO((PyObject *, PyObject *)); static PyObject *apply_slice(PyObject *, PyObject *, PyObject *);
static PyObject *apply_slice Py_PROTO((PyObject *, PyObject *, PyObject *)); static int assign_slice(PyObject *, PyObject *,
static int assign_slice Py_PROTO((PyObject *, PyObject *, PyObject *, PyObject *);
PyObject *, PyObject *)); static PyObject *cmp_outcome(int, PyObject *, PyObject *);
static PyObject *cmp_outcome Py_PROTO((int, PyObject *, PyObject *)); static int import_from(PyObject *, PyObject *, PyObject *);
static int import_from Py_PROTO((PyObject *, PyObject *, PyObject *)); static PyObject *build_class(PyObject *, PyObject *, PyObject *);
static PyObject *build_class Py_PROTO((PyObject *, PyObject *, PyObject *)); static int exec_statement(PyFrameObject *,
static int exec_statement Py_PROTO((PyFrameObject *, PyObject *, PyObject *, PyObject *);
PyObject *, PyObject *, PyObject *)); static PyObject *find_from_args(PyFrameObject *, int);
static PyObject *find_from_args Py_PROTO((PyFrameObject *, int)); static void set_exc_info(PyThreadState *, PyObject *, PyObject *, PyObject *);
static void set_exc_info Py_PROTO((PyThreadState *, static void reset_exc_info(PyThreadState *);
PyObject *, PyObject *, PyObject *));
static void reset_exc_info Py_PROTO((PyThreadState *));
/* Dynamic execution profile */ /* Dynamic execution profile */
@ -211,7 +209,7 @@ PyEval_RestoreThread(tstate)
#define NPENDINGCALLS 32 #define NPENDINGCALLS 32
static struct { static struct {
int (*func) Py_PROTO((ANY *)); int (*func)(ANY *);
ANY *arg; ANY *arg;
} pendingcalls[NPENDINGCALLS]; } pendingcalls[NPENDINGCALLS];
static volatile int pendingfirst = 0; static volatile int pendingfirst = 0;
@ -220,7 +218,7 @@ static volatile int things_to_do = 0;
int int
Py_AddPendingCall(func, arg) Py_AddPendingCall(func, arg)
int (*func) Py_PROTO((ANY *)); int (*func)(ANY *);
ANY *arg; ANY *arg;
{ {
static int busy = 0; static int busy = 0;
@ -258,7 +256,7 @@ Py_MakePendingCalls()
things_to_do = 0; things_to_do = 0;
for (;;) { for (;;) {
int i; int i;
int (*func) Py_PROTO((ANY *)); int (*func)(ANY *);
ANY *arg; ANY *arg;
i = pendingfirst; i = pendingfirst;
if (i == pendinglast) if (i == pendinglast)
@ -287,8 +285,8 @@ enum why_code {
WHY_BREAK /* 'break' statement */ WHY_BREAK /* 'break' statement */
}; };
static enum why_code do_raise Py_PROTO((PyObject *, PyObject *, PyObject *)); static enum why_code do_raise(PyObject *, PyObject *, PyObject *);
static int unpack_sequence Py_PROTO((PyObject *, int, PyObject **)); static int unpack_sequence(PyObject *, int, PyObject **);
PyObject * PyObject *

View file

@ -375,30 +375,30 @@ block_pop(c, type)
/* Prototype forward declarations */ /* Prototype forward declarations */
static int com_init Py_PROTO((struct compiling *, char *)); static int com_init(struct compiling *, char *);
static void com_free Py_PROTO((struct compiling *)); static void com_free(struct compiling *);
static void com_push Py_PROTO((struct compiling *, int)); static void com_push(struct compiling *, int);
static void com_pop Py_PROTO((struct compiling *, int)); static void com_pop(struct compiling *, int);
static void com_done Py_PROTO((struct compiling *)); static void com_done(struct compiling *);
static void com_node Py_PROTO((struct compiling *, struct _node *)); static void com_node(struct compiling *, struct _node *);
static void com_factor Py_PROTO((struct compiling *, struct _node *)); static void com_factor(struct compiling *, struct _node *);
static void com_addbyte Py_PROTO((struct compiling *, int)); static void com_addbyte(struct compiling *, int);
static void com_addint Py_PROTO((struct compiling *, int)); static void com_addint(struct compiling *, int);
static void com_addoparg Py_PROTO((struct compiling *, int, int)); static void com_addoparg(struct compiling *, int, int);
static void com_addfwref Py_PROTO((struct compiling *, int, int *)); static void com_addfwref(struct compiling *, int, int *);
static void com_backpatch Py_PROTO((struct compiling *, int)); static void com_backpatch(struct compiling *, int);
static int com_add Py_PROTO((struct compiling *, PyObject *, PyObject *, PyObject *)); static int com_add(struct compiling *, PyObject *, PyObject *, PyObject *);
static int com_addconst Py_PROTO((struct compiling *, PyObject *)); static int com_addconst(struct compiling *, PyObject *);
static int com_addname Py_PROTO((struct compiling *, PyObject *)); static int com_addname(struct compiling *, PyObject *);
static void com_addopname Py_PROTO((struct compiling *, int, node *)); static void com_addopname(struct compiling *, int, node *);
static void com_list Py_PROTO((struct compiling *, node *, int)); static void com_list(struct compiling *, node *, int);
static int com_argdefs Py_PROTO((struct compiling *, node *)); static int com_argdefs(struct compiling *, node *);
static int com_newlocal Py_PROTO((struct compiling *, char *)); static int com_newlocal(struct compiling *, char *);
static PyCodeObject *icompile Py_PROTO((struct _node *, struct compiling *)); static PyCodeObject *icompile(struct _node *, struct compiling *);
static PyCodeObject *jcompile Py_PROTO((struct _node *, char *, static PyCodeObject *jcompile(struct _node *, char *,
struct compiling *)); struct compiling *);
static PyObject *parsestrplus Py_PROTO((node *)); static PyObject *parsestrplus(node *);
static PyObject *parsestr Py_PROTO((char *)); static PyObject *parsestr(char *);
static int static int
com_init(c, filename) com_init(c, filename)
@ -813,7 +813,7 @@ parsenumber(co, s)
struct compiling *co; struct compiling *co;
char *s; char *s;
{ {
extern double atof Py_PROTO((const char *)); extern double atof(const char *);
char *end; char *end;
long x; long x;
double dx; double dx;
@ -1823,8 +1823,8 @@ com_list(c, n, toplevel)
/* Begin of assignment compilation */ /* Begin of assignment compilation */
static void com_assign_name Py_PROTO((struct compiling *, node *, int)); static void com_assign_name(struct compiling *, node *, int);
static void com_assign Py_PROTO((struct compiling *, node *, int)); static void com_assign(struct compiling *, node *, int);
static void static void
com_assign_attr(c, n, assigning) com_assign_attr(c, n, assigning)
@ -2013,7 +2013,7 @@ com_assign(c, n, assigning)
} }
} }
/* Forward */ static node *get_rawdocstring Py_PROTO((node *)); /* Forward */ static node *get_rawdocstring(node *);
static void static void
com_expr_stmt(c, n) com_expr_stmt(c, n)
@ -3041,7 +3041,7 @@ com_node(c, n)
} }
} }
static void com_fplist Py_PROTO((struct compiling *, node *)); static void com_fplist(struct compiling *, node *);
static void static void
com_fpdef(c, n) com_fpdef(c, n)

View file

@ -17,14 +17,14 @@ redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#endif #endif
#ifdef macintosh #ifdef macintosh
extern char *PyMac_StrError Py_PROTO((int)); extern char *PyMac_StrError(int);
#undef strerror #undef strerror
#define strerror PyMac_StrError #define strerror PyMac_StrError
#endif /* macintosh */ #endif /* macintosh */
#ifndef __STDC__ #ifndef __STDC__
#ifndef MS_WINDOWS #ifndef MS_WINDOWS
extern char *strerror Py_PROTO((int)); extern char *strerror(int);
#endif #endif
#endif #endif

View file

@ -23,26 +23,25 @@ redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#endif #endif
int PyArg_Parse Py_PROTO((PyObject *, char *, ...)); int PyArg_Parse(PyObject *, char *, ...);
int PyArg_ParseTuple Py_PROTO((PyObject *, char *, ...)); int PyArg_ParseTuple(PyObject *, char *, ...);
int PyArg_VaParse Py_PROTO((PyObject *, char *, va_list)); int PyArg_VaParse(PyObject *, char *, va_list);
int PyArg_ParseTupleAndKeywords Py_PROTO((PyObject *, PyObject *, int PyArg_ParseTupleAndKeywords(PyObject *, PyObject *,
char *, char **, ...)); char *, char **, ...);
/* Forward */ /* Forward */
static int vgetargs1 Py_PROTO((PyObject *, char *, va_list *, int)); static int vgetargs1(PyObject *, char *, va_list *, int);
static void seterror Py_PROTO((int, char *, int *, char *, char *)); static void seterror(int, char *, int *, char *, char *);
static char *convertitem Py_PROTO((PyObject *, char **, va_list *, static char *convertitem(PyObject *, char **, va_list *, int *, char *);
int *, char *)); static char *converttuple(PyObject *, char **, va_list *,
static char *converttuple Py_PROTO((PyObject *, char **, va_list *, int *, char *, int);
int *, char *, int)); static char *convertsimple(PyObject *, char **, va_list *, char *);
static char *convertsimple Py_PROTO((PyObject *, char **, va_list *, char *)); static char *convertsimple1(PyObject *, char **, va_list *);
static char *convertsimple1 Py_PROTO((PyObject *, char **, va_list *));
static int vgetargskeywords Py_PROTO((PyObject *, PyObject *, static int vgetargskeywords(PyObject *, PyObject *,
char *, char **, va_list *)); char *, char **, va_list *);
static char *skipitem Py_PROTO((char **, va_list *)); static char *skipitem(char **, va_list *);
#ifdef HAVE_STDARG_PROTOTYPES #ifdef HAVE_STDARG_PROTOTYPES
/* VARARGS2 */ /* VARARGS2 */
@ -886,8 +885,7 @@ convertsimple1(arg, p_format, p_va)
} }
else if (*format == '&') { else if (*format == '&') {
typedef int (*converter) typedef int (*converter)(PyObject *, void *);
Py_PROTO((PyObject *, void *));
converter convert = va_arg(*p_va, converter); converter convert = va_arg(*p_va, converter);
void *addr = va_arg(*p_va, void *); void *addr = va_arg(*p_va, void *);
format++; format++;
@ -1323,8 +1321,7 @@ skipitem(p_format, p_va)
} }
#endif #endif
else if (*format == '&') { else if (*format == '&') {
typedef int (*converter) typedef int (*converter)(PyObject *, void *);
Py_PROTO((PyObject *, void *));
(void) va_arg(*p_va, converter); (void) va_arg(*p_va, converter);
(void) va_arg(*p_va, void *); (void) va_arg(*p_va, void *);
format++; format++;

View file

@ -763,10 +763,10 @@ load_source_module(name, pathname, fp)
/* Forward */ /* Forward */
static PyObject *load_module Py_PROTO((char *, FILE *, char *, int)); static PyObject *load_module(char *, FILE *, char *, int);
static struct filedescr *find_module Py_PROTO((char *, PyObject *, static struct filedescr *find_module(char *, PyObject *,
char *, size_t, FILE **)); char *, size_t, FILE **);
static struct _frozen *find_frozen Py_PROTO((char *name)); static struct _frozen *find_frozen(char *name);
/* Load a package and return its module object WITH INCREMENTED /* Load a package and return its module object WITH INCREMENTED
REFERENCE COUNT */ REFERENCE COUNT */
@ -855,7 +855,7 @@ extern FILE *PyWin_FindRegisteredModule();
static int check_case(char *, int, int, char *); static int check_case(char *, int, int, char *);
#endif #endif
static int find_init_module Py_PROTO((char *)); /* Forward */ static int find_init_module(char *); /* Forward */
static struct filedescr * static struct filedescr *
find_module(realname, path, buf, buflen, p_fp) find_module(realname, path, buf, buflen, p_fp)
@ -1206,7 +1206,7 @@ find_init_module(buf)
#endif /* HAVE_STAT */ #endif /* HAVE_STAT */
static int init_builtin Py_PROTO((char *)); /* Forward */ static int init_builtin(char *); /* Forward */
/* Load an external module using the default search path and return /* Load an external module using the default search path and return
its module object WITH INCREMENTED REFERENCE COUNT */ its module object WITH INCREMENTED REFERENCE COUNT */
@ -1455,15 +1455,13 @@ PyImport_ImportModule(name)
} }
/* Forward declarations for helper routines */ /* Forward declarations for helper routines */
static PyObject *get_parent Py_PROTO((PyObject *globals, static PyObject *get_parent(PyObject *globals, char *buf, int *p_buflen);
char *buf, int *p_buflen)); static PyObject *load_next(PyObject *mod, PyObject *altmod,
static PyObject *load_next Py_PROTO((PyObject *mod, PyObject *altmod, char **p_name, char *buf, int *p_buflen);
char **p_name, char *buf, int *p_buflen)); static int mark_miss(char *name);
static int mark_miss Py_PROTO((char *name)); static int ensure_fromlist(PyObject *mod, PyObject *fromlist,
static int ensure_fromlist Py_PROTO((PyObject *mod, PyObject *fromlist, char *buf, int buflen, int recursive);
char *buf, int buflen, int recursive)); static PyObject * import_submodule(PyObject *mod, char *name, char *fullname);
static PyObject * import_submodule Py_PROTO((PyObject *mod,
char *name, char *fullname));
/* The Magnum Opus of dotted-name import :-) */ /* The Magnum Opus of dotted-name import :-) */
@ -2006,7 +2004,7 @@ call_find_module(name, path)
char *name; char *name;
PyObject *path; /* list or None or NULL */ PyObject *path; /* list or None or NULL */
{ {
extern int fclose Py_PROTO((FILE *)); extern int fclose(FILE *);
PyObject *fob, *ret; PyObject *fob, *ret;
struct filedescr *fdp; struct filedescr *fdp;
char pathname[MAXPATHLEN+1]; char pathname[MAXPATHLEN+1];

View file

@ -36,8 +36,8 @@ struct filedescr {
extern struct filedescr * _PyImport_Filetab; extern struct filedescr * _PyImport_Filetab;
extern const struct filedescr _PyImport_DynLoadFiletab[]; extern const struct filedescr _PyImport_DynLoadFiletab[];
extern PyObject *_PyImport_LoadDynamicModule extern PyObject *_PyImport_LoadDynamicModule(char *name, char *pathname,
Py_PROTO((char *name, char *pathname, FILE *)); FILE *);
/* Max length of module suffix searched for -- accommodates "module.slb" */ /* Max length of module suffix searched for -- accommodates "module.slb" */
#define MAXSUFFIXSIZE 12 #define MAXSUFFIXSIZE 12

View file

@ -171,8 +171,7 @@ w_object(v, p)
w_short(ob->ob_digit[i], p); w_short(ob->ob_digit[i], p);
} }
else if (PyFloat_Check(v)) { else if (PyFloat_Check(v)) {
extern void PyFloat_AsString extern void PyFloat_AsString(char *, PyFloatObject *);
Py_PROTO((char *, PyFloatObject *));
char buf[256]; /* Plenty to format any double */ char buf[256]; /* Plenty to format any double */
PyFloat_AsString(buf, (PyFloatObject *)v); PyFloat_AsString(buf, (PyFloatObject *)v);
n = strlen(buf); n = strlen(buf);
@ -182,8 +181,7 @@ w_object(v, p)
} }
#ifndef WITHOUT_COMPLEX #ifndef WITHOUT_COMPLEX
else if (PyComplex_Check(v)) { else if (PyComplex_Check(v)) {
extern void PyFloat_AsString extern void PyFloat_AsString(char *, PyFloatObject *);
Py_PROTO((char *, PyFloatObject *));
char buf[256]; /* Plenty to format any double */ char buf[256]; /* Plenty to format any double */
PyFloatObject *temp; PyFloatObject *temp;
w_byte(TYPE_COMPLEX, p); w_byte(TYPE_COMPLEX, p);
@ -438,7 +436,7 @@ r_object(p)
case TYPE_FLOAT: case TYPE_FLOAT:
{ {
extern double atof Py_PROTO((const char *)); extern double atof(const char *);
char buf[256]; char buf[256];
double dx; double dx;
n = r_byte(p); n = r_byte(p);
@ -457,7 +455,7 @@ r_object(p)
#ifndef WITHOUT_COMPLEX #ifndef WITHOUT_COMPLEX
case TYPE_COMPLEX: case TYPE_COMPLEX:
{ {
extern double atof Py_PROTO((const char *)); extern double atof(const char *);
char buf[256]; char buf[256];
Py_complex c; Py_complex c;
n = r_byte(p); n = r_byte(p);

View file

@ -84,7 +84,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 Py_PROTO((char *format, int endchar)); static int countformat(char *format, int endchar);
static int countformat(format, endchar) static int countformat(format, endchar)
char *format; char *format;
int endchar; int endchar;
@ -130,10 +130,10 @@ static int countformat(format, endchar)
/* Generic function to create a value -- the inverse of getargs() */ /* Generic function to create a value -- the inverse of getargs() */
/* After an original idea and first implementation by Steven Miale */ /* After an original idea and first implementation by Steven Miale */
static PyObject *do_mktuple Py_PROTO((char**, va_list *, int, int)); static PyObject *do_mktuple(char**, va_list *, int, int);
static PyObject *do_mklist Py_PROTO((char**, va_list *, int, int)); static PyObject *do_mklist(char**, va_list *, int, int);
static PyObject *do_mkdict Py_PROTO((char**, va_list *, int, int)); static PyObject *do_mkdict(char**, va_list *, int, int);
static PyObject *do_mkvalue Py_PROTO((char**, va_list *)); static PyObject *do_mkvalue(char**, va_list *);
static PyObject * static PyObject *
@ -358,7 +358,7 @@ do_mkvalue(p_format, p_va)
case 'S': case 'S':
case 'O': case 'O':
if (**p_format == '&') { if (**p_format == '&') {
typedef PyObject *(*converter) Py_PROTO((void *)); typedef PyObject *(*converter)(void *);
converter func = va_arg(*p_va, converter); converter func = va_arg(*p_va, converter);
void *arg = va_arg(*p_va, void *); void *arg = va_arg(*p_va, void *);
++*p_format; ++*p_format;

View file

@ -38,18 +38,18 @@ extern char *Py_GetPath();
extern grammar _PyParser_Grammar; /* From graminit.c */ extern grammar _PyParser_Grammar; /* From graminit.c */
/* Forward */ /* Forward */
static void initmain Py_PROTO((void)); static void initmain(void);
static void initsite Py_PROTO((void)); static void initsite(void);
static PyObject *run_err_node Py_PROTO((node *n, char *filename, static PyObject *run_err_node(node *n, char *filename,
PyObject *globals, PyObject *locals)); PyObject *globals, PyObject *locals);
static PyObject *run_node Py_PROTO((node *n, char *filename, static PyObject *run_node(node *n, char *filename,
PyObject *globals, PyObject *locals)); PyObject *globals, PyObject *locals);
static PyObject *run_pyc_file Py_PROTO((FILE *fp, char *filename, static PyObject *run_pyc_file(FILE *fp, char *filename,
PyObject *globals, PyObject *locals)); PyObject *globals, PyObject *locals);
static void err_input Py_PROTO((perrdetail *)); static void err_input(perrdetail *);
static void initsigs Py_PROTO((void)); static void initsigs(void);
static void call_sys_exitfunc Py_PROTO((void)); static void call_sys_exitfunc(void);
static void call_ll_exitfuncs Py_PROTO((void)); static void call_ll_exitfuncs(void);
#ifdef Py_TRACE_REFS #ifdef Py_TRACE_REFS
int _Py_AskYesNo(char *prompt); int _Py_AskYesNo(char *prompt);
@ -163,7 +163,7 @@ Py_Initialize()
} }
#ifdef COUNT_ALLOCS #ifdef COUNT_ALLOCS
extern void dump_counts Py_PROTO((void)); extern void dump_counts(void);
#endif #endif
/* Undo the effect of Py_Initialize(). /* Undo the effect of Py_Initialize().
@ -1059,7 +1059,7 @@ static void (*exitfuncs[NEXITFUNCS])();
static int nexitfuncs = 0; static int nexitfuncs = 0;
int Py_AtExit(func) int Py_AtExit(func)
void (*func) Py_PROTO((void)); void (*func)(void);
{ {
if (nexitfuncs >= NEXITFUNCS) if (nexitfuncs >= NEXITFUNCS)
return -1; return -1;

View file

@ -270,7 +270,7 @@ static PyObject *
sys_getcounts(self, args) sys_getcounts(self, args)
PyObject *self, *args; PyObject *self, *args;
{ {
extern PyObject *get_counts Py_PROTO((void)); extern PyObject *get_counts(void);
if (!PyArg_ParseTuple(args, ":getcounts")) if (!PyArg_ParseTuple(args, ":getcounts"))
return NULL; return NULL;
@ -280,12 +280,12 @@ sys_getcounts(self, args)
#ifdef Py_TRACE_REFS #ifdef Py_TRACE_REFS
/* Defined in objects.c because it uses static globals if that file */ /* Defined in objects.c because it uses static globals if that file */
extern PyObject *_Py_GetObjects Py_PROTO((PyObject *, PyObject *)); extern PyObject *_Py_GetObjects(PyObject *, PyObject *);
#endif #endif
#ifdef DYNAMIC_EXECUTION_PROFILE #ifdef DYNAMIC_EXECUTION_PROFILE
/* Defined in ceval.c because it uses static globals if that file */ /* Defined in ceval.c because it uses static globals if that file */
extern PyObject *_Py_GetDXProfile Py_PROTO((PyObject *, PyObject *)); extern PyObject *_Py_GetDXProfile(PyObject *, PyObject *);
#endif #endif
static PyMethodDef sys_methods[] = { static PyMethodDef sys_methods[] = {
@ -409,7 +409,7 @@ settrace() -- set the global debug tracing function\n\
PyObject * PyObject *
_PySys_Init() _PySys_Init()
{ {
extern int fclose Py_PROTO((FILE *)); extern int fclose(FILE *);
PyObject *m, *v, *sysdict; PyObject *m, *v, *sysdict;
PyObject *sysin, *sysout, *syserr; PyObject *sysin, *sysout, *syserr;
char *s; char *s;

View file

@ -22,7 +22,7 @@ main(argc, argv)
int argc; int argc;
char **argv; char **argv;
{ {
extern int Py_FrozenMain Py_PROTO((int, char **)); extern int Py_FrozenMain(int, char **);
""" + ((not __debug__ and """ """ + ((not __debug__ and """
Py_OptimizeFlag++; Py_OptimizeFlag++;
""") or "") + """ """) or "") + """