summaryrefslogtreecommitdiffstats
path: root/Include/internal
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@redhat.com>2018-11-22 01:57:29 (GMT)
committerGitHub <noreply@github.com>2018-11-22 01:57:29 (GMT)
commit2ff8fb7639a86757c00a7cbbe7da418fffec3870 (patch)
tree05ca8342faadc9cb406fc1b0c7ac6ae44543eec8 /Include/internal
parent271753a27aca2e13275f0827080b915fb438107a (diff)
downloadcpython-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/internal')
-rw-r--r--Include/internal/pycore_object.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/Include/internal/pycore_object.h b/Include/internal/pycore_object.h
index 347ab68..a88b626 100644
--- a/Include/internal/pycore_object.h
+++ b/Include/internal/pycore_object.h
@@ -42,7 +42,7 @@ static inline void _PyObject_GC_TRACK_impl(const char *filename, int lineno,
}
#define _PyObject_GC_TRACK(op) \
- _PyObject_GC_TRACK_impl(__FILE__, __LINE__, (PyObject *)(op))
+ _PyObject_GC_TRACK_impl(__FILE__, __LINE__, _PyObject_CAST(op))
/* Tell the GC to stop tracking this object.
*
@@ -70,7 +70,7 @@ static inline void _PyObject_GC_UNTRACK_impl(const char *filename, int lineno,
}
#define _PyObject_GC_UNTRACK(op) \
- _PyObject_GC_UNTRACK_impl(__FILE__, __LINE__, (PyObject *)(op))
+ _PyObject_GC_UNTRACK_impl(__FILE__, __LINE__, _PyObject_CAST(op))
#ifdef __cplusplus
}