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

Skip to content

Commit d5c84ed

Browse files
committed
ANSI-fication of the sources -- remove Py_PROTO!
1 parent 146b280 commit d5c84ed

2 files changed

Lines changed: 39 additions & 35 deletions

File tree

Include/modsupport.h

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
1-
#ifndef Py_MODSUPPORT_H
2-
#define Py_MODSUPPORT_H
3-
#ifdef __cplusplus
4-
extern "C" {
5-
#endif
6-
71
/***********************************************************
82
Copyright (c) 2000, BeOpen.com.
93
Copyright (c) 1995-2000, Corporation for National Research Initiatives.
@@ -14,17 +8,23 @@ See the file "Misc/COPYRIGHT" for information on usage and
148
redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.
159
******************************************************************/
1610

11+
#ifndef Py_MODSUPPORT_H
12+
#define Py_MODSUPPORT_H
13+
#ifdef __cplusplus
14+
extern "C" {
15+
#endif
16+
1717
/* Module support interface */
1818

1919
#ifdef HAVE_STDARG_PROTOTYPES
2020

2121
#include <stdarg.h>
2222

23-
extern DL_IMPORT(int) PyArg_Parse Py_PROTO((PyObject *, char *, ...));
24-
extern DL_IMPORT(int) PyArg_ParseTuple Py_PROTO((PyObject *, char *, ...));
25-
extern DL_IMPORT(int) PyArg_ParseTupleAndKeywords Py_PROTO((PyObject *, PyObject *,
26-
char *, char **, ...));
27-
extern DL_IMPORT(PyObject *) Py_BuildValue Py_PROTO((char *, ...));
23+
extern DL_IMPORT(int) PyArg_Parse(PyObject *, char *, ...);
24+
extern DL_IMPORT(int) PyArg_ParseTuple(PyObject *, char *, ...);
25+
extern DL_IMPORT(int) PyArg_ParseTupleAndKeywords(PyObject *, PyObject *,
26+
char *, char **, ...);
27+
extern DL_IMPORT(PyObject *) Py_BuildValue(char *, ...);
2828

2929
#else
3030

@@ -37,8 +37,8 @@ extern DL_IMPORT(PyObject *) Py_BuildValue();
3737

3838
#endif
3939

40-
extern DL_IMPORT(int) PyArg_VaParse Py_PROTO((PyObject *, char *, va_list));
41-
extern DL_IMPORT(PyObject *) Py_VaBuildValue Py_PROTO((char *, va_list));
40+
extern DL_IMPORT(int) PyArg_VaParse(PyObject *, char *, va_list);
41+
extern DL_IMPORT(PyObject *) Py_VaBuildValue(char *, va_list);
4242

4343
#define PYTHON_API_VERSION 1009
4444
#define PYTHON_API_STRING "1009"
@@ -90,8 +90,10 @@ extern DL_IMPORT(PyObject *) Py_VaBuildValue Py_PROTO((char *, va_list));
9090
#define Py_InitModule4 Py_InitModule4TraceRefs
9191
#endif
9292

93-
extern DL_IMPORT(PyObject *) Py_InitModule4 Py_PROTO((char *, PyMethodDef *,
94-
char *, PyObject *, int));
93+
extern DL_IMPORT(PyObject *) Py_InitModule4(char *name, PyMethodDef *methods,
94+
char *doc, PyObject *self,
95+
int apiver);
96+
9597
#define Py_InitModule(name, methods) \
9698
Py_InitModule4(name, methods, (char *)NULL, (PyObject *)NULL, \
9799
PYTHON_API_VERSION)

Include/pyerrors.h

Lines changed: 22 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,18 @@ redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.
1616

1717
/* Error handling definitions */
1818

19-
DL_IMPORT(void) PyErr_SetNone Py_PROTO((PyObject *));
20-
DL_IMPORT(void) PyErr_SetObject Py_PROTO((PyObject *, PyObject *));
21-
DL_IMPORT(void) PyErr_SetString Py_PROTO((PyObject *, const char *));
22-
DL_IMPORT(PyObject *) PyErr_Occurred Py_PROTO((void));
23-
DL_IMPORT(void) PyErr_Clear Py_PROTO((void));
24-
DL_IMPORT(void) PyErr_Fetch Py_PROTO((PyObject **, PyObject **, PyObject **));
25-
DL_IMPORT(void) PyErr_Restore Py_PROTO((PyObject *, PyObject *, PyObject *));
19+
DL_IMPORT(void) PyErr_SetNone(PyObject *);
20+
DL_IMPORT(void) PyErr_SetObject(PyObject *, PyObject *);
21+
DL_IMPORT(void) PyErr_SetString(PyObject *, const char *);
22+
DL_IMPORT(PyObject *) PyErr_Occurred(void);
23+
DL_IMPORT(void) PyErr_Clear(void);
24+
DL_IMPORT(void) PyErr_Fetch(PyObject **, PyObject **, PyObject **);
25+
DL_IMPORT(void) PyErr_Restore(PyObject *, PyObject *, PyObject *);
2626

2727
/* Error testing and normalization */
28-
DL_IMPORT(int) PyErr_GivenExceptionMatches Py_PROTO((PyObject *, PyObject *));
29-
DL_IMPORT(int) PyErr_ExceptionMatches Py_PROTO((PyObject *));
30-
DL_IMPORT(void) PyErr_NormalizeException Py_PROTO((PyObject**, PyObject**, PyObject**));
28+
DL_IMPORT(int) PyErr_GivenExceptionMatches(PyObject *, PyObject *);
29+
DL_IMPORT(int) PyErr_ExceptionMatches(PyObject *);
30+
DL_IMPORT(void) PyErr_NormalizeException(PyObject**, PyObject**, PyObject**);
3131

3232

3333
/* Predefined exceptions */
@@ -54,6 +54,8 @@ extern DL_IMPORT(PyObject *) PyExc_OverflowError;
5454
extern DL_IMPORT(PyObject *) PyExc_RuntimeError;
5555
extern DL_IMPORT(PyObject *) PyExc_NotImplementedError;
5656
extern DL_IMPORT(PyObject *) PyExc_SyntaxError;
57+
extern DL_IMPORT(PyObject *) PyExc_IndentationError;
58+
extern DL_IMPORT(PyObject *) PyExc_TabError;
5759
extern DL_IMPORT(PyObject *) PyExc_SystemError;
5860
extern DL_IMPORT(PyObject *) PyExc_SystemExit;
5961
extern DL_IMPORT(PyObject *) PyExc_TypeError;
@@ -70,25 +72,25 @@ extern DL_IMPORT(PyObject *) PyExc_MemoryErrorInst;
7072

7173
/* Convenience functions */
7274

73-
extern DL_IMPORT(int) PyErr_BadArgument Py_PROTO((void));
74-
extern DL_IMPORT(PyObject *) PyErr_NoMemory Py_PROTO((void));
75-
extern DL_IMPORT(PyObject *) PyErr_SetFromErrno Py_PROTO((PyObject *));
76-
extern DL_IMPORT(PyObject *) PyErr_SetFromErrnoWithFilename Py_PROTO((PyObject *, char *));
77-
extern DL_IMPORT(PyObject *) PyErr_Format Py_PROTO((PyObject *, const char *, ...));
75+
extern DL_IMPORT(int) PyErr_BadArgument(void);
76+
extern DL_IMPORT(PyObject *) PyErr_NoMemory(void);
77+
extern DL_IMPORT(PyObject *) PyErr_SetFromErrno(PyObject *);
78+
extern DL_IMPORT(PyObject *) PyErr_SetFromErrnoWithFilename(PyObject *, char *);
79+
extern DL_IMPORT(PyObject *) PyErr_Format(PyObject *, const char *, ...);
7880
#ifdef MS_WINDOWS
7981
extern DL_IMPORT(PyObject *) PyErr_SetFromWindowsErrWithFilename(int, const char *);
8082
extern DL_IMPORT(PyObject *) PyErr_SetFromWindowsErr(int);
8183
#endif
8284

83-
extern DL_IMPORT(void) PyErr_BadInternalCall Py_PROTO((void));
85+
extern DL_IMPORT(void) PyErr_BadInternalCall(void);
8486

8587
/* Function to create a new exception */
86-
DL_IMPORT(PyObject *) PyErr_NewException Py_PROTO((char *name, PyObject *base,
87-
PyObject *dict));
88+
DL_IMPORT(PyObject *) PyErr_NewException(char *name, PyObject *base,
89+
PyObject *dict);
8890

8991
/* In sigcheck.c or signalmodule.c */
90-
extern DL_IMPORT(int) PyErr_CheckSignals Py_PROTO((void));
91-
extern DL_IMPORT(void) PyErr_SetInterrupt Py_PROTO((void));
92+
extern DL_IMPORT(int) PyErr_CheckSignals(void);
93+
extern DL_IMPORT(void) PyErr_SetInterrupt(void);
9294

9395

9496
#ifdef __cplusplus

0 commit comments

Comments
 (0)