Skip to content

Commit d5bd32f

Browse files
authored
gh-104922: remove PY_SSIZE_T_CLEAN (#106315)
1 parent 8571b27 commit d5bd32f

Some content is hidden

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

64 files changed

+0
-90
lines changed

Modules/_bisectmodule.c

-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ Converted to C by Dmitry Vasiliev (dima at hlabs.spb.ru).
77
# define Py_BUILD_CORE_MODULE 1
88
#endif
99

10-
#define PY_SSIZE_T_CLEAN
1110
#include "Python.h"
1211
#include "pycore_call.h" // _PyObject_CallMethod()
1312

Modules/_bz2module.c

-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
/* _bz2 - Low-level Python interface to libbzip2. */
22

3-
#define PY_SSIZE_T_CLEAN
4-
53
#include "Python.h"
64
#include "structmember.h" // PyMemberDef
75

Modules/_codecsmodule.c

-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ Copyright (c) Corporation for National Research Initiatives.
3030
3131
------------------------------------------------------------------------ */
3232

33-
#define PY_SSIZE_T_CLEAN
3433
#include "Python.h"
3534
#include "pycore_codecs.h" // _PyCodec_Lookup()
3635

Modules/_ctypes/_ctypes.c

-1
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,6 @@ bytes(cdata)
101101
#ifndef Py_BUILD_CORE_BUILTIN
102102
# define Py_BUILD_CORE_MODULE 1
103103
#endif
104-
#define PY_SSIZE_T_CLEAN
105104

106105
#include "Python.h"
107106
// windows.h must be included before pycore internal headers

Modules/_cursesmodule.c

-2
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,6 @@ static const char PyCursesVersion[] = "2.2";
104104
# define Py_BUILD_CORE_MODULE 1
105105
#endif
106106

107-
#define PY_SSIZE_T_CLEAN
108-
109107
#include "Python.h"
110108
#include "pycore_long.h" // _PyLong_GetZero()
111109
#include "pycore_structseq.h" // _PyStructSequence_NewType()

Modules/_dbmmodule.c

-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
/* DBM module using dictionary interface */
33

44

5-
#define PY_SSIZE_T_CLEAN
65
#include "Python.h"
76

87
#include <sys/types.h>

Modules/_elementtree.c

-2
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@
1111
*--------------------------------------------------------------------
1212
*/
1313

14-
#define PY_SSIZE_T_CLEAN
15-
1614
#include "Python.h"
1715
#include "structmember.h" // PyMemberDef
1816
#include "expat.h"

Modules/_gdbmmodule.c

-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
/* Author: Anthony Baxter, after dbmmodule.c */
44
/* Doc strings: Mitch Chapman */
55

6-
#define PY_SSIZE_T_CLEAN
76
#include "Python.h"
87
#include "gdbm.h"
98

Modules/_hashopenssl.c

-2
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@
2222
# define Py_BUILD_CORE_MODULE 1
2323
#endif
2424

25-
#define PY_SSIZE_T_CLEAN
26-
2725
#include "Python.h"
2826
#include "pycore_hashtable.h"
2927
#include "hashlib.h"

Modules/_io/_iomodule.c

-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
Mostly written by Amaury Forgeot d'Arc
88
*/
99

10-
#define PY_SSIZE_T_CLEAN
1110
#include "Python.h"
1211
#include "_iomodule.h"
1312
#include "pycore_pystate.h" // _PyInterpreterState_GET()

Modules/_io/bufferedio.c

-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
Written by Amaury Forgeot d'Arc and Antoine Pitrou
88
*/
99

10-
#define PY_SSIZE_T_CLEAN
1110
#include "Python.h"
1211
#include "pycore_call.h" // _PyObject_CallNoArgs()
1312
#include "pycore_object.h"

Modules/_io/fileio.c

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
/* Author: Daniel Stutzbach */
22

3-
#define PY_SSIZE_T_CLEAN
43
#include "Python.h"
54
#include "pycore_fileutils.h" // _Py_BEGIN_SUPPRESS_IPH
65
#include "pycore_object.h" // _PyObject_GC_UNTRACK()

Modules/_io/iobase.c

-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
*/
99

1010

11-
#define PY_SSIZE_T_CLEAN
1211
#include "Python.h"
1312
#include "pycore_call.h" // _PyObject_CallMethod()
1413
#include "pycore_long.h" // _PyLong_GetOne()

Modules/_io/stringio.c

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
#define PY_SSIZE_T_CLEAN
21
#include "Python.h"
32
#include <stddef.h> // offsetof()
43
#include "pycore_object.h"

Modules/_io/textio.c

-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
Written by Amaury Forgeot d'Arc and Antoine Pitrou
77
*/
88

9-
#define PY_SSIZE_T_CLEAN
109
#include "Python.h"
1110
#include "pycore_call.h" // _PyObject_CallMethod()
1211
#include "pycore_codecs.h" // _PyCodecInfo_GetIncrementalDecoder()

Modules/_io/winconsoleio.c

-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
Written by Steve Dower
77
*/
88

9-
#define PY_SSIZE_T_CLEAN
109
#include "Python.h"
1110
#include "pycore_fileutils.h" // _Py_BEGIN_SUPPRESS_IPH
1211
#include "pycore_object.h" // _PyObject_GC_UNTRACK()

Modules/_localemodule.c

-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ This software comes with no warranty. Use at your own risk.
99
1010
******************************************************************/
1111

12-
#define PY_SSIZE_T_CLEAN
1312
#include "Python.h"
1413
#include "pycore_fileutils.h"
1514

Modules/_lzmamodule.c

-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
66
*/
77

8-
#define PY_SSIZE_T_CLEAN
9-
108
#include "Python.h"
119
#include "structmember.h" // PyMemberDef
1210

Modules/_multiprocessing/multiprocessing.h

-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
#ifndef MULTIPROCESSING_H
22
#define MULTIPROCESSING_H
33

4-
#define PY_SSIZE_T_CLEAN
5-
64
#include "Python.h"
75
#include "structmember.h"
86
#include "pythread.h"

Modules/_multiprocessing/posixshmem.c

-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
posixshmem - A Python extension that provides shm_open() and shm_unlink()
33
*/
44

5-
#define PY_SSIZE_T_CLEAN
6-
75
#include <Python.h>
86

97
// for shm_open() and shm_unlink()

Modules/_sqlite/connection.h

-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323

2424
#ifndef PYSQLITE_CONNECTION_H
2525
#define PYSQLITE_CONNECTION_H
26-
#define PY_SSIZE_T_CLEAN
2726
#include "Python.h"
2827
#include "pythread.h"
2928
#include "structmember.h"

Modules/_sqlite/cursor.h

-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323

2424
#ifndef PYSQLITE_CURSOR_H
2525
#define PYSQLITE_CURSOR_H
26-
#define PY_SSIZE_T_CLEAN
2726
#include "Python.h"
2827

2928
#include "statement.h"

Modules/_sqlite/microprotocols.h

-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
#ifndef PSYCOPG_MICROPROTOCOLS_H
2727
#define PSYCOPG_MICROPROTOCOLS_H 1
2828

29-
#define PY_SSIZE_T_CLEAN
3029
#include <Python.h>
3130

3231
/** exported functions **/

Modules/_sqlite/module.h

-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323

2424
#ifndef PYSQLITE_MODULE_H
2525
#define PYSQLITE_MODULE_H
26-
#define PY_SSIZE_T_CLEAN
2726
#include "Python.h"
2827

2928
#define LEGACY_TRANSACTION_CONTROL -1

Modules/_sqlite/row.h

-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323

2424
#ifndef PYSQLITE_ROW_H
2525
#define PYSQLITE_ROW_H
26-
#define PY_SSIZE_T_CLEAN
2726
#include "Python.h"
2827

2928
typedef struct _Row

Modules/_sqlite/statement.h

-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323

2424
#ifndef PYSQLITE_STATEMENT_H
2525
#define PYSQLITE_STATEMENT_H
26-
#define PY_SSIZE_T_CLEAN
2726
#include "Python.h"
2827

2928
#include "connection.h"

Modules/_sqlite/util.h

-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323

2424
#ifndef PYSQLITE_UTIL_H
2525
#define PYSQLITE_UTIL_H
26-
#define PY_SSIZE_T_CLEAN
2726
#include "Python.h"
2827
#include "pythread.h"
2928
#include "sqlite3.h"

Modules/_sre/sre.c

-2
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,6 @@
3838
static const char copyright[] =
3939
" SRE 2.2.2 Copyright (c) 1997-2002 by Secret Labs AB ";
4040

41-
#define PY_SSIZE_T_CLEAN
42-
4341
#include "Python.h"
4442
#include "pycore_long.h" // _PyLong_GetZero()
4543
#include "pycore_moduleobject.h" // _PyModule_GetState()

Modules/_ssl.c

-2
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@
2525
#endif
2626
#define OPENSSL_NO_DEPRECATED 1
2727

28-
#define PY_SSIZE_T_CLEAN
29-
3028
#include "Python.h"
3129
#include "pycore_weakref.h" // _PyWeakref_GET_REF()
3230

Modules/_stat.c

-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
*
1212
*/
1313

14-
#define PY_SSIZE_T_CLEAN
1514
#include "Python.h"
1615

1716
#ifdef __cplusplus

Modules/_struct.c

-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@
77
# define Py_BUILD_CORE_MODULE 1
88
#endif
99

10-
#define PY_SSIZE_T_CLEAN
11-
1210
#include "Python.h"
1311
#include "pycore_moduleobject.h" // _PyModule_GetState()
1412
#include "structmember.h" // PyMemberDef

Modules/_testbuffer.c

-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
/* C Extension module to test all aspects of PEP-3118.
22
Written by Stefan Krah. */
33

4-
5-
#define PY_SSIZE_T_CLEAN
6-
74
#include "Python.h"
85

96

Modules/_testcapi/float.c

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#define PY_SSIZE_T_CLEAN
2-
31
#include "parts.h"
42
#include "clinic/float.c.h"
53

Modules/_testcapi/getargs.c

-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
* APIs that parse and build arguments.
44
*/
55

6-
#define PY_SSIZE_T_CLEAN
7-
86
#include "parts.h"
97

108
static PyObject *

Modules/_testcapi/structmember.c

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
#define PY_SSIZE_T_CLEAN
21
#include "parts.h"
32
#include <stddef.h> // for offsetof()
43

Modules/_testcapi/unicode.c

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#include <stddef.h> // ptrdiff_t
22

3-
#define PY_SSIZE_T_CLEAN
43
#include "parts.h"
54

65
static struct PyModuleDef *_testcapimodule = NULL; // set at initialization

Modules/_testcapimodule.c

-2
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@
1717
/* Always enable assertions */
1818
#undef NDEBUG
1919

20-
#define PY_SSIZE_T_CLEAN
21-
2220
#include "Python.h"
2321
#include "frameobject.h" // PyFrame_New
2422
#include "marshal.h" // PyMarshal_WriteLongToFile

Modules/_testclinic.c

-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
/* Always enable assertions */
66
#undef NDEBUG
77

8-
#define PY_SSIZE_T_CLEAN
9-
108
#include "Python.h"
119

1210

Modules/_testinternalcapi.c

-2
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@
99
/* Always enable assertions */
1010
#undef NDEBUG
1111

12-
#define PY_SSIZE_T_CLEAN
13-
1412
#include "Python.h"
1513
#include "frameobject.h"
1614
#include "interpreteridobject.h" // _PyInterpreterID_LookUp()

Modules/_tkinter.c

-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ Copyright (C) 1994 Steen Lumholt.
2121
2222
*/
2323

24-
#define PY_SSIZE_T_CLEAN
2524
#ifndef Py_BUILD_CORE_BUILTIN
2625
# define Py_BUILD_CORE_MODULE 1
2726
#endif

Modules/_uuidmodule.c

-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
* DCE compatible Universally Unique Identifier library.
44
*/
55

6-
#define PY_SSIZE_T_CLEAN
7-
86
#include "Python.h"
97
#if defined(HAVE_UUID_H)
108
// AIX, FreeBSD, libuuid with pkgconf

Modules/_xxtestfuzz/_xxtestfuzz.c

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
#define PY_SSIZE_T_CLEAN
21
#include <Python.h>
32
#include <stdlib.h>
43
#include <inttypes.h>

Modules/arraymodule.c

-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
# define Py_BUILD_CORE_MODULE 1
88
#endif
99

10-
#define PY_SSIZE_T_CLEAN
1110
#include "Python.h"
1211
#include "pycore_call.h" // _PyObject_CallMethod()
1312
#include "pycore_moduleobject.h" // _PyModule_GetState()

Modules/binascii.c

-2
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,6 @@
5757
# define Py_BUILD_CORE_MODULE 1
5858
#endif
5959

60-
#define PY_SSIZE_T_CLEAN
61-
6260
#include "Python.h"
6361
#include "pycore_long.h" // _PyLong_DigitValue
6462
#include "pycore_strhex.h" // _Py_strhex_bytes_with_sep()

Modules/cjkcodecs/cjkcodecs.h

-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
#ifndef _CJKCODECS_H_
88
#define _CJKCODECS_H_
99

10-
#define PY_SSIZE_T_CLEAN
1110
#include "Python.h"
1211
#include "multibytecodec.h"
1312

Modules/cjkcodecs/multibytecodec.c

-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
* Written by Hye-Shik Chang <perky@FreeBSD.org>
55
*/
66

7-
#define PY_SSIZE_T_CLEAN
87
#include "Python.h"
98
#include "structmember.h" // PyMemberDef
109
#include "multibytecodec.h"

Modules/fcntlmodule.c

-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
1-
21
/* fcntl module */
32

4-
#define PY_SSIZE_T_CLEAN
5-
63
#include "Python.h"
74

85
#ifdef HAVE_SYS_FILE_H

Modules/itertoolsmodule.c

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
#define PY_SSIZE_T_CLEAN
21
#include "Python.h"
32
#include "pycore_call.h" // _PyObject_CallNoArgs()
43
#include "pycore_long.h" // _PyLong_GetZero()

Modules/mmapmodule.c

-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
# define Py_BUILD_CORE_MODULE 1
2323
#endif
2424

25-
#define PY_SSIZE_T_CLEAN
2625
#include <Python.h>
2726
#include "pycore_bytesobject.h" // _PyBytes_Find()
2827
#include "pycore_fileutils.h" // _Py_stat_struct

0 commit comments

Comments
 (0)