mirror of
https://github.com/python/cpython.git
synced 2025-10-16 19:57:59 +00:00
remove dynamic initializer lists for c89 compliance (closes #20595)
This commit is contained in:
parent
801fe934d9
commit
40be9e5100
2 changed files with 13 additions and 3 deletions
|
@ -10,6 +10,8 @@ Release date: 2014-02-23
|
||||||
Core and Builtins
|
Core and Builtins
|
||||||
-----------------
|
-----------------
|
||||||
|
|
||||||
|
- Issue #20595: Make getargs.c C89 compliant.
|
||||||
|
|
||||||
Library
|
Library
|
||||||
-------
|
-------
|
||||||
|
|
||||||
|
|
|
@ -200,8 +200,6 @@ vgetargs1(PyObject *args, const char *format, va_list *p_va, int flags)
|
||||||
{
|
{
|
||||||
char msgbuf[256];
|
char msgbuf[256];
|
||||||
int levels[32];
|
int levels[32];
|
||||||
freelistentry_t static_entries[STATIC_FREELIST_ENTRIES];
|
|
||||||
freelist_t freelist = {static_entries, 0, 0};
|
|
||||||
const char *fname = NULL;
|
const char *fname = NULL;
|
||||||
const char *message = NULL;
|
const char *message = NULL;
|
||||||
int min = -1;
|
int min = -1;
|
||||||
|
@ -212,6 +210,12 @@ vgetargs1(PyObject *args, const char *format, va_list *p_va, int flags)
|
||||||
Py_ssize_t i, len;
|
Py_ssize_t i, len;
|
||||||
char *msg;
|
char *msg;
|
||||||
int compat = flags & FLAG_COMPAT;
|
int compat = flags & FLAG_COMPAT;
|
||||||
|
freelistentry_t static_entries[STATIC_FREELIST_ENTRIES];
|
||||||
|
freelist_t freelist;
|
||||||
|
|
||||||
|
freelist.entries = static_entries;
|
||||||
|
freelist.first_available = 0;
|
||||||
|
freelist.entries_malloced = 0;
|
||||||
|
|
||||||
assert(compat || (args != (PyObject*)NULL));
|
assert(compat || (args != (PyObject*)NULL));
|
||||||
flags = flags & ~FLAG_COMPAT;
|
flags = flags & ~FLAG_COMPAT;
|
||||||
|
@ -1439,7 +1443,11 @@ vgetargskeywords(PyObject *args, PyObject *keywords, const char *format,
|
||||||
Py_ssize_t nargs, nkeywords;
|
Py_ssize_t nargs, nkeywords;
|
||||||
PyObject *current_arg;
|
PyObject *current_arg;
|
||||||
freelistentry_t static_entries[STATIC_FREELIST_ENTRIES];
|
freelistentry_t static_entries[STATIC_FREELIST_ENTRIES];
|
||||||
freelist_t freelist = {static_entries, 0, 0};
|
freelist_t freelist;
|
||||||
|
|
||||||
|
freelist.entries = static_entries;
|
||||||
|
freelist.first_available = 0;
|
||||||
|
freelist.entries_malloced = 0;
|
||||||
|
|
||||||
assert(args != NULL && PyTuple_Check(args));
|
assert(args != NULL && PyTuple_Check(args));
|
||||||
assert(keywords == NULL || PyDict_Check(keywords));
|
assert(keywords == NULL || PyDict_Check(keywords));
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue