]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-89653: PEP 670: Convert unicodeobject.h macros to functions (#91705)
authorVictor Stinner <vstinner@python.org>
Thu, 21 Apr 2022 00:51:17 +0000 (02:51 +0200)
committerGitHub <noreply@github.com>
Thu, 21 Apr 2022 00:51:17 +0000 (02:51 +0200)
commit4e52c66f6940a63ef7a62faf8ce32a980ac5aa2c
tree3d7e47259d9050e29fa90d6ab126796518f653e9
parent25e35742ce247d10abf2f59d9fef1d88e4a46fc3
gh-89653: PEP 670: Convert unicodeobject.h macros to functions (#91705)

Convert unicodeobject.h macros to static inline functions:

* PyUnicode_CHECK_INTERNED()
* PyUnicode_DATA(), _PyUnicode_COMPACT_DATA(),
  _PyUnicode_NONCOMPACT_DATA()
* PyUnicode_GET_LENGTH()
* PyUnicode_IS_ASCII()
* PyUnicode_IS_COMPACT()
* PyUnicode_IS_COMPACT_ASCII()
* PyUnicode_IS_READY()

Reorder functions to declare functions before their first usage.

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