summaryrefslogtreecommitdiffstats
path: root/Include/objimpl.h
diff options
context:
space:
mode:
authorTim Peters <tim.peters@gmail.com>2006-04-15 03:22:46 (GMT)
committerTim Peters <tim.peters@gmail.com>2006-04-15 03:22:46 (GMT)
commitde2acf6512caeacd1ad53e55aa0528f65d1201c7 (patch)
tree0229a13daa59add9513d78f2ddf294152b53c6e5 /Include/objimpl.h
parenta13131cf7f74eb89ed2cc63a9df5859c9ba66258 (diff)
downloadcpython-de2acf6512caeacd1ad53e55aa0528f65d1201c7.zip
cpython-de2acf6512caeacd1ad53e55aa0528f65d1201c7.tar.gz
cpython-de2acf6512caeacd1ad53e55aa0528f65d1201c7.tar.bz2
frame_traverse(): Use the standard Py_VISIT macro.
Py_VISIT: cast the `op` argument to PyObject* when calling `visit()`. Else the caller has to pay too much attention to this silly detail (e.g., frame_traverse needs to traverse `struct _frame *` and `PyCodeObject *` pointers too).
Diffstat (limited to 'Include/objimpl.h')
-rw-r--r--Include/objimpl.h14
1 files changed, 7 insertions, 7 deletions
diff --git a/Include/objimpl.h b/Include/objimpl.h
index 447a56e..03b6a8d 100644
--- a/Include/objimpl.h
+++ b/Include/objimpl.h
@@ -303,13 +303,13 @@ PyAPI_FUNC(void) PyObject_GC_Del(void *);
* "visit" and "arg". This is intended to keep tp_traverse functions
* looking as much alike as possible.
*/
-#define Py_VISIT(op) \
- do { \
- if (op) { \
- int vret = visit((op), arg); \
- if (vret) \
- return vret; \
- } \
+#define Py_VISIT(op) \
+ do { \
+ if (op) { \
+ int vret = visit((PyObject *)(op), arg); \
+ if (vret) \
+ return vret; \
+ } \
} while (0)
/* This is here for the sake of backwards compatibility. Extensions that