X Tutup
Skip to content

Commit 4a21e57

Browse files
authored
bpo-40268: Remove unused structmember.h includes (pythonGH-19530)
If only offsetof() is needed: include stddef.h instead. When structmember.h is used, add a comment explaining that PyMemberDef is used.
1 parent 62183b8 commit 4a21e57

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

78 files changed

+99
-111
lines changed

Modules/_abc.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
/* ABCMeta implementation */
22

33
#include "Python.h"
4-
#include "structmember.h"
54
#include "clinic/_abc.c.h"
65

76
/*[clinic input]

Modules/_asynciomodule.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#include "Python.h"
2-
#include "structmember.h"
2+
#include <stddef.h> // offsetof()
33

44

55
/*[clinic input]

Modules/_bz2module.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#define PY_SSIZE_T_CLEAN
44

55
#include "Python.h"
6-
#include "structmember.h"
6+
#include "structmember.h" // PyMemberDef
77

88
#include <bzlib.h>
99
#include <stdio.h>

Modules/_collectionsmodule.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
#include "Python.h"
2-
#include "structmember.h"
2+
#include "structmember.h" // PyMemberDef
33

44
#ifdef STDC_HEADERS
55
#include <stddef.h>
66
#else
7-
#include <sys/types.h> /* For size_t */
7+
#include <sys/types.h> // size_t
88
#endif
99

1010
/*[clinic input]

Modules/_csv.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ module instead.
1111
#define MODULE_VERSION "1.0"
1212

1313
#include "Python.h"
14-
#include "structmember.h"
14+
#include "structmember.h" // PyMemberDef
1515
#include <stdbool.h>
1616

1717

Modules/_ctypes/_ctypes.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ bytes(cdata)
102102
#define PY_SSIZE_T_CLEAN
103103

104104
#include "Python.h"
105-
#include "structmember.h"
105+
#include "structmember.h" // PyMemberDef
106106

107107
#include <ffi.h>
108108
#ifdef MS_WIN32

Modules/_ctypes/callproc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
*/
5656

5757
#include "Python.h"
58-
#include "structmember.h"
58+
#include "structmember.h" // PyMemberDef
5959

6060
#ifdef MS_WIN32
6161
#include <windows.h>
@@ -751,7 +751,7 @@ static int ConvParam(PyObject *obj, Py_ssize_t index, struct argument *pa)
751751
#if defined(MS_WIN32) && !defined(_WIN32_WCE)
752752
/*
753753
Per: https://msdn.microsoft.com/en-us/library/7572ztz4.aspx
754-
To be returned by value in RAX, user-defined types must have a length
754+
To be returned by value in RAX, user-defined types must have a length
755755
of 1, 2, 4, 8, 16, 32, or 64 bits
756756
*/
757757
int can_return_struct_as_int(size_t s)

Modules/_datetimemodule.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
#include "Python.h"
1111
#include "datetime.h"
12-
#include "structmember.h"
12+
#include "structmember.h" // PyMemberDef
1313

1414
#include <time.h>
1515

Modules/_decimal/_decimal.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828

2929
#include <Python.h>
3030
#include "longintrepr.h"
31-
#include "structmember.h"
3231
#include "complexobject.h"
3332
#include "mpdecimal.h"
3433

Modules/_elementtree.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
#define PY_SSIZE_T_CLEAN
1515

1616
#include "Python.h"
17-
#include "structmember.h"
17+
#include "structmember.h" // PyMemberDef
1818

1919
/* -------------------------------------------------------------------- */
2020
/* configuration */

0 commit comments

Comments
 (0)
X Tutup