diff options
| author | Victor Stinner <vstinner@redhat.com> | 2018-11-22 01:57:29 (GMT) |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-11-22 01:57:29 (GMT) |
| commit | 2ff8fb7639a86757c00a7cbbe7da418fffec3870 (patch) | |
| tree | 05ca8342faadc9cb406fc1b0c7ac6ae44543eec8 /Include/unicodeobject.h | |
| parent | 271753a27aca2e13275f0827080b915fb438107a (diff) | |
| download | cpython-2ff8fb7639a86757c00a7cbbe7da418fffec3870.zip cpython-2ff8fb7639a86757c00a7cbbe7da418fffec3870.tar.gz cpython-2ff8fb7639a86757c00a7cbbe7da418fffec3870.tar.bz2 | |
bpo-35059: Add _PyObject_CAST() macro (GH-10645)
Add _PyObject_CAST() and _PyVarObject_CAST() macros to cast argument
to PyObject* and PyVarObject* properly.
Diffstat (limited to 'Include/unicodeobject.h')
| -rw-r--r-- | Include/unicodeobject.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Include/unicodeobject.h b/Include/unicodeobject.h index 0274de6..ffabf0e 100644 --- a/Include/unicodeobject.h +++ b/Include/unicodeobject.h @@ -380,7 +380,7 @@ PyAPI_DATA(PyTypeObject) PyUnicodeIter_Type; (assert(PyUnicode_Check(op)), \ (((PyASCIIObject *)(op))->wstr) ? \ PyUnicode_WSTR_LENGTH(op) : \ - ((void)PyUnicode_AsUnicode((PyObject *)(op)), \ + ((void)PyUnicode_AsUnicode(_PyObject_CAST(op)),\ assert(((PyASCIIObject *)(op))->wstr), \ PyUnicode_WSTR_LENGTH(op))) /* Py_DEPRECATED(3.3) */ @@ -397,7 +397,7 @@ PyAPI_DATA(PyTypeObject) PyUnicodeIter_Type; #define PyUnicode_AS_UNICODE(op) \ (assert(PyUnicode_Check(op)), \ (((PyASCIIObject *)(op))->wstr) ? (((PyASCIIObject *)(op))->wstr) : \ - PyUnicode_AsUnicode((PyObject *)(op))) + PyUnicode_AsUnicode(_PyObject_CAST(op))) /* Py_DEPRECATED(3.3) */ #define PyUnicode_AS_DATA(op) \ @@ -549,7 +549,7 @@ enum PyUnicode_Kind { #define PyUnicode_READY(op) \ (assert(PyUnicode_Check(op)), \ (PyUnicode_IS_READY(op) ? \ - 0 : _PyUnicode_Ready((PyObject *)(op)))) + 0 : _PyUnicode_Ready(_PyObject_CAST(op)))) /* Return a maximum character value which is suitable for creating another string based on op. This is always an approximation but more efficient |
