summaryrefslogtreecommitdiffstats
path: root/Include/cpython/tupleobject.h
Commit message (Collapse)AuthorAgeFilesLines
* gh-87347: Add parenthesis around macro arguments (#93915)Victor Stinner2022-06-201-2/+2
| | | Add unit test on Py_MEMBER_SIZE() and some other macros.
* gh-89653: PEP 670: Macros always cast arguments in cpython/ (#93766)Victor Stinner2022-06-131-5/+1
| | | | Header files in the Include/cpython/ are only included if the Py_LIMITED_API macro is not defined.
* gh-89653: PEP 670: Use PyObject* type for parameters (#92694)Victor Stinner2022-05-111-6/+8
| | | | | | | | | Use the PyObject* type for parameters of static inline functions: * Py_SIZE(): same parameter type than PyObject_Size() * PyList_GET_SIZE(), PyList_SET_ITEM(): same parameter type than PyList_Size() and PyList_SetItem() * PyTuple_GET_SIZE(), PyTuple_SET_ITEM(): same parameter type than PyTuple_Size() and PyTuple_SetItem().
* gh-89653: PEP 670: Limited API doesn't cast arguments (#92654)Victor Stinner2022-05-111-1/+5
| | | | | | | | The limited API version 3.11 no longer casts arguments to expected types of functions of functions: * PyList_GET_SIZE(), PyList_SET_ITEM() * PyTuple_GET_SIZE(), PyTuple_SET_ITEM() * PyWeakref_GET_OBJECT()
* gh-92135: Rename _Py_reinterpret_cast() to _Py_CAST() (#92230)Victor Stinner2022-05-031-1/+1
| | | Rename also _Py_static_cast() to _Py_STATIC_CAST().
* gh-91320: Add _Py_reinterpret_cast() macro (#91959)Victor Stinner2022-04-271-1/+2
| | | | | | | | | | | | | | Fix C++ compiler warnings about "old-style cast" (g++ -Wold-style-cast) in the Python C API. Use C++ reinterpret_cast<> and static_cast<> casts when the Python C API is used in C++. Example of fixed warning: Include/object.h:107:43: error: use of old-style cast to ‘PyObject*’ {aka ‘struct _object*’} [-Werror=old-style-cast] #define _PyObject_CAST(op) ((PyObject*)(op)) Add _Py_reinterpret_cast() and _Py_static_cast() macros.
* gh-89653: PEP 670: Convert tuple macros to functions (#91786)Victor Stinner2022-04-211-6/+14
| | | | | | | | | | | | | | Convert macros to static inline functions: * PyTuple_GET_SIZE() * PyTuple_SET_ITEM() * PyList_GET_SIZE() * PyList_SET_ITEM() Add a macro converting arguments to PyTupleObject*, PyListObject* or PyObject* to prevent emitting new compiler warnings. According to PEP 670, PyTuple_GET_ITEM() and PyList_GET_ITEM() are left as macros.
* bpo-45476: Add _Py_RVALUE() macro (GH-29860)Victor Stinner2021-11-301-1/+1
| | | | | | | | | | | | | | | | | | Add a new _Py_RVALUE() macro to prevent using an expression as an l-value. Replace a "(void)" cast with the _Py_RVALUE() macro in the following macros: * PyCell_SET() * PyList_SET_ITEM() * PyTuple_SET_ITEM() * _PyGCHead_SET_FINALIZED() * _PyGCHead_SET_NEXT() * asdl_seq_SET() * asdl_seq_SET_UNTYPED() Add also parentheses around macro arguments in PyCell_SET() and PyTuple_SET_ITEM() macros.
* bpo-30459: Cast the result of PyList_SET_ITEM() to void (GH-19975)Zackery Spytz2020-12-051-1/+1
| | | Do the same for PyTuple_SET_ITEM().
* bpo-39583: Remove superfluous "extern C" bits from Include/cpython/*.h ↵Skip Montanaro2020-06-011-8/+0
| | | | (GH-18413)
* bpo-35134: Create Include/cpython/tupleobject.h (GH-10764)Victor Stinner2018-11-281-0/+36
Move tupleobject.h code surrounded by "#ifndef Py_LIMITED_API" to a new Include/cpython/tupleobject.h header file. Add cpython/ header files to Makefile.pre.in and pythoncore project of PCbuild.