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/objimpl.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/objimpl.h')
| -rw-r--r-- | Include/objimpl.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Include/objimpl.h b/Include/objimpl.h index c455d4b..1c50d8b 100644 --- a/Include/objimpl.h +++ b/Include/objimpl.h @@ -258,7 +258,7 @@ PyAPI_FUNC(Py_ssize_t) _PyGC_CollectIfEnabled(void); PyAPI_FUNC(PyVarObject *) _PyObject_GC_Resize(PyVarObject *, Py_ssize_t); #define PyObject_GC_Resize(type, op, n) \ - ( (type *) _PyObject_GC_Resize((PyVarObject *)(op), (n)) ) + ( (type *) _PyObject_GC_Resize(_PyVarObject_CAST(op), (n)) ) #ifndef Py_LIMITED_API @@ -356,7 +356,7 @@ PyAPI_FUNC(void) PyObject_GC_Del(void *); #define Py_VISIT(op) \ do { \ if (op) { \ - int vret = visit((PyObject *)(op), arg); \ + int vret = visit(_PyObject_CAST(op), arg); \ if (vret) \ return vret; \ } \ |
