]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-40268: Remove unused structmember.h includes (GH-19530)
authorVictor Stinner <vstinner@python.org>
Wed, 15 Apr 2020 00:35:41 +0000 (02:35 +0200)
committerGitHub <noreply@github.com>
Wed, 15 Apr 2020 00:35:41 +0000 (02:35 +0200)
If only offsetof() is needed: include stddef.h instead.

When structmember.h is used, add a comment explaining that
PyMemberDef is used.

78 files changed:
Modules/_abc.c
Modules/_asynciomodule.c
Modules/_bz2module.c
Modules/_collectionsmodule.c
Modules/_csv.c
Modules/_ctypes/_ctypes.c
Modules/_ctypes/callproc.c
Modules/_datetimemodule.c
Modules/_decimal/_decimal.c
Modules/_elementtree.c
Modules/_functoolsmodule.c
Modules/_hashopenssl.c
Modules/_io/_iomodule.c
Modules/_io/bufferedio.c
Modules/_io/bytesio.c
Modules/_io/fileio.c
Modules/_io/iobase.c
Modules/_io/stringio.c
Modules/_io/textio.c
Modules/_io/winconsoleio.c
Modules/_json.c
Modules/_lzmamodule.c
Modules/_multiprocessing/posixshmem.c
Modules/_pickle.c
Modules/_queuemodule.c
Modules/_sqlite/connection.c
Modules/_sqlite/microprotocols.c
Modules/_sre.c
Modules/_statisticsmodule.c
Modules/_struct.c
Modules/_testcapimodule.c
Modules/_threadmodule.c
Modules/_winapi.c
Modules/arraymodule.c
Modules/cjkcodecs/multibytecodec.c
Modules/itertoolsmodule.c
Modules/mmapmodule.c
Modules/ossaudiodev.c
Modules/overlapped.c
Modules/posixmodule.c
Modules/pyexpat.c
Modules/selectmodule.c
Modules/sha256module.c
Modules/sha512module.c
Modules/socketmodule.c
Modules/unicodedata.c
Modules/xxsubtype.c
Modules/zlibmodule.c
Objects/abstract.c
Objects/bytearrayobject.c
Objects/classobject.c
Objects/codeobject.c
Objects/complexobject.c
Objects/descrobject.c
Objects/exceptions.c
Objects/frameobject.c
Objects/funcobject.c
Objects/genericaliasobject.c
Objects/genobject.c
Objects/methodobject.c
Objects/moduleobject.c
Objects/namespaceobject.c
Objects/odictobject.c
Objects/rangeobject.c
Objects/setobject.c
Objects/sliceobject.c
Objects/structseq.c
Objects/typeobject.c
Objects/weakrefobject.c
PC/winreg.c
Parser/asdl_c.py
Python/Python-ast.c
Python/ceval.c
Python/context.c
Python/hamt.c
Python/structmember.c
Python/symtable.c
Python/traceback.c

index 1efc98bf72c0797e0c6ce70fd9afb9b36e78c1ab..7c040ef80ba3da81eae39fcaf5abdee117fdc943 100644 (file)
@@ -1,7 +1,6 @@
 /* ABCMeta implementation */
 
 #include "Python.h"
-#include "structmember.h"
 #include "clinic/_abc.c.h"
 
 /*[clinic input]
index c10866aba7ce3aa83507a97aaee656d0f432501e..96a99fe49ceb017fe609d0607be73a69c48df68d 100644 (file)
@@ -1,5 +1,5 @@
 #include "Python.h"
-#include "structmember.h"
+#include <stddef.h>               // offsetof()
 
 
 /*[clinic input]
index d46f96cc866ef4e15ef391a4834b5343fe7df807..880632c62349f18d78815e26b442f597991ff6b0 100644 (file)
@@ -3,7 +3,7 @@
 #define PY_SSIZE_T_CLEAN
 
 #include "Python.h"
-#include "structmember.h"
+#include "structmember.h"         // PyMemberDef
 
 #include <bzlib.h>
 #include <stdio.h>
index 181e3229da4f273751f3dcf2d8b8ec568b395273..978ea03bd90580ae33882223edceef05e520bf63 100644 (file)
@@ -1,10 +1,10 @@
 #include "Python.h"
-#include "structmember.h"
+#include "structmember.h"         // PyMemberDef
 
 #ifdef STDC_HEADERS
 #include <stddef.h>
 #else
-#include <sys/types.h>          /* For size_t */
+#include <sys/types.h>            // size_t
 #endif
 
 /*[clinic input]
index 950b0d70055226c1297a6327329875fbd62e1c0e..3a52632ccfd45688a5d39bcd736dac96dad24dd8 100644 (file)
@@ -11,7 +11,7 @@ module instead.
 #define MODULE_VERSION "1.0"
 
 #include "Python.h"
-#include "structmember.h"
+#include "structmember.h"         // PyMemberDef
 #include <stdbool.h>
 
 
index 5548c50cf53e43709336007b9fdb8a5acc392338..ceae67ebb1612747290348f7fc339729c990233a 100644 (file)
@@ -102,7 +102,7 @@ bytes(cdata)
 #define PY_SSIZE_T_CLEAN
 
 #include "Python.h"
-#include "structmember.h"
+#include "structmember.h"         // PyMemberDef
 
 #include <ffi.h>
 #ifdef MS_WIN32
index 815fc6664d0ba4fe65caa70ecf4e7713f69274d6..5c1ecabd8164dc38afb0f87e0b2a1fb7142ecf3c 100644 (file)
@@ -55,7 +55,7 @@
  */
 
 #include "Python.h"
-#include "structmember.h"
+#include "structmember.h"         // PyMemberDef
 
 #ifdef MS_WIN32
 #include <windows.h>
@@ -751,7 +751,7 @@ static int ConvParam(PyObject *obj, Py_ssize_t index, struct argument *pa)
 #if defined(MS_WIN32) && !defined(_WIN32_WCE)
 /*
 Per: https://msdn.microsoft.com/en-us/library/7572ztz4.aspx
-To be returned by value in RAX, user-defined types must have a length 
+To be returned by value in RAX, user-defined types must have a length
 of 1, 2, 4, 8, 16, 32, or 64 bits
 */
 int can_return_struct_as_int(size_t s)
index f7c1b69def3e77dac3fba18a6d5248f241044011..9bdc52e9497187b5d7ffce64c499683eafaee4fe 100644 (file)
@@ -9,7 +9,7 @@
 
 #include "Python.h"
 #include "datetime.h"
-#include "structmember.h"
+#include "structmember.h"         // PyMemberDef
 
 #include <time.h>
 
index 99f12364ad81bea2b909edec85330979b94fd7e6..20ba8fb77ad44f30fd559284f3367fd440ff2098 100644 (file)
@@ -28,7 +28,6 @@
 
 #include <Python.h>
 #include "longintrepr.h"
-#include "structmember.h"
 #include "complexobject.h"
 #include "mpdecimal.h"
 
index 03ac6b6c0743d4eca34f21580210e78d52c813e6..2c92a8aedb5a8841a9354defc38a9a97882888e1 100644 (file)
@@ -14,7 +14,7 @@
 #define PY_SSIZE_T_CLEAN
 
 #include "Python.h"
-#include "structmember.h"
+#include "structmember.h"         // PyMemberDef
 
 /* -------------------------------------------------------------------- */
 /* configuration */
index d9536bb4e92d01717a5afc6bad684883bc8212d6..90e388c1c635c650c09af3737ec637a6c4603211 100644 (file)
@@ -1,8 +1,8 @@
 #include "Python.h"
 #include "pycore_pymem.h"
-#include "pycore_pystate.h"      // _PyThreadState_GET()
+#include "pycore_pystate.h"       // _PyThreadState_GET()
 #include "pycore_tupleobject.h"
-#include "structmember.h"
+#include "structmember.h"         // PyMemberDef
 
 /* _functools module written and maintained
    by Hye-Shik Chang <perky@FreeBSD.org>
index 1782636dbc6d7e4f620aab5609b609c1feea7e7a..0919cd3f47caa3e870ba74f069928fcae576bae2 100644 (file)
@@ -14,7 +14,6 @@
 #define PY_SSIZE_T_CLEAN
 
 #include "Python.h"
-#include "structmember.h"
 #include "hashlib.h"
 #include "pystrhex.h"
 
index 571f22552527f7ef26f18c8eb1b3f9b75906eea8..d7cadacea1b5b02dbf2bf21482922898562a9a21 100644 (file)
@@ -9,7 +9,6 @@
 
 #define PY_SSIZE_T_CLEAN
 #include "Python.h"
-#include "structmember.h"
 #include "_iomodule.h"
 
 #ifdef HAVE_SYS_TYPES_H
index f243ac84e9e7725f1fe15c88cc14254a4d73a901..f8e21f206f316ad647c7d42ba8d470323b16a21c 100644 (file)
@@ -10,7 +10,7 @@
 #define PY_SSIZE_T_CLEAN
 #include "Python.h"
 #include "pycore_object.h"
-#include "structmember.h"
+#include "structmember.h"         // PyMemberDef
 #include "_iomodule.h"
 
 /*[clinic input]
index f4261b3713ac1546c95d3d893671dbda564e2f49..2468f45f941e2ec6b6e553d019501024cb6492c3 100644 (file)
@@ -1,6 +1,6 @@
 #include "Python.h"
 #include "pycore_object.h"
-#include "structmember.h"       /* for offsetof() */
+#include <stddef.h>               // offsetof()
 #include "_iomodule.h"
 
 /*[clinic input]
index 1855b83449d2a74b66b13b84621c78605045ea1a..caf91dfdb749e68ec5d1f95492cdcb7fb478a6b5 100644 (file)
@@ -3,7 +3,7 @@
 #define PY_SSIZE_T_CLEAN
 #include "Python.h"
 #include "pycore_object.h"
-#include "structmember.h"
+#include "structmember.h"         // PyMemberDef
 #include <stdbool.h>
 #ifdef HAVE_SYS_TYPES_H
 #include <sys/types.h>
index 924ffb57ca95cf6656726545770e8d580d9b5e5b..a8e55c34799bd5b02728461c0f2755a741930c77 100644 (file)
@@ -11,7 +11,7 @@
 #define PY_SSIZE_T_CLEAN
 #include "Python.h"
 #include "pycore_object.h"
-#include "structmember.h"
+#include <stddef.h>               // offsetof()
 #include "_iomodule.h"
 
 /*[clinic input]
index 9feb76e7ffaf47b4737427e1a34e0fe0a595385f..e76152e617bdc570a6141e02c01a71db5ba298c6 100644 (file)
@@ -1,6 +1,6 @@
 #define PY_SSIZE_T_CLEAN
 #include "Python.h"
-#include "structmember.h"
+#include <stddef.h>               // offsetof()
 #include "pycore_accu.h"
 #include "pycore_object.h"
 #include "_iomodule.h"
index 9e33c1ed17b0fe9ffe95029c6897511f09fcb425..1abc9ca6f206aa3cbaaefd1823c590d406d1a152 100644 (file)
@@ -8,10 +8,10 @@
 
 #define PY_SSIZE_T_CLEAN
 #include "Python.h"
-#include "pycore_interp.h"      // PyInterpreterState.fs_codec
+#include "pycore_interp.h"        // PyInterpreterState.fs_codec
 #include "pycore_object.h"
-#include "pycore_pystate.h"     // _PyInterpreterState_GET()
-#include "structmember.h"
+#include "pycore_pystate.h"       // _PyInterpreterState_GET()
+#include "structmember.h"         // PyMemberDef
 #include "_iomodule.h"
 
 /*[clinic input]
index 94760acd47bf25193d8be5b1ef1de3792c0fe5d3..a83ef37a1fcf739bec52dccc6539e6bf5fdfea55 100644 (file)
@@ -12,7 +12,7 @@
 
 #ifdef MS_WINDOWS
 
-#include "structmember.h"
+#include "structmember.h"         // PyMemberDef
 #ifdef HAVE_SYS_TYPES_H
 #include <sys/types.h>
 #endif
index 17544165d82416e264d95a1e1958bcfbfcddb771..075aa3d2f4f6cb9526cd4aeabeba48640099a3e6 100644 (file)
@@ -9,7 +9,7 @@
 #endif
 
 #include "Python.h"
-#include "structmember.h"
+#include "structmember.h"         // PyMemberDef
 #include "pycore_accu.h"
 
 typedef struct {
index eac36b2d72f224a53daeb5fc4af0a239cce5963c..2a62a6835685059a6cba78c4e655c886bccd0838 100644 (file)
@@ -8,7 +8,7 @@
 #define PY_SSIZE_T_CLEAN
 
 #include "Python.h"
-#include "structmember.h"
+#include "structmember.h"         // PyMemberDef
 
 #include <stdarg.h>
 #include <string.h>
index 2049dbbc6fa83baf595f61052595a5c576ce272a..436ac6d6b39f49b7d5a271794d0fbd4f4dbfa93e 100644 (file)
@@ -5,7 +5,6 @@ posixshmem - A Python extension that provides shm_open() and shm_unlink()
 #define PY_SSIZE_T_CLEAN
 
 #include <Python.h>
-#include "structmember.h"
 
 // for shm_open() and shm_unlink()
 #ifdef HAVE_SYS_MMAN_H
index 4b46c1fe2af68202c897891eba41fff6e498d8a8..d07fa53a1235ed0b8809f4808effa4e7e24e372c 100644 (file)
@@ -9,7 +9,7 @@
 #endif
 
 #include "Python.h"
-#include "structmember.h"
+#include "structmember.h"         // PyMemberDef
 
 PyDoc_STRVAR(pickle_module_doc,
 "Optimized C implementation for the Python pickle module.");
index 062102e5c81bc3982dfec7b0dc215511a763b517..b155ea942398b4a2dd6b91b77fce5a48d86d39ac 100644 (file)
@@ -1,5 +1,5 @@
 #include "Python.h"
-#include "structmember.h" /* offsetof */
+#include <stddef.h>               // offsetof()
 
 /*[clinic input]
 module _queue
index 87a9f41021390a307f51c5cc6455bf2efb3ea883..958be7d869794afab9664930dd8b329576a305a2 100644 (file)
@@ -23,7 +23,7 @@
 
 #include "cache.h"
 #include "module.h"
-#include "structmember.h"
+#include "structmember.h"         // PyMemberDef
 #include "connection.h"
 #include "statement.h"
 #include "cursor.h"
index bb0d19f653b31244d04013ee3e1f2e4dc01b4f99..3b2d7f42b87353d1f541db84b27e9219aaa3506c 100644 (file)
@@ -24,7 +24,6 @@
  */
 
 #include <Python.h>
-#include <structmember.h>
 
 #include "cursor.h"
 #include "microprotocols.h"
index 836d7961832ea95536e32792ba7885e5c1089bfb..244e4f1f84dfff9e7b49778ac3fdfcb60a107c01 100644 (file)
@@ -41,7 +41,7 @@ static const char copyright[] =
 #define PY_SSIZE_T_CLEAN
 
 #include "Python.h"
-#include "structmember.h" /* offsetof */
+#include "structmember.h"         // PyMemberDef
 
 #include "sre.h"
 
index e98359a8d8dee540bc9711d9bc9093f38db1f575..78c0676a01f027b95be93463bb71938f84b4bc85 100644 (file)
@@ -1,7 +1,6 @@
 /* statistics accelerator C extension: _statistics module. */
 
 #include "Python.h"
-#include "structmember.h"
 #include "clinic/_statisticsmodule.c.h"
 
 /*[clinic input]
index 82ac0a19208d9af7896fc6643b0c6114810dfba3..13d8072f61218753909995948dc6aa92970cc00c 100644 (file)
@@ -6,7 +6,7 @@
 #define PY_SSIZE_T_CLEAN
 
 #include "Python.h"
-#include "structmember.h"
+#include "structmember.h"         // PyMemberDef
 #include <ctype.h>
 
 /*[clinic input]
index 8a76a3b1f2480b2a53b7eeafe9310d9141e4ab51..8e18b14a0a8905586aa2c476ba62c0cccbddbf69 100644 (file)
@@ -17,7 +17,7 @@
 #include "Python.h"
 #include "datetime.h"
 #include "marshal.h"
-#include "structmember.h"
+#include "structmember.h"         // PyMemberDef
 #include <float.h>
 #include <signal.h>
 
index 6e7ee0f43e3e0a847ff353ebc596d2ee96926dc5..b3d90b22c5a665b75b4bf1d0fb9cb05aaa347ab2 100644 (file)
@@ -4,9 +4,9 @@
 
 #include "Python.h"
 #include "pycore_pylifecycle.h"
-#include "pycore_interp.h"       // _PyInterpreterState.num_threads
-#include "pycore_pystate.h"      // _PyThreadState_Init()
-#include <stddef.h>              // offsetof()
+#include "pycore_interp.h"        // _PyInterpreterState.num_threads
+#include "pycore_pystate.h"       // _PyThreadState_Init()
+#include <stddef.h>               // offsetof()
 
 static PyObject *ThreadError;
 static PyObject *str_dict;
@@ -587,8 +587,6 @@ newlockobject(void)
 
 /* Thread-local objects */
 
-#include "structmember.h"
-
 /* Quick overview:
 
    We need to be able to reclaim reference cycles as soon as possible
index 5dc50fbe4d59d11bb35f550188d01bdd5ce9e985..1b28adb0b39838027325d965743021e3673baa91 100644 (file)
@@ -35,7 +35,7 @@
 /* See http://www.python.org/2.4/license for licensing details. */
 
 #include "Python.h"
-#include "structmember.h"
+#include "structmember.h"         // PyMemberDef
 
 #define WINDOWS_LEAN_AND_MEAN
 #include "windows.h"
@@ -1110,8 +1110,8 @@ _winapi_CreateProcess_impl(PyObject *module,
         }
     }
     else if (command_line != Py_None) {
-        PyErr_Format(PyExc_TypeError, 
-                     "CreateProcess() argument 2 must be str or None, not %s", 
+        PyErr_Format(PyExc_TypeError,
+                     "CreateProcess() argument 2 must be str or None, not %s",
                      Py_TYPE(command_line)->tp_name);
         goto cleanup;
     }
index 95ee5f881cc35611b79fd0cf46b9c3ead335f79c..4920ad7b82124c820c126370e9baf59a4aae8412 100644 (file)
@@ -5,7 +5,7 @@
 
 #define PY_SSIZE_T_CLEAN
 #include "Python.h"
-#include "structmember.h"
+#include <stddef.h>               // offsetof()
 
 #ifdef STDC_HEADERS
 #include <stddef.h>
index 319dc52749c656d820e41190595a707825787de3..86402768b6ee67cbd2ec1f5b2070f4dc5a06e928 100644 (file)
@@ -6,7 +6,7 @@
 
 #define PY_SSIZE_T_CLEAN
 #include "Python.h"
-#include "structmember.h"
+#include "structmember.h"         // PyMemberDef
 #include "multibytecodec.h"
 #include "clinic/multibytecodec.c.h"
 
index 4ebeb741b6b5c88049a61ae4dc6d190b7627df49..18fcebdf25b465f6c24a4b848d10c0023c23f265 100644 (file)
@@ -2,7 +2,7 @@
 #define PY_SSIZE_T_CLEAN
 #include "Python.h"
 #include "pycore_tupleobject.h"
-#include "structmember.h"
+#include <stddef.h>               // offsetof()
 
 /* Itertools module written and maintained
    by Raymond D. Hettinger <python@rcn.com>
index a1267bdd549c14d55f836ac11d0f17501d086f2e..6c503b3429b23a2b24508594d2295b09c5e97b54 100644 (file)
@@ -20,7 +20,7 @@
 
 #define PY_SSIZE_T_CLEAN
 #include <Python.h>
-#include "structmember.h"
+#include <stddef.h>               // offsetof()
 
 #ifndef MS_WINDOWS
 #define UNIX
index 0711d519b5cb6ea3a9d38ed456997a8f5a686810..2a1ac10814a698870ea01b7f01e592ec72c4e1df 100644 (file)
@@ -19,7 +19,7 @@
 
 #define PY_SSIZE_T_CLEAN
 #include "Python.h"
-#include "structmember.h"
+#include "structmember.h"         // PyMemberDef
 
 #ifdef HAVE_FCNTL_H
 #include <fcntl.h>
index e8029e72f90c7c51cdf807660418f56485828325..a16797c47b5d6c60978f36f3c562034dab12b1e6 100644 (file)
@@ -8,7 +8,7 @@
    Check itemsize */
 
 #include "Python.h"
-#include "structmember.h"
+#include "structmember.h"         // PyMemberDef
 
 #define WINDOWS_LEAN_AND_MEAN
 #include <winsock2.h>
index 7ac74842152efb8832ffafc89ce89a1b6edb8bec..f5beb092401301f64fea266854ba428fa7e2214f 100644 (file)
 #  include <windows.h>
 #endif
 
-#include "pycore_ceval.h"     /* _PyEval_ReInitThreads() */
-#include "pycore_import.h"    /* _PyImport_ReInitLock() */
-#include "pycore_pystate.h"   /* _PyInterpreterState_GET() */
-#include "structmember.h"
+#include "pycore_ceval.h"         // _PyEval_ReInitThreads()
+#include "pycore_import.h"        // _PyImport_ReInitLock()
+#include "pycore_pystate.h"       // _PyInterpreterState_GET()
+#include "structmember.h"         // PyMemberDef
 #ifndef MS_WINDOWS
 #  include "posixmodule.h"
 #else
index d930e3e12bbba1a65a6933f5168b5f3ac4b445ff..12ae66d945bda8cb6b85944fd3de9e02f35245ac 100644 (file)
@@ -1,7 +1,7 @@
 #include "Python.h"
 #include <ctype.h>
 
-#include "structmember.h"
+#include "structmember.h"         // PyMemberDef
 #include "frameobject.h"
 #include "expat.h"
 
index 1d09adcfd35bea6814c9657d283ae63b0801f74c..5c15e9973ab84d6c9c40201c935fcbc11db4a084 100644 (file)
@@ -9,7 +9,7 @@
 #endif
 
 #include "Python.h"
-#include <structmember.h>
+#include "structmember.h"         // PyMemberDef
 
 #ifdef HAVE_SYS_DEVPOLL_H
 #include <sys/resource.h>
index eee582cdd35cc937e0c4eed2975f6bba8a9c9b07..731082655c0ec768b4deb2080629bf9fdc4ff4ed 100644 (file)
@@ -17,7 +17,7 @@
 /* SHA objects */
 
 #include "Python.h"
-#include "structmember.h"
+#include "structmember.h"         // PyMemberDef
 #include "hashlib.h"
 #include "pystrhex.h"
 
index b2e07273436e9d8cd0d1ff247d5ad45c0091717a..38d303d369ec50d8841cd9cde18986902346ded5 100644 (file)
@@ -17,7 +17,7 @@
 /* SHA objects */
 
 #include "Python.h"
-#include "structmember.h"
+#include "structmember.h"         // PyMemberDef
 #include "hashlib.h"
 #include "pystrhex.h"
 
index 2be0c103f802f656140023254c2132c1f1fd21f4..9db8535eb34349986da4c2a60546f5a19df3a875 100644 (file)
@@ -101,7 +101,7 @@ Local naming conventions:
 
 #define PY_SSIZE_T_CLEAN
 #include "Python.h"
-#include "structmember.h"
+#include "structmember.h"         // PyMemberDef
 
 #ifdef _Py_MEMORY_SANITIZER
 # include <sanitizer/msan_interface.h>
index 569e785b291d3627469c69c9e3e953a63ceb13e0..8a1198a2b712d931d6c209e4a02678d284fa317a 100644 (file)
@@ -17,7 +17,7 @@
 
 #include "Python.h"
 #include "ucnhash.h"
-#include "structmember.h"
+#include "structmember.h"         // PyMemberDef
 
 #include <stdbool.h>
 
index 031005d36e20f2a519e4675804cce284bd7443ac..7200337724e080b40ee77aae14de51e2e45eb558 100644 (file)
@@ -1,5 +1,5 @@
 #include "Python.h"
-#include "structmember.h"
+#include "structmember.h"         // PyMemberDef
 
 PyDoc_STRVAR(xxsubtype__doc__,
 "xxsubtype is an example module showing how to subtype builtin types from C.\n"
index c2900a1243f29c6457b20cdf7025e87974ba25bd..fe27909ae8a75a64780c42adc4caef876dd87c8e 100644 (file)
@@ -6,7 +6,7 @@
 #define PY_SSIZE_T_CLEAN
 
 #include "Python.h"
-#include "structmember.h"
+#include "structmember.h"         // PyMemberDef
 #include "zlib.h"
 
 
index 8e22dfeca99b4490f63b6fb8416273c0523132b9..6e390dd92c3aefb8c88b34ee75dedcfe4da5685e 100644 (file)
@@ -1,12 +1,12 @@
 /* Abstract Object Interface (many thanks to Jim Fulton) */
 
 #include "Python.h"
-#include "pycore_abstract.h"   // _PyIndex_Check()
-#include "pycore_ceval.h"      // _Py_EnterRecursiveCall()
+#include "pycore_abstract.h"      // _PyIndex_Check()
+#include "pycore_ceval.h"         // _Py_EnterRecursiveCall()
 #include "pycore_pyerrors.h"
-#include "pycore_pystate.h"    // _PyThreadState_GET()
+#include "pycore_pystate.h"       // _PyThreadState_GET()
 #include <ctype.h>
-#include "structmember.h" /* we need the offsetof() macro from there */
+#include <stddef.h>               // offsetof()
 #include "longintrepr.h"
 
 
index 4d1ddec3822ff896377e0e7c9a4c399faa31fc95..f05a98acba043b7ffa588b9edf00a3ec483a5940 100644 (file)
@@ -2,11 +2,10 @@
 
 #define PY_SSIZE_T_CLEAN
 #include "Python.h"
-#include "pycore_abstract.h"   // _PyIndex_Check()
+#include "pycore_abstract.h"      // _PyIndex_Check()
 #include "pycore_bytes_methods.h"
 #include "pycore_object.h"
 #include "pycore_pymem.h"
-#include "structmember.h"
 #include "bytesobject.h"
 #include "pystrhex.h"
 
index ce4bf7b5ff97ce88638657c1bafc895e04eed9b4..242a6428b8ef275e557fb46675b2ec5de74bfbf2 100644 (file)
@@ -4,8 +4,8 @@
 #include "pycore_object.h"
 #include "pycore_pyerrors.h"
 #include "pycore_pymem.h"
-#include "pycore_pystate.h"   // _PyThreadState_GET()
-#include "structmember.h"
+#include "pycore_pystate.h"       // _PyThreadState_GET()
+#include "structmember.h"         // PyMemberDef
 
 #define TP_DESCR_GET(t) ((t)->tp_descr_get)
 
index da04af43a4a253761fdd9b2823ce56bb21a5fa60..737635943aced57d3404782d287eb972c6545a9c 100644 (file)
@@ -3,7 +3,7 @@
 #include "Python.h"
 #include "code.h"
 #include "opcode.h"
-#include "structmember.h"
+#include "structmember.h"         // PyMemberDef
 #include "pycore_code.h"
 #include "pycore_interp.h"        // PyInterpreterState.co_extra_freefuncs
 #include "pycore_pystate.h"       // _PyInterpreterState_GET()
index 8d1461b29b48869965b04cd6bdab74aa81745e88..a49037783be777561b013b2898f0965677f55d61 100644 (file)
@@ -6,7 +6,7 @@
 /* Submitted by Jim Hugunin */
 
 #include "Python.h"
-#include "structmember.h"
+#include "structmember.h"         // PyMemberDef
 
 /*[clinic input]
 class complex "PyComplexObject *" "&PyComplex_Type"
index fe7ba79770a6ad4e4e4e93f0f35604f987a63d86..572baa5e312d26a6bdb32c6e405e48556ce94a76 100644 (file)
@@ -5,7 +5,7 @@
 #include "pycore_object.h"
 #include "pycore_pystate.h"      // _PyThreadState_GET()
 #include "pycore_tupleobject.h"
-#include "structmember.h" /* Why is this not included in Python.h? */
+#include "structmember.h"         // PyMemberDef
 
 _Py_IDENTIFIER(getattr);
 
index cb661f84ff2de64199a0dd4b48e876c8735a092d..db1ff329ac143d6ff62aafc115b43c67d809c233 100644 (file)
@@ -9,7 +9,7 @@
 #include "pycore_initconfig.h"
 #include "pycore_object.h"
 #include "pycore_pymem.h"
-#include "structmember.h"
+#include "structmember.h"         // PyMemberDef
 #include "osdefs.h"
 
 
index 3c140acad7ea6b51fec3ae4809a369d17ad3ab8a..bdd7862b3c9d2a6fcce1d9e5351db562496d8598 100644 (file)
@@ -7,7 +7,7 @@
 #include "code.h"
 #include "frameobject.h"
 #include "opcode.h"
-#include "structmember.h"
+#include "structmember.h"         // PyMemberDef
 
 #define OFF(x) offsetof(PyFrameObject, x)
 
index af6766fbd7a9f71f2041bdd422c6e6d3d545e6e8..750c7aea0dfd6b0e3b608554d6d8b37d138dc7dc 100644 (file)
@@ -6,7 +6,7 @@
 #include "pycore_pymem.h"
 #include "pycore_tupleobject.h"
 #include "code.h"
-#include "structmember.h"
+#include "structmember.h"         // PyMemberDef
 
 PyObject *
 PyFunction_NewWithQualName(PyObject *code, PyObject *globals, PyObject *qualname)
index 49f537ef96845a61eba69283f6f75e50192e2ae8..b8ad4d7014b0c7b0439c4af4b8e74f48ac6edb7c 100644 (file)
@@ -2,7 +2,7 @@
 
 #include "Python.h"
 #include "pycore_object.h"
-#include "structmember.h"
+#include "structmember.h"         // PyMemberDef
 
 typedef struct {
     PyObject_HEAD
@@ -118,7 +118,7 @@ ga_repr(PyObject *self)
 
     _PyUnicodeWriter writer;
     _PyUnicodeWriter_Init(&writer);
-    
+
     if (ga_repr_item(&writer, alias->origin) < 0) {
         goto error;
     }
index b1a749d140e824873488b78301a1abd2d8d8e625..66c6ccba0c490a49357ab0f4c5701c752d6bb7fa 100644 (file)
@@ -1,11 +1,11 @@
 /* Generator object implementation */
 
 #include "Python.h"
-#include "pycore_ceval.h"     // _PyEval_EvalFrame()
+#include "pycore_ceval.h"         // _PyEval_EvalFrame()
 #include "pycore_object.h"
-#include "pycore_pystate.h"   // _PyThreadState_GET()
+#include "pycore_pystate.h"       // _PyThreadState_GET()
 #include "frameobject.h"
-#include "structmember.h"
+#include "structmember.h"         // PyMemberDef
 #include "opcode.h"
 
 static PyObject *gen_close(PyGenObject *, PyObject *);
index 4b4927db8209435b9e39071645b726a1e5e64edf..f4836713162250b4040073a36742558137fefef7 100644 (file)
@@ -2,12 +2,12 @@
 /* Method object implementation */
 
 #include "Python.h"
-#include "pycore_ceval.h"     // _Py_EnterRecursiveCall()
+#include "pycore_ceval.h"         // _Py_EnterRecursiveCall()
 #include "pycore_object.h"
 #include "pycore_pyerrors.h"
 #include "pycore_pymem.h"
-#include "pycore_pystate.h"   // _PyThreadState_GET()
-#include "structmember.h"
+#include "pycore_pystate.h"       // _PyThreadState_GET()
+#include "structmember.h"         // PyMemberDef
 
 /* undefine macro trampoline to PyCFunction_NewEx */
 #undef PyCFunction_New
index 499ce09ae6b5b83e49313fbf0761d13d49a149a0..ee4ed97588e29e6c41036b9604896582aa3267c2 100644 (file)
@@ -2,9 +2,9 @@
 /* Module object implementation */
 
 #include "Python.h"
-#include "pycore_interp.h"    // PyInterpreterState.importlib
-#include "pycore_pystate.h"   // _PyInterpreterState_GET()
-#include "structmember.h"
+#include "pycore_interp.h"        // PyInterpreterState.importlib
+#include "pycore_pystate.h"       // _PyInterpreterState_GET()
+#include "structmember.h"         // PyMemberDef
 
 static Py_ssize_t max_module_number;
 
index a28b9e509fcfb0976e89bec9f60f9c80e085262d..29141a81d71ec5b0604d2bc735637ba4bcb5043c 100644 (file)
@@ -1,7 +1,7 @@
 // namespace object implementation
 
 #include "Python.h"
-#include "structmember.h"
+#include "structmember.h"         // PyMemberDef
 
 
 typedef struct {
index 2fcaa478765136b2ce790a318155218a9fa3509e..d5bf499575d097a6636eaccfab4e48ba1e67138d 100644 (file)
@@ -466,7 +466,7 @@ later:
 
 #include "Python.h"
 #include "pycore_object.h"
-#include "structmember.h"
+#include <stddef.h>               // offsetof()
 #include "dict-common.h"
 #include <stddef.h>
 
index 4bea8d78e12fa9207f5d74e69c0e37966101ff92..751dbb9815d822b195614ba6011d861b324046fa 100644 (file)
@@ -3,7 +3,7 @@
 #include "Python.h"
 #include "pycore_abstract.h"   // _PyIndex_Check()
 #include "pycore_tupleobject.h"
-#include "structmember.h"
+#include "structmember.h"         // PyMemberDef
 
 /* Support objects whose length is > PY_SSIZE_T_MAX.
 
index 0b15bedeb4ff37f65335f59b6d8d4da971c688f2..8452546008bd1eafd67d89102e8e582f5079d8da 100644 (file)
@@ -32,8 +32,8 @@
 */
 
 #include "Python.h"
-#include "pycore_object.h"   // _PyObject_GC_UNTRACK()
-#include "structmember.h"
+#include "pycore_object.h"        // _PyObject_GC_UNTRACK()
+#include <stddef.h>               // offsetof()
 
 /* Object used as dummy key to fill deleted entries */
 static PyObject _dummy_struct;
index 0a5f00dbe0a3989b5969a5938057d37d219b150b..6093b3bd1534dfde8f18d4d8df5b0073c21df834 100644 (file)
@@ -14,10 +14,10 @@ this type and there is exactly one in existence.
 */
 
 #include "Python.h"
-#include "pycore_abstract.h"   // _PyIndex_Check()
+#include "pycore_abstract.h"      // _PyIndex_Check()
 #include "pycore_object.h"
 #include "pycore_pymem.h"
-#include "structmember.h"
+#include "structmember.h"         // PyMemberDef
 
 static PyObject *
 ellipsis_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
index 1865e2461a2f47697dd018701d27261e93aad647..9bdda87ae0be073dc5ee4a964aa952cf9466fe23 100644 (file)
@@ -10,7 +10,7 @@
 #include "Python.h"
 #include "pycore_tupleobject.h"
 #include "pycore_object.h"
-#include "structmember.h"
+#include "structmember.h"         // PyMemberDef
 
 static const char visible_length_key[] = "n_sequence_fields";
 static const char real_length_key[] = "n_fields";
index 47766bf6fbbbfbf860ff46c9a5012f7d5c2a6e04..a107715808fffadcb4aaa977015f479ae7cdca85 100644 (file)
@@ -5,9 +5,9 @@
 #include "pycore_initconfig.h"
 #include "pycore_object.h"
 #include "pycore_pyerrors.h"
-#include "pycore_pystate.h"     // _PyThreadState_GET()
+#include "pycore_pystate.h"       // _PyThreadState_GET()
 #include "frameobject.h"
-#include "structmember.h"
+#include "structmember.h"         // PyMemberDef
 
 #include <ctype.h>
 
index dd9b789823512450b8cf4a0864191bb979b29a22..9640d93aaf2dafbdbfe66b8364167d0adb3339a0 100644 (file)
@@ -1,6 +1,6 @@
 #include "Python.h"
-#include "pycore_object.h"   // _PyObject_GET_WEAKREFS_LISTPTR
-#include "structmember.h"
+#include "pycore_object.h"        // _PyObject_GET_WEAKREFS_LISTPTR()
+#include "structmember.h"         // PyMemberDef
 
 
 #define GET_WEAKREFS_LISTPTR(o) \
index ec2f607d4a818c663b727c3f85595e1c64e1d02b..3e13e75826f1576cdf5539e4937f8b291e2c3026 100644 (file)
@@ -14,8 +14,8 @@
 
 #define PY_SSIZE_T_CLEAN
 #include "Python.h"
-#include "structmember.h"
-#include "windows.h"
+#include "structmember.h"         // PyMemberDef
+#include <windows.h>
 
 static BOOL PyHKEY_AsHKEY(PyObject *ob, HKEY *pRes, BOOL bNoneOK);
 static BOOL clinic_HKEY_converter(PyObject *ob, void *p);
index bd22fb6bf73fe41cba860f55a1e1e110e8f23a1f..c98f949042f306bdc90315a094f628bdf74039f5 100755 (executable)
@@ -1428,7 +1428,7 @@ def main(srcfile, dump_module=False):
             f.write('\n')
             f.write('#include "Python.h"\n')
             f.write('#include "%s-ast.h"\n' % mod.name)
-            f.write('#include "structmember.h"\n')
+            f.write('#include "structmember.h"         // PyMemberDef\n')
             f.write('\n')
 
             generate_module_def(f, mod)
index 488276a4555464b66e611e9a0924dc4f38c96ad9..80f91646fd62e4f5b170e0108a766d6948ff7e07 100644 (file)
@@ -4,7 +4,7 @@
 
 #include "Python.h"
 #include "Python-ast.h"
-#include "structmember.h"
+#include "structmember.h"         // PyMemberDef
 
 typedef struct {
     int initialized;
index 5e5435671937726819002449c5a0d73f927c2d27..59765d850ba1dbee066e522c130bd14c49a53441 100644 (file)
@@ -29,7 +29,6 @@
 #include "opcode.h"
 #include "pydtrace.h"
 #include "setobject.h"
-#include "structmember.h"
 
 #include <ctype.h>
 
index 15749e9fd7741931b50d1fbaa642369c6fd4dc7c..f0217f280180a1e480d83040ce4ec6cd2b50c4d4 100644 (file)
@@ -6,7 +6,7 @@
 #include "pycore_object.h"
 #include "pycore_pyerrors.h"
 #include "pycore_pystate.h"       // _PyThreadState_GET()
-#include "structmember.h"
+#include "structmember.h"         // PyMemberDef
 
 
 #define CONTEXT_FREELIST_MAXLEN 255
index 9924e3351243e18a52329d9c65b8a10f4a92b40c..8801c5ea418c7f5694767760b9799e25caa4fc4d 100644 (file)
@@ -1,8 +1,8 @@
 #include "Python.h"
 
 #include "pycore_hamt.h"
-#include "pycore_object.h"   // _PyObject_GC_TRACK()
-#include "structmember.h"
+#include "pycore_object.h"        // _PyObject_GC_TRACK()
+#include <stddef.h>               // offsetof()
 
 /*
 This file provides an implementation of an immutable mapping using the
index e653d0277c1a106398546b832677bb865faea9ee..ba88e15f9386911d31eee3b76e02db9148e0b352 100644 (file)
@@ -2,8 +2,7 @@
 /* Map C struct members to Python object attributes */
 
 #include "Python.h"
-
-#include "structmember.h"
+#include "structmember.h"         // PyMemberDef
 
 PyObject *
 PyMember_GetOne(const char *addr, PyMemberDef *l)
index a3c5d650d1edc6ef3137a1458f0ec277b5f3b718..d192f31deefb77ae03f0aac11930ccf3b8455b5e 100644 (file)
@@ -2,7 +2,7 @@
 #include "pycore_pystate.h"   // _PyThreadState_GET()
 #include "symtable.h"
 #undef Yield   /* undefine macro conflicting with <winbase.h> */
-#include "structmember.h"
+#include "structmember.h"         // PyMemberDef
 
 /* error strings used for warnings */
 #define GLOBAL_PARAM \
index 610c2172ef833ca383b1c00fbf227a7d0e1c827d..e3397ecfe48f50e4546953ae3f6c7c28ef5ab4a2 100644 (file)
@@ -5,7 +5,7 @@
 
 #include "code.h"
 #include "frameobject.h"
-#include "structmember.h"
+#include "structmember.h"         // PyMemberDef
 #include "osdefs.h"
 #ifdef HAVE_FCNTL_H
 #include <fcntl.h>