mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Mass ANSIfication of function definitions. Doesn't cover all 'extern'
declarations yet, those come later.
This commit is contained in:
parent
0452d1f316
commit
f70ef4f860
45 changed files with 704 additions and 1526 deletions
|
@ -42,12 +42,8 @@ static char api_version_warning[] =
|
|||
This Python has API version %d, module %s has version %d.\n";
|
||||
|
||||
PyObject *
|
||||
Py_InitModule4(name, methods, doc, passthrough, module_api_version)
|
||||
char *name;
|
||||
PyMethodDef *methods;
|
||||
char *doc;
|
||||
PyObject *passthrough;
|
||||
int module_api_version;
|
||||
Py_InitModule4(char *name, PyMethodDef *methods, char *doc,
|
||||
PyObject *passthrough, int module_api_version)
|
||||
{
|
||||
PyObject *m, *d, *v;
|
||||
PyMethodDef *ml;
|
||||
|
@ -84,10 +80,7 @@ Py_InitModule4(name, methods, doc, passthrough, module_api_version)
|
|||
|
||||
/* Helper for mkvalue() to scan the length of a format */
|
||||
|
||||
static int countformat(char *format, int endchar);
|
||||
static int countformat(format, endchar)
|
||||
char *format;
|
||||
int endchar;
|
||||
static int countformat(char *format, int endchar)
|
||||
{
|
||||
int count = 0;
|
||||
int level = 0;
|
||||
|
@ -137,11 +130,7 @@ static PyObject *do_mkvalue(char**, va_list *);
|
|||
|
||||
|
||||
static PyObject *
|
||||
do_mkdict(p_format, p_va, endchar, n)
|
||||
char **p_format;
|
||||
va_list *p_va;
|
||||
int endchar;
|
||||
int n;
|
||||
do_mkdict(char **p_format, va_list *p_va, int endchar, int n)
|
||||
{
|
||||
PyObject *d;
|
||||
int i;
|
||||
|
@ -183,11 +172,7 @@ do_mkdict(p_format, p_va, endchar, n)
|
|||
}
|
||||
|
||||
static PyObject *
|
||||
do_mklist(p_format, p_va, endchar, n)
|
||||
char **p_format;
|
||||
va_list *p_va;
|
||||
int endchar;
|
||||
int n;
|
||||
do_mklist(char **p_format, va_list *p_va, int endchar, int n)
|
||||
{
|
||||
PyObject *v;
|
||||
int i;
|
||||
|
@ -224,11 +209,7 @@ _ustrlen(Py_UNICODE *u)
|
|||
}
|
||||
|
||||
static PyObject *
|
||||
do_mktuple(p_format, p_va, endchar, n)
|
||||
char **p_format;
|
||||
va_list *p_va;
|
||||
int endchar;
|
||||
int n;
|
||||
do_mktuple(char **p_format, va_list *p_va, int endchar, int n)
|
||||
{
|
||||
PyObject *v;
|
||||
int i;
|
||||
|
@ -256,9 +237,7 @@ do_mktuple(p_format, p_va, endchar, n)
|
|||
}
|
||||
|
||||
static PyObject *
|
||||
do_mkvalue(p_format, p_va)
|
||||
char **p_format;
|
||||
va_list *p_va;
|
||||
do_mkvalue(char **p_format, va_list *p_va)
|
||||
{
|
||||
for (;;) {
|
||||
switch (*(*p_format)++) {
|
||||
|
@ -401,32 +380,18 @@ do_mkvalue(p_format, p_va)
|
|||
}
|
||||
|
||||
|
||||
#ifdef HAVE_STDARG_PROTOTYPES
|
||||
/* VARARGS 2 */
|
||||
PyObject *Py_BuildValue(char *format, ...)
|
||||
#else
|
||||
/* VARARGS */
|
||||
PyObject *Py_BuildValue(va_alist) va_dcl
|
||||
#endif
|
||||
{
|
||||
va_list va;
|
||||
PyObject* retval;
|
||||
#ifdef HAVE_STDARG_PROTOTYPES
|
||||
va_start(va, format);
|
||||
#else
|
||||
char *format;
|
||||
va_start(va);
|
||||
format = va_arg(va, char *);
|
||||
#endif
|
||||
retval = Py_VaBuildValue(format, va);
|
||||
va_end(va);
|
||||
return retval;
|
||||
}
|
||||
|
||||
PyObject *
|
||||
Py_VaBuildValue(format, va)
|
||||
char *format;
|
||||
va_list va;
|
||||
Py_VaBuildValue(char *format, va_list va)
|
||||
{
|
||||
char *f = format;
|
||||
int n = countformat(f, '\0');
|
||||
|
@ -450,26 +415,14 @@ Py_VaBuildValue(format, va)
|
|||
}
|
||||
|
||||
|
||||
#ifdef HAVE_STDARG_PROTOTYPES
|
||||
PyObject *
|
||||
PyEval_CallFunction(PyObject *obj, char *format, ...)
|
||||
#else
|
||||
PyObject *
|
||||
PyEval_CallFunction(obj, format, va_alist)
|
||||
PyObject *obj;
|
||||
char *format;
|
||||
va_dcl
|
||||
#endif
|
||||
{
|
||||
va_list vargs;
|
||||
PyObject *args;
|
||||
PyObject *res;
|
||||
|
||||
#ifdef HAVE_STDARG_PROTOTYPES
|
||||
va_start(vargs, format);
|
||||
#else
|
||||
va_start(vargs);
|
||||
#endif
|
||||
|
||||
args = Py_VaBuildValue(format, vargs);
|
||||
va_end(vargs);
|
||||
|
@ -484,17 +437,8 @@ PyEval_CallFunction(obj, format, va_alist)
|
|||
}
|
||||
|
||||
|
||||
#ifdef HAVE_STDARG_PROTOTYPES
|
||||
PyObject *
|
||||
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;
|
||||
PyObject *meth;
|
||||
|
@ -505,11 +449,7 @@ PyEval_CallMethod(obj, methodname, format, va_alist)
|
|||
if (meth == NULL)
|
||||
return NULL;
|
||||
|
||||
#ifdef HAVE_STDARG_PROTOTYPES
|
||||
va_start(vargs, format);
|
||||
#else
|
||||
va_start(vargs);
|
||||
#endif
|
||||
|
||||
args = Py_VaBuildValue(format, vargs);
|
||||
va_end(vargs);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue