]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-89653: PEP 670: Convert unicodeobject.h macros to functions (#91773)
authorVictor Stinner <vstinner@python.org>
Thu, 21 Apr 2022 19:53:18 +0000 (21:53 +0200)
committerGitHub <noreply@github.com>
Thu, 21 Apr 2022 19:53:18 +0000 (21:53 +0200)
commit128d6241176a879ea9b6e34ea67f1d113d22a1b8
treee7ff7c3dbc0e7cf0e499fedd8b9be03b4114af10
parentf8dc6186d1857a19edd182277a9d78e6d6cc3787
gh-89653: PEP 670: Convert unicodeobject.h macros to functions (#91773)

Convert unicodeobject.h macros to static inline functions:

* PyUnicode_MAX_CHAR_VALUE()
* PyUnicode_READ()
* PyUnicode_READY()
* PyUnicode_READ_CHAR()
* PyUnicode_WRITE()

Move PyUnicode_READY() after _PyUnicode_Ready(), since it uses
_PyUnicode_Ready().

Static inline functions are wrapped by macros which casts arguments
with _PyObject_CAST() and casts 'kind' arguments to "unsigned int" to
prevent introducing new compiler warnings when passing "const
PyObject*".
Include/cpython/unicodeobject.h