Skip to content

Commit

Permalink
pythongh-104922: remove PY_SSIZE_T_CLEAN (python#106315)
Browse files Browse the repository at this point in the history
  • Loading branch information
methane authored Jul 2, 2023
1 parent 8571b27 commit d5bd32f
Show file tree
Hide file tree
Showing 64 changed files with 0 additions and 90 deletions.
1 change: 0 additions & 1 deletion Modules/_bisectmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ Converted to C by Dmitry Vasiliev (dima at hlabs.spb.ru).
# define Py_BUILD_CORE_MODULE 1
#endif

#define PY_SSIZE_T_CLEAN
#include "Python.h"
#include "pycore_call.h" // _PyObject_CallMethod()

Expand Down
2 changes: 0 additions & 2 deletions Modules/_bz2module.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
/* _bz2 - Low-level Python interface to libbzip2. */

#define PY_SSIZE_T_CLEAN

#include "Python.h"
#include "structmember.h" // PyMemberDef

Expand Down
1 change: 0 additions & 1 deletion Modules/_codecsmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ Copyright (c) Corporation for National Research Initiatives.
------------------------------------------------------------------------ */

#define PY_SSIZE_T_CLEAN
#include "Python.h"
#include "pycore_codecs.h" // _PyCodec_Lookup()

Expand Down
1 change: 0 additions & 1 deletion Modules/_ctypes/_ctypes.c
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@ bytes(cdata)
#ifndef Py_BUILD_CORE_BUILTIN
# define Py_BUILD_CORE_MODULE 1
#endif
#define PY_SSIZE_T_CLEAN

#include "Python.h"
// windows.h must be included before pycore internal headers
Expand Down
2 changes: 0 additions & 2 deletions Modules/_cursesmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,6 @@ static const char PyCursesVersion[] = "2.2";
# define Py_BUILD_CORE_MODULE 1
#endif

#define PY_SSIZE_T_CLEAN

#include "Python.h"
#include "pycore_long.h" // _PyLong_GetZero()
#include "pycore_structseq.h" // _PyStructSequence_NewType()
Expand Down
1 change: 0 additions & 1 deletion Modules/_dbmmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
/* DBM module using dictionary interface */


#define PY_SSIZE_T_CLEAN
#include "Python.h"

#include <sys/types.h>
Expand Down
2 changes: 0 additions & 2 deletions Modules/_elementtree.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
*--------------------------------------------------------------------
*/

#define PY_SSIZE_T_CLEAN

#include "Python.h"
#include "structmember.h" // PyMemberDef
#include "expat.h"
Expand Down
1 change: 0 additions & 1 deletion Modules/_gdbmmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
/* Author: Anthony Baxter, after dbmmodule.c */
/* Doc strings: Mitch Chapman */

#define PY_SSIZE_T_CLEAN
#include "Python.h"
#include "gdbm.h"

Expand Down
2 changes: 0 additions & 2 deletions Modules/_hashopenssl.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@
# define Py_BUILD_CORE_MODULE 1
#endif

#define PY_SSIZE_T_CLEAN

#include "Python.h"
#include "pycore_hashtable.h"
#include "hashlib.h"
Expand Down
1 change: 0 additions & 1 deletion Modules/_io/_iomodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
Mostly written by Amaury Forgeot d'Arc
*/

#define PY_SSIZE_T_CLEAN
#include "Python.h"
#include "_iomodule.h"
#include "pycore_pystate.h" // _PyInterpreterState_GET()
Expand Down
1 change: 0 additions & 1 deletion Modules/_io/bufferedio.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
Written by Amaury Forgeot d'Arc and Antoine Pitrou
*/

#define PY_SSIZE_T_CLEAN
#include "Python.h"
#include "pycore_call.h" // _PyObject_CallNoArgs()
#include "pycore_object.h"
Expand Down
1 change: 0 additions & 1 deletion Modules/_io/fileio.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/* Author: Daniel Stutzbach */

#define PY_SSIZE_T_CLEAN
#include "Python.h"
#include "pycore_fileutils.h" // _Py_BEGIN_SUPPRESS_IPH
#include "pycore_object.h" // _PyObject_GC_UNTRACK()
Expand Down
1 change: 0 additions & 1 deletion Modules/_io/iobase.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
*/


#define PY_SSIZE_T_CLEAN
#include "Python.h"
#include "pycore_call.h" // _PyObject_CallMethod()
#include "pycore_long.h" // _PyLong_GetOne()
Expand Down
1 change: 0 additions & 1 deletion Modules/_io/stringio.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#define PY_SSIZE_T_CLEAN
#include "Python.h"
#include <stddef.h> // offsetof()
#include "pycore_object.h"
Expand Down
1 change: 0 additions & 1 deletion Modules/_io/textio.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
Written by Amaury Forgeot d'Arc and Antoine Pitrou
*/

#define PY_SSIZE_T_CLEAN
#include "Python.h"
#include "pycore_call.h" // _PyObject_CallMethod()
#include "pycore_codecs.h" // _PyCodecInfo_GetIncrementalDecoder()
Expand Down
1 change: 0 additions & 1 deletion Modules/_io/winconsoleio.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
Written by Steve Dower
*/

#define PY_SSIZE_T_CLEAN
#include "Python.h"
#include "pycore_fileutils.h" // _Py_BEGIN_SUPPRESS_IPH
#include "pycore_object.h" // _PyObject_GC_UNTRACK()
Expand Down
1 change: 0 additions & 1 deletion Modules/_localemodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ This software comes with no warranty. Use at your own risk.
******************************************************************/

#define PY_SSIZE_T_CLEAN
#include "Python.h"
#include "pycore_fileutils.h"

Expand Down
2 changes: 0 additions & 2 deletions Modules/_lzmamodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
*/

#define PY_SSIZE_T_CLEAN

#include "Python.h"
#include "structmember.h" // PyMemberDef

Expand Down
2 changes: 0 additions & 2 deletions Modules/_multiprocessing/multiprocessing.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
#ifndef MULTIPROCESSING_H
#define MULTIPROCESSING_H

#define PY_SSIZE_T_CLEAN

#include "Python.h"
#include "structmember.h"
#include "pythread.h"
Expand Down
2 changes: 0 additions & 2 deletions Modules/_multiprocessing/posixshmem.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
posixshmem - A Python extension that provides shm_open() and shm_unlink()
*/

#define PY_SSIZE_T_CLEAN

#include <Python.h>

// for shm_open() and shm_unlink()
Expand Down
1 change: 0 additions & 1 deletion Modules/_sqlite/connection.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@

#ifndef PYSQLITE_CONNECTION_H
#define PYSQLITE_CONNECTION_H
#define PY_SSIZE_T_CLEAN
#include "Python.h"
#include "pythread.h"
#include "structmember.h"
Expand Down
1 change: 0 additions & 1 deletion Modules/_sqlite/cursor.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@

#ifndef PYSQLITE_CURSOR_H
#define PYSQLITE_CURSOR_H
#define PY_SSIZE_T_CLEAN
#include "Python.h"

#include "statement.h"
Expand Down
1 change: 0 additions & 1 deletion Modules/_sqlite/microprotocols.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
#ifndef PSYCOPG_MICROPROTOCOLS_H
#define PSYCOPG_MICROPROTOCOLS_H 1

#define PY_SSIZE_T_CLEAN
#include <Python.h>

/** exported functions **/
Expand Down
1 change: 0 additions & 1 deletion Modules/_sqlite/module.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@

#ifndef PYSQLITE_MODULE_H
#define PYSQLITE_MODULE_H
#define PY_SSIZE_T_CLEAN
#include "Python.h"

#define LEGACY_TRANSACTION_CONTROL -1
Expand Down
1 change: 0 additions & 1 deletion Modules/_sqlite/row.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@

#ifndef PYSQLITE_ROW_H
#define PYSQLITE_ROW_H
#define PY_SSIZE_T_CLEAN
#include "Python.h"

typedef struct _Row
Expand Down
1 change: 0 additions & 1 deletion Modules/_sqlite/statement.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@

#ifndef PYSQLITE_STATEMENT_H
#define PYSQLITE_STATEMENT_H
#define PY_SSIZE_T_CLEAN
#include "Python.h"

#include "connection.h"
Expand Down
1 change: 0 additions & 1 deletion Modules/_sqlite/util.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@

#ifndef PYSQLITE_UTIL_H
#define PYSQLITE_UTIL_H
#define PY_SSIZE_T_CLEAN
#include "Python.h"
#include "pythread.h"
#include "sqlite3.h"
Expand Down
2 changes: 0 additions & 2 deletions Modules/_sre/sre.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@
static const char copyright[] =
" SRE 2.2.2 Copyright (c) 1997-2002 by Secret Labs AB ";

#define PY_SSIZE_T_CLEAN

#include "Python.h"
#include "pycore_long.h" // _PyLong_GetZero()
#include "pycore_moduleobject.h" // _PyModule_GetState()
Expand Down
2 changes: 0 additions & 2 deletions Modules/_ssl.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@
#endif
#define OPENSSL_NO_DEPRECATED 1

#define PY_SSIZE_T_CLEAN

#include "Python.h"
#include "pycore_weakref.h" // _PyWeakref_GET_REF()

Expand Down
1 change: 0 additions & 1 deletion Modules/_stat.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
*
*/

#define PY_SSIZE_T_CLEAN
#include "Python.h"

#ifdef __cplusplus
Expand Down
2 changes: 0 additions & 2 deletions Modules/_struct.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
# define Py_BUILD_CORE_MODULE 1
#endif

#define PY_SSIZE_T_CLEAN

#include "Python.h"
#include "pycore_moduleobject.h" // _PyModule_GetState()
#include "structmember.h" // PyMemberDef
Expand Down
3 changes: 0 additions & 3 deletions Modules/_testbuffer.c
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
/* C Extension module to test all aspects of PEP-3118.
Written by Stefan Krah. */


#define PY_SSIZE_T_CLEAN

#include "Python.h"


Expand Down
2 changes: 0 additions & 2 deletions Modules/_testcapi/float.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#define PY_SSIZE_T_CLEAN

#include "parts.h"
#include "clinic/float.c.h"

Expand Down
2 changes: 0 additions & 2 deletions Modules/_testcapi/getargs.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
* APIs that parse and build arguments.
*/

#define PY_SSIZE_T_CLEAN

#include "parts.h"

static PyObject *
Expand Down
1 change: 0 additions & 1 deletion Modules/_testcapi/structmember.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#define PY_SSIZE_T_CLEAN
#include "parts.h"
#include <stddef.h> // for offsetof()

Expand Down
1 change: 0 additions & 1 deletion Modules/_testcapi/unicode.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#include <stddef.h> // ptrdiff_t

#define PY_SSIZE_T_CLEAN
#include "parts.h"

static struct PyModuleDef *_testcapimodule = NULL; // set at initialization
Expand Down
2 changes: 0 additions & 2 deletions Modules/_testcapimodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@
/* Always enable assertions */
#undef NDEBUG

#define PY_SSIZE_T_CLEAN

#include "Python.h"
#include "frameobject.h" // PyFrame_New
#include "marshal.h" // PyMarshal_WriteLongToFile
Expand Down
2 changes: 0 additions & 2 deletions Modules/_testclinic.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
/* Always enable assertions */
#undef NDEBUG

#define PY_SSIZE_T_CLEAN

#include "Python.h"


Expand Down
2 changes: 0 additions & 2 deletions Modules/_testinternalcapi.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@
/* Always enable assertions */
#undef NDEBUG

#define PY_SSIZE_T_CLEAN

#include "Python.h"
#include "frameobject.h"
#include "interpreteridobject.h" // _PyInterpreterID_LookUp()
Expand Down
1 change: 0 additions & 1 deletion Modules/_tkinter.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ Copyright (C) 1994 Steen Lumholt.
*/

#define PY_SSIZE_T_CLEAN
#ifndef Py_BUILD_CORE_BUILTIN
# define Py_BUILD_CORE_MODULE 1
#endif
Expand Down
2 changes: 0 additions & 2 deletions Modules/_uuidmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
* DCE compatible Universally Unique Identifier library.
*/

#define PY_SSIZE_T_CLEAN

#include "Python.h"
#if defined(HAVE_UUID_H)
// AIX, FreeBSD, libuuid with pkgconf
Expand Down
1 change: 0 additions & 1 deletion Modules/_xxtestfuzz/_xxtestfuzz.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#define PY_SSIZE_T_CLEAN
#include <Python.h>
#include <stdlib.h>
#include <inttypes.h>
Expand Down
1 change: 0 additions & 1 deletion Modules/arraymodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
# define Py_BUILD_CORE_MODULE 1
#endif

#define PY_SSIZE_T_CLEAN
#include "Python.h"
#include "pycore_call.h" // _PyObject_CallMethod()
#include "pycore_moduleobject.h" // _PyModule_GetState()
Expand Down
2 changes: 0 additions & 2 deletions Modules/binascii.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,6 @@
# define Py_BUILD_CORE_MODULE 1
#endif

#define PY_SSIZE_T_CLEAN

#include "Python.h"
#include "pycore_long.h" // _PyLong_DigitValue
#include "pycore_strhex.h" // _Py_strhex_bytes_with_sep()
Expand Down
1 change: 0 additions & 1 deletion Modules/cjkcodecs/cjkcodecs.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
#ifndef _CJKCODECS_H_
#define _CJKCODECS_H_

#define PY_SSIZE_T_CLEAN
#include "Python.h"
#include "multibytecodec.h"

Expand Down
1 change: 0 additions & 1 deletion Modules/cjkcodecs/multibytecodec.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
* Written by Hye-Shik Chang <perky@FreeBSD.org>
*/

#define PY_SSIZE_T_CLEAN
#include "Python.h"
#include "structmember.h" // PyMemberDef
#include "multibytecodec.h"
Expand Down
3 changes: 0 additions & 3 deletions Modules/fcntlmodule.c
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@

/* fcntl module */

#define PY_SSIZE_T_CLEAN

#include "Python.h"

#ifdef HAVE_SYS_FILE_H
Expand Down
1 change: 0 additions & 1 deletion Modules/itertoolsmodule.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#define PY_SSIZE_T_CLEAN
#include "Python.h"
#include "pycore_call.h" // _PyObject_CallNoArgs()
#include "pycore_long.h" // _PyLong_GetZero()
Expand Down
1 change: 0 additions & 1 deletion Modules/mmapmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
# define Py_BUILD_CORE_MODULE 1
#endif

#define PY_SSIZE_T_CLEAN
#include <Python.h>
#include "pycore_bytesobject.h" // _PyBytes_Find()
#include "pycore_fileutils.h" // _Py_stat_struct
Expand Down
Loading

0 comments on commit d5bd32f

Please sign in to comment.