summaryrefslogtreecommitdiffstats
path: root/Include/odictobject.h
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/odictobject.h
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/odictobject.h')
-rw-r--r--Include/odictobject.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/Include/odictobject.h b/Include/odictobject.h
index 8378dc4..35aff8a 100644
--- a/Include/odictobject.h
+++ b/Include/odictobject.h
@@ -27,13 +27,13 @@ PyAPI_FUNC(int) PyODict_SetItem(PyObject *od, PyObject *key, PyObject *item);
PyAPI_FUNC(int) PyODict_DelItem(PyObject *od, PyObject *key);
/* wrappers around PyDict* functions */
-#define PyODict_GetItem(od, key) PyDict_GetItem((PyObject *)od, key)
+#define PyODict_GetItem(od, key) PyDict_GetItem(_PyObject_CAST(od), key)
#define PyODict_GetItemWithError(od, key) \
- PyDict_GetItemWithError((PyObject *)od, key)
-#define PyODict_Contains(od, key) PyDict_Contains((PyObject *)od, key)
-#define PyODict_Size(od) PyDict_Size((PyObject *)od)
+ PyDict_GetItemWithError(_PyObject_CAST(od), key)
+#define PyODict_Contains(od, key) PyDict_Contains(_PyObject_CAST(od), key)
+#define PyODict_Size(od) PyDict_Size(_PyObject_CAST(od))
#define PyODict_GetItemString(od, key) \
- PyDict_GetItemString((PyObject *)od, key)
+ PyDict_GetItemString(_PyObject_CAST(od), key)
#endif