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

Skip to content

Commit 5f37591

Browse files
committed
ANSIfications: fix empty arglists, and remove the checks for
'HAVE_STDARG_PROTOTYPES' (consider it true, remove false branch)
1 parent 7889010 commit 5f37591

6 files changed

Lines changed: 3 additions & 34 deletions

File tree

Include/ceval.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,9 @@ DL_IMPORT(PyObject *) PyEval_CallObject(PyObject *, PyObject *);
2727
#define PyEval_CallObject(func,arg) \
2828
PyEval_CallObjectWithKeywords(func, arg, (PyObject *)NULL)
2929

30-
#ifdef HAVE_STDARG_PROTOTYPES
3130
DL_IMPORT(PyObject *) PyEval_CallFunction(PyObject *obj, char *format, ...);
3231
DL_IMPORT(PyObject *) PyEval_CallMethod(PyObject *obj,
3332
char *methodname, char *format, ...);
34-
#else
35-
/* Better to have no prototypes at all for varargs functions in this case */
36-
DL_IMPORT(PyObject *) PyEval_CallFunction();
37-
DL_IMPORT(PyObject *) PyEval_CallMethod();
38-
#endif
3933

4034
DL_IMPORT(PyObject *) PyEval_GetBuiltins(void);
4135
DL_IMPORT(PyObject *) PyEval_GetGlobals(void);

Include/import.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,12 @@ extern DL_IMPORT(PyObject *)_PyImport_FixupExtension(char *, char *);
3535

3636
struct _inittab {
3737
char *name;
38-
void (*initfunc)();
38+
void (*initfunc)(void);
3939
};
4040

4141
extern DL_IMPORT(struct _inittab *) PyImport_Inittab;
4242

43-
extern DL_IMPORT(int) PyImport_AppendInittab(char *name, void (*initfunc)());
43+
extern DL_IMPORT(int) PyImport_AppendInittab(char *name, void (*initfunc)(void));
4444
extern DL_IMPORT(int) PyImport_ExtendInittab(struct _inittab *newtab);
4545

4646
struct _frozen {

Include/modsupport.h

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ extern "C" {
1616

1717
/* Module support interface */
1818

19-
#ifdef HAVE_STDARG_PROTOTYPES
20-
2119
#include <stdarg.h>
2220

2321
extern DL_IMPORT(int) PyArg_Parse(PyObject *, char *, ...);
@@ -26,17 +24,6 @@ extern DL_IMPORT(int) PyArg_ParseTupleAndKeywords(PyObject *, PyObject *,
2624
char *, char **, ...);
2725
extern DL_IMPORT(PyObject *) Py_BuildValue(char *, ...);
2826

29-
#else
30-
31-
#include <varargs.h>
32-
33-
/* Better to have no prototypes at all for varargs functions in this case */
34-
extern DL_IMPORT(int) PyArg_Parse();
35-
extern DL_IMPORT(int) PyArg_ParseTuple();
36-
extern DL_IMPORT(PyObject *) Py_BuildValue();
37-
38-
#endif
39-
4027
extern DL_IMPORT(int) PyArg_VaParse(PyObject *, char *, va_list);
4128
extern DL_IMPORT(PyObject *) Py_VaBuildValue(char *, va_list);
4229

Include/pgenheaders.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,8 @@ redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.
3535

3636
#include "pydebug.h"
3737

38-
#ifdef HAVE_STDARG_PROTOTYPES
3938
DL_IMPORT(void) PySys_WriteStdout(const char *format, ...);
4039
DL_IMPORT(void) PySys_WriteStderr(const char *format, ...);
41-
#else
42-
/* Better to have no prototypes at all for varargs functions in this case */
43-
DL_IMPORT(void) PySys_WriteStdout();
44-
DL_IMPORT(void) PySys_WriteStderr();
45-
#endif
4640

4741
#define addarc _Py_addarc
4842
#define addbit _Py_addbit

Include/sysmodule.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,8 @@ DL_IMPORT(FILE *) PySys_GetFile(char *, FILE *);
2222
DL_IMPORT(void) PySys_SetArgv(int, char **);
2323
DL_IMPORT(void) PySys_SetPath(char *);
2424

25-
#ifdef HAVE_STDARG_PROTOTYPES
2625
DL_IMPORT(void) PySys_WriteStdout(const char *format, ...);
2726
DL_IMPORT(void) PySys_WriteStderr(const char *format, ...);
28-
#else
29-
/* Better to have no prototypes at all for varargs functions in this case */
30-
DL_IMPORT(void) PySys_WriteStdout();
31-
DL_IMPORT(void) PySys_WriteStderr();
32-
#endif
3327

3428
extern DL_IMPORT(PyObject *) _PySys_TraceFunc, *_PySys_ProfileFunc;
3529
extern DL_IMPORT(int) _PySys_CheckInterval;

Include/unicodeobject.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,7 @@ extern DL_IMPORT(int) PyUnicode_AsWideChar(
376376
377377
*/
378378

379-
extern DL_IMPORT(const char*) PyUnicode_GetDefaultEncoding();
379+
extern DL_IMPORT(const char*) PyUnicode_GetDefaultEncoding(void);
380380

381381
/* Sets the currently active default encoding.
382382

0 commit comments

Comments
 (0)