]> granicus.if.org Git - python/commitdiff
add some casts and fix the build from 64311
authorBenjamin Peterson <benjamin@python.org>
Mon, 16 Jun 2008 20:47:12 +0000 (20:47 +0000)
committerBenjamin Peterson <benjamin@python.org>
Mon, 16 Jun 2008 20:47:12 +0000 (20:47 +0000)
Objects/weakrefobject.c

index 302cdc9edf96bf45108172b2725bc1cf0a2e4f45..6ceed73de99ed76eae6ce9ae61cebab737fd8f4f 100644 (file)
@@ -884,7 +884,7 @@ PyObject_ClearWeakRefs(PyObject *object)
             current->wr_callback = NULL;
             clear_weakref(current);
             if (callback != NULL) {
-                if (current->ob_refcnt > 0)
+                if (((PyObject *)current)->ob_refcnt > 0)
                     handle_callback(current, callback);
                 Py_DECREF(callback);
             }
@@ -903,7 +903,7 @@ PyObject_ClearWeakRefs(PyObject *object)
             for (i = 0; i < count; ++i) {
                 PyWeakReference *next = current->wr_next;
 
-                if (current->ob_refcnt > 0)
+                if (((PyObject *)current)->ob_refcnt > 0)
                 {
                     Py_INCREF(current);
                     PyTuple_SET_ITEM(tuple, i * 2, (PyObject *) current);