]> granicus.if.org Git - python/commitdiff
remove dynamic initializer lists for c89 compliance (closes #20595)
authorBenjamin Peterson <benjamin@python.org>
Tue, 11 Feb 2014 15:09:27 +0000 (10:09 -0500)
committerBenjamin Peterson <benjamin@python.org>
Tue, 11 Feb 2014 15:09:27 +0000 (10:09 -0500)
Misc/NEWS
Python/getargs.c

index d369582c7627cff3dbfdb27de30b2914cf838cbf..e36e4b8c95e04730d2887b50c30316917da41adb 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -10,6 +10,8 @@ Release date: 2014-02-23
 Core and Builtins
 -----------------
 
+- Issue #20595: Make getargs.c C89 compliant.
+
 Library
 -------
 
index bfea1118fdf436b5cdf8a05ed1650a95b593b23e..946faf2d7e0ac891f3cbdcbbfbfcaa946319ea0a 100644 (file)
@@ -200,8 +200,6 @@ vgetargs1(PyObject *args, const char *format, va_list *p_va, int flags)
 {
     char msgbuf[256];
     int levels[32];
-    freelistentry_t static_entries[STATIC_FREELIST_ENTRIES];
-    freelist_t freelist = {static_entries, 0, 0};
     const char *fname = NULL;
     const char *message = NULL;
     int min = -1;
@@ -212,6 +210,12 @@ vgetargs1(PyObject *args, const char *format, va_list *p_va, int flags)
     Py_ssize_t i, len;
     char *msg;
     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));
     flags = flags & ~FLAG_COMPAT;
@@ -1439,7 +1443,11 @@ vgetargskeywords(PyObject *args, PyObject *keywords, const char *format,
     Py_ssize_t nargs, nkeywords;
     PyObject *current_arg;
     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(keywords == NULL || PyDict_Check(keywords));