diff options
author | Victor Stinner <vstinner@python.org> | 2020-04-15 00:35:41 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-15 00:35:41 (GMT) |
commit | 4a21e57fe55076c77b0ee454e1994ca544d09dc0 (patch) | |
tree | 1c9ed1c1a467357a470cd37b98e20aa5b9878cf9 /Modules/_io | |
parent | 62183b8d6d49e59c6a98bbdaa65b7ea1415abb7f (diff) | |
download | cpython-4a21e57fe55076c77b0ee454e1994ca544d09dc0.zip cpython-4a21e57fe55076c77b0ee454e1994ca544d09dc0.tar.gz cpython-4a21e57fe55076c77b0ee454e1994ca544d09dc0.tar.bz2 |
bpo-40268: Remove unused structmember.h includes (GH-19530)
If only offsetof() is needed: include stddef.h instead.
When structmember.h is used, add a comment explaining that
PyMemberDef is used.
Diffstat (limited to 'Modules/_io')
-rw-r--r-- | Modules/_io/_iomodule.c | 1 | ||||
-rw-r--r-- | Modules/_io/bufferedio.c | 2 | ||||
-rw-r--r-- | Modules/_io/bytesio.c | 2 | ||||
-rw-r--r-- | Modules/_io/fileio.c | 2 | ||||
-rw-r--r-- | Modules/_io/iobase.c | 2 | ||||
-rw-r--r-- | Modules/_io/stringio.c | 2 | ||||
-rw-r--r-- | Modules/_io/textio.c | 6 | ||||
-rw-r--r-- | Modules/_io/winconsoleio.c | 2 |
8 files changed, 9 insertions, 10 deletions
diff --git a/Modules/_io/_iomodule.c b/Modules/_io/_iomodule.c index 571f225..d7cadac 100644 --- a/Modules/_io/_iomodule.c +++ b/Modules/_io/_iomodule.c @@ -9,7 +9,6 @@ #define PY_SSIZE_T_CLEAN #include "Python.h" -#include "structmember.h" #include "_iomodule.h" #ifdef HAVE_SYS_TYPES_H diff --git a/Modules/_io/bufferedio.c b/Modules/_io/bufferedio.c index f243ac8..f8e21f2 100644 --- a/Modules/_io/bufferedio.c +++ b/Modules/_io/bufferedio.c @@ -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] diff --git a/Modules/_io/bytesio.c b/Modules/_io/bytesio.c index f4261b3..2468f45 100644 --- a/Modules/_io/bytesio.c +++ b/Modules/_io/bytesio.c @@ -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] diff --git a/Modules/_io/fileio.c b/Modules/_io/fileio.c index 1855b83..caf91df 100644 --- a/Modules/_io/fileio.c +++ b/Modules/_io/fileio.c @@ -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> diff --git a/Modules/_io/iobase.c b/Modules/_io/iobase.c index 924ffb5..a8e55c3 100644 --- a/Modules/_io/iobase.c +++ b/Modules/_io/iobase.c @@ -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] diff --git a/Modules/_io/stringio.c b/Modules/_io/stringio.c index 9feb76e..e76152e 100644 --- a/Modules/_io/stringio.c +++ b/Modules/_io/stringio.c @@ -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" diff --git a/Modules/_io/textio.c b/Modules/_io/textio.c index 9e33c1e..1abc9ca 100644 --- a/Modules/_io/textio.c +++ b/Modules/_io/textio.c @@ -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] diff --git a/Modules/_io/winconsoleio.c b/Modules/_io/winconsoleio.c index 94760ac..a83ef37 100644 --- a/Modules/_io/winconsoleio.c +++ b/Modules/_io/winconsoleio.c @@ -12,7 +12,7 @@ #ifdef MS_WINDOWS -#include "structmember.h" +#include "structmember.h" // PyMemberDef #ifdef HAVE_SYS_TYPES_H #include <sys/types.h> #endif |