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

Skip to content

Commit 40be9e5

Browse files
committed
remove dynamic initializer lists for c89 compliance (closes #20595)
1 parent 801fe93 commit 40be9e5

2 files changed

Lines changed: 13 additions & 3 deletions

File tree

Misc/NEWS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ Release date: 2014-02-23
1010
Core and Builtins
1111
-----------------
1212

13+
- Issue #20595: Make getargs.c C89 compliant.
14+
1315
Library
1416
-------
1517

Python/getargs.c

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -200,8 +200,6 @@ vgetargs1(PyObject *args, const char *format, va_list *p_va, int flags)
200200
{
201201
char msgbuf[256];
202202
int levels[32];
203-
freelistentry_t static_entries[STATIC_FREELIST_ENTRIES];
204-
freelist_t freelist = {static_entries, 0, 0};
205203
const char *fname = NULL;
206204
const char *message = NULL;
207205
int min = -1;
@@ -212,6 +210,12 @@ vgetargs1(PyObject *args, const char *format, va_list *p_va, int flags)
212210
Py_ssize_t i, len;
213211
char *msg;
214212
int compat = flags & FLAG_COMPAT;
213+
freelistentry_t static_entries[STATIC_FREELIST_ENTRIES];
214+
freelist_t freelist;
215+
216+
freelist.entries = static_entries;
217+
freelist.first_available = 0;
218+
freelist.entries_malloced = 0;
215219

216220
assert(compat || (args != (PyObject*)NULL));
217221
flags = flags & ~FLAG_COMPAT;
@@ -1439,7 +1443,11 @@ vgetargskeywords(PyObject *args, PyObject *keywords, const char *format,
14391443
Py_ssize_t nargs, nkeywords;
14401444
PyObject *current_arg;
14411445
freelistentry_t static_entries[STATIC_FREELIST_ENTRIES];
1442-
freelist_t freelist = {static_entries, 0, 0};
1446+
freelist_t freelist;
1447+
1448+
freelist.entries = static_entries;
1449+
freelist.first_available = 0;
1450+
freelist.entries_malloced = 0;
14431451

14441452
assert(args != NULL && PyTuple_Check(args));
14451453
assert(keywords == NULL || PyDict_Check(keywords));

0 commit comments

Comments
 (0)