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

Skip to content

Commit dbd9ba6

Browse files
committed
Nuke all remaining occurrences of Py_PROTO and Py_FPROTO.
1 parent 4be47c0 commit dbd9ba6

53 files changed

Lines changed: 296 additions & 304 deletions

Some content is hidden

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

Include/cStringIO.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -76,22 +76,22 @@
7676
static struct PycStringIO_CAPI {
7777

7878
/* Read a string. If the last argument is -1, the remainder will be read. */
79-
int(*cread) Py_FPROTO((PyObject *, char **, int));
79+
int(*cread)(PyObject *, char **, int);
8080

8181
/* Read a line */
82-
int(*creadline) Py_FPROTO((PyObject *, char **));
82+
int(*creadline)(PyObject *, char **);
8383

8484
/* Write a string */
85-
int(*cwrite) Py_FPROTO((PyObject *, char *, int));
85+
int(*cwrite)(PyObject *, char *, int);
8686

8787
/* Get the cStringIO object as a Python string */
88-
PyObject *(*cgetvalue) Py_FPROTO((PyObject *));
88+
PyObject *(*cgetvalue)(PyObject *);
8989

9090
/* Create a new output object */
91-
PyObject *(*NewOutput) Py_FPROTO((int));
91+
PyObject *(*NewOutput)(int);
9292

9393
/* Create an input object from a Python string */
94-
PyObject *(*NewInput) Py_FPROTO((PyObject *));
94+
PyObject *(*NewInput)(PyObject *);
9595

9696
/* The Python types for cStringIO input and output objects.
9797
Note that you can do input on an output object.

Include/methodobject.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ extern DL_IMPORT(PyTypeObject) PyCFunction_Type;
2020

2121
#define PyCFunction_Check(op) ((op)->ob_type == &PyCFunction_Type)
2222

23-
typedef PyObject *(*PyCFunction) Py_FPROTO((PyObject *, PyObject *));
24-
typedef PyObject *(*PyCFunctionWithKeywords)
25-
Py_FPROTO((PyObject *, PyObject *, PyObject *));
23+
typedef PyObject *(*PyCFunction)(PyObject *, PyObject *);
24+
typedef PyObject *(*PyCFunctionWithKeywords)(PyObject *, PyObject *,
25+
PyObject *);
2626

2727
extern DL_IMPORT(PyCFunction) PyCFunction_GetFunction(PyObject *);
2828
extern DL_IMPORT(PyObject *) PyCFunction_GetSelf(PyObject *);

Include/mymalloc.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,9 @@ extern "C" {
9090
#ifndef PyCore_MALLOC_PROTO
9191
#undef PyCore_REALLOC_PROTO
9292
#undef PyCore_FREE_PROTO
93-
#define PyCore_MALLOC_PROTO Py_PROTO((size_t))
94-
#define PyCore_REALLOC_PROTO Py_PROTO((ANY *, size_t))
95-
#define PyCore_FREE_PROTO Py_PROTO((ANY *))
93+
#define PyCore_MALLOC_PROTO (size_t)
94+
#define PyCore_REALLOC_PROTO (ANY *, size_t)
95+
#define PyCore_FREE_PROTO (ANY *)
9696
#endif
9797

9898
#ifdef NEED_TO_DECLARE_MALLOC_AND_FRIEND
@@ -138,9 +138,9 @@ extern void PyCore_FREE_FUNC PyCore_FREE_PROTO;
138138
returns a non-NULL pointer, even if the underlying malloc
139139
doesn't. Returned pointers must be checked for NULL explicitly.
140140
No action is performed on failure. */
141-
extern DL_IMPORT(ANY *) PyMem_Malloc Py_PROTO((size_t));
142-
extern DL_IMPORT(ANY *) PyMem_Realloc Py_PROTO((ANY *, size_t));
143-
extern DL_IMPORT(void) PyMem_Free Py_PROTO((ANY *));
141+
extern DL_IMPORT(ANY *) PyMem_Malloc(size_t);
142+
extern DL_IMPORT(ANY *) PyMem_Realloc(ANY *, size_t);
143+
extern DL_IMPORT(void) PyMem_Free(ANY *);
144144

145145
/* Starting from Python 1.6, the wrappers Py_{Malloc,Realloc,Free} are
146146
no longer supported. They used to call PyErr_NoMemory() on failure. */
@@ -198,7 +198,7 @@ extern DL_IMPORT(void) PyMem_Free Py_PROTO((ANY *));
198198
199199
#define PyCore_MALLOC_FUNC d_malloc
200200
...
201-
#define PyCore_MALLOC_PROTO Py_PROTO((size_t, char *, unsigned long))
201+
#define PyCore_MALLOC_PROTO (size_t, char *, unsigned long)
202202
...
203203
#define NEED_TO_DECLARE_MALLOC_AND_FRIEND
204204

Include/mymath.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
#endif
1111

1212
#ifndef HAVE_HYPOT
13-
extern double hypot Py_PROTO((double, double));
13+
extern double hypot(double, double);
1414
#ifdef MWERKS_BEFORE_PRO4
1515
#define hypot we_dont_want_faulty_hypot_decl
1616
#endif

Include/myproto.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@ See the file "Misc/COPYRIGHT" for information on usage and
1414
redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.
1515
******************************************************************/
1616

17+
/***************************************
18+
THIS FILE IS OBSOLETE
19+
DON'T USE Py_PROTO or Py_FPROTO anymore.
20+
***************************************/
21+
1722
#ifdef HAVE_PROTOTYPES
1823
#define Py_PROTO(x) x
1924
#else

Modules/arraymodule.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ struct arrayobject; /* Forward */
3131
struct arraydescr {
3232
int typecode;
3333
int itemsize;
34-
PyObject * (*getitem) Py_FPROTO((struct arrayobject *, int));
35-
int (*setitem) Py_FPROTO((struct arrayobject *, int, PyObject *));
34+
PyObject * (*getitem)(struct arrayobject *, int);
35+
int (*setitem)(struct arrayobject *, int, PyObject *);
3636
};
3737

3838
typedef struct arrayobject {
@@ -46,15 +46,15 @@ staticforward PyTypeObject Arraytype;
4646
#define is_arrayobject(op) ((op)->ob_type == &Arraytype)
4747

4848
/* Forward */
49-
static PyObject *newarrayobject Py_PROTO((int, struct arraydescr *));
49+
static PyObject *newarrayobject(int, struct arraydescr *);
5050
#if 0
51-
static int getarraysize Py_PROTO((PyObject *));
51+
static int getarraysize(PyObject *);
5252
#endif
53-
static PyObject *getarrayitem Py_PROTO((PyObject *, int));
54-
static int setarrayitem Py_PROTO((PyObject *, int, PyObject *));
53+
static PyObject *getarrayitem(PyObject *, int);
54+
static int setarrayitem(PyObject *, int, PyObject *);
5555
#if 0
56-
static int insarrayitem Py_PROTO((PyObject *, int, PyObject *));
57-
static int addarrayitem Py_PROTO((PyObject *, PyObject *));
56+
static int insarrayitem(PyObject *, int, PyObject *);
57+
static int addarrayitem(PyObject *, PyObject *);
5858
#endif
5959

6060
static PyObject *

Modules/cgensupport.h

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -38,34 +38,34 @@ typedef char *string;
3838
#define getishortarraysize PyArg_GetShortArraySize
3939
#define getistringarg PyArg_GetString
4040

41-
extern int PyArg_GetObject Py_PROTO((PyObject *args, int nargs,
42-
int i, PyObject **p_a));
43-
extern int PyArg_GetLong Py_PROTO((PyObject *args, int nargs,
44-
int i, long *p_a));
45-
extern int PyArg_GetShort Py_PROTO((PyObject *args, int nargs,
46-
int i, short *p_a));
47-
extern int PyArg_GetFloat Py_PROTO((PyObject *args, int nargs,
48-
int i, float *p_a));
49-
extern int PyArg_GetString Py_PROTO((PyObject *args, int nargs,
50-
int i, string *p_a));
51-
extern int PyArg_GetChar Py_PROTO((PyObject *args, int nargs,
52-
int i, char *p_a));
53-
extern int PyArg_GetLongArray Py_PROTO((PyObject *args, int nargs,
54-
int i, int n, long *p_a));
55-
extern int PyArg_GetShortArray Py_PROTO((PyObject *args, int nargs,
56-
int i, int n, short *p_a));
57-
extern int PyArg_GetDoubleArray Py_PROTO((PyObject *args, int nargs,
58-
int i, int n, double *p_a));
59-
extern int PyArg_GetFloatArray Py_PROTO((PyObject *args, int nargs,
60-
int i, int n, float *p_a));
61-
extern int PyArg_GetLongArraySize Py_PROTO((PyObject *args, int nargs,
62-
int i, long *p_a));
63-
extern int PyArg_GetShortArraySize Py_PROTO((PyObject *args, int nargs,
64-
int i, short *p_a));
65-
extern int PyArg_GetDoubleArraySize Py_PROTO((PyObject *args, int nargs,
66-
int i, double *p_a));
67-
extern int PyArg_GetFloatArraySize Py_PROTO((PyObject *args, int nargs,
68-
int i, float *p_a));
41+
extern int PyArg_GetObject(PyObject *args, int nargs,
42+
int i, PyObject **p_a);
43+
extern int PyArg_GetLong(PyObject *args, int nargs,
44+
int i, long *p_a);
45+
extern int PyArg_GetShort(PyObject *args, int nargs,
46+
int i, short *p_a);
47+
extern int PyArg_GetFloat(PyObject *args, int nargs,
48+
int i, float *p_a);
49+
extern int PyArg_GetString(PyObject *args, int nargs,
50+
int i, string *p_a);
51+
extern int PyArg_GetChar(PyObject *args, int nargs,
52+
int i, char *p_a);
53+
extern int PyArg_GetLongArray(PyObject *args, int nargs,
54+
int i, int n, long *p_a);
55+
extern int PyArg_GetShortArray(PyObject *args, int nargs,
56+
int i, int n, short *p_a);
57+
extern int PyArg_GetDoubleArray(PyObject *args, int nargs,
58+
int i, int n, double *p_a);
59+
extern int PyArg_GetFloatArray(PyObject *args, int nargs,
60+
int i, int n, float *p_a);
61+
extern int PyArg_GetLongArraySize(PyObject *args, int nargs,
62+
int i, long *p_a);
63+
extern int PyArg_GetShortArraySize(PyObject *args, int nargs,
64+
int i, short *p_a);
65+
extern int PyArg_GetDoubleArraySize(PyObject *args, int nargs,
66+
int i, double *p_a);
67+
extern int PyArg_GetFloatArraySize(PyObject *args, int nargs,
68+
int i, float *p_a);
6969

7070
#ifdef __cplusplus
7171
}

Modules/cmathmodule.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ math_error()
347347
static PyObject *
348348
math_1(args, func)
349349
PyObject *args;
350-
Py_complex (*func) Py_FPROTO((Py_complex));
350+
Py_complex (*func)(Py_complex);
351351
{
352352
Py_complex x;
353353
if (!PyArg_ParseTuple(args, "D", &x))

Modules/glmodule.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ gl_varray(self, args)
107107
PyObject *v, *w=NULL;
108108
int i, n, width;
109109
double vec[3];
110-
PyObject * (*getitem) Py_FPROTO((PyObject *, int));
110+
PyObject * (*getitem)(PyObject *, int);
111111

112112
if (!PyArg_GetObject(args, 1, 0, &v))
113113
return NULL;
@@ -208,7 +208,7 @@ gen_nvarray(args, inorm)
208208
PyObject *v, *w, *wnorm, *wvec;
209209
int i, n;
210210
float norm[3], vec[3];
211-
PyObject * (*getitem) Py_FPROTO((PyObject *, int));
211+
PyObject * (*getitem)(PyObject *, int);
212212

213213
if (!PyArg_GetObject(args, 1, 0, &v))
214214
return NULL;

Modules/mpzmodule.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1012,8 +1012,8 @@ mpz_mpzcoerce(z)
10121012
} /* mpz_mpzcoerce() */
10131013

10141014
/* Forward */
1015-
static void mpz_divm Py_PROTO((MP_INT *res, const MP_INT *num,
1016-
const MP_INT *den, const MP_INT *mod));
1015+
static void mpz_divm(MP_INT *res, const MP_INT *num,
1016+
const MP_INT *den, const MP_INT *mod);
10171017

10181018
static PyObject *
10191019
MPZ_powm(self, args)

0 commit comments

Comments
 (0)