diff Include/objimpl.h @ 37728:588f97b24bf9 legacy-trunk

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).
author Tim Peters <tim.peters@gmail.com>
date Sat, 15 Apr 2006 03:22:46 +0000
parents 6e1a899cac8e
children 6620a510e9a9
line wrap: on
line diff
--- a/Include/objimpl.h	Sat Apr 15 03:15:24 2006 +0000
+++ b/Include/objimpl.h	Sat Apr 15 03:22:46 2006 +0000
@@ -303,13 +303,13 @@
  * "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