summaryrefslogtreecommitdiffstats
path: root/Include/cpython/unicodeobject.h
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2022-05-17 17:45:55 (GMT)
committerGitHub <noreply@github.com>2022-05-17 17:45:55 (GMT)
commit1df455042d610afac71e792ae2689060dd43178e (patch)
treed6913521bbe657c1e0a341a1801399c38b83e441 /Include/cpython/unicodeobject.h
parent38d95b5500fa2d84d718c4190ba2f1b2f6806e6c (diff)
downloadcpython-1df455042d610afac71e792ae2689060dd43178e.zip
cpython-1df455042d610afac71e792ae2689060dd43178e.tar.gz
cpython-1df455042d610afac71e792ae2689060dd43178e.tar.bz2
gh-89653: PEP 670: Fix PyUnicode_READ() cast (GH-92872)
_Py_CAST() cannot be used with a constant type: use _Py_STATIC_CAST() instead. (cherry picked from commit e6fd7992a92879103215b3e9f218fe07212af9b1) Co-authored-by: Victor Stinner <vstinner@python.org>
Diffstat (limited to 'Include/cpython/unicodeobject.h')
-rw-r--r--Include/cpython/unicodeobject.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/Include/cpython/unicodeobject.h b/Include/cpython/unicodeobject.h
index 8ec2fcc..84307d1 100644
--- a/Include/cpython/unicodeobject.h
+++ b/Include/cpython/unicodeobject.h
@@ -407,7 +407,8 @@ static inline Py_UCS4 PyUnicode_READ(int kind,
}
#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 < 0x030b0000
#define PyUnicode_READ(kind, data, index) \
- PyUnicode_READ(_Py_STATIC_CAST(int, kind), _Py_CAST(const void*, data), \
+ PyUnicode_READ(_Py_STATIC_CAST(int, kind), \
+ _Py_STATIC_CAST(const void*, data), \
(index))
#endif