The return value from PyObject_ClearWeakRefs() is no longer meaningful,

so make it void.
This commit is contained in:
Fred Drake 2001-02-26 18:56:37 +00:00
parent 4f9b13bac8
commit b60654bc15
4 changed files with 8 additions and 9 deletions

View File

@ -284,7 +284,7 @@ extern DL_IMPORT(int) PyCallable_Check(PyObject *);
extern DL_IMPORT(int) PyNumber_Coerce(PyObject **, PyObject **); extern DL_IMPORT(int) PyNumber_Coerce(PyObject **, PyObject **);
extern DL_IMPORT(int) PyNumber_CoerceEx(PyObject **, PyObject **); extern DL_IMPORT(int) PyNumber_CoerceEx(PyObject **, PyObject **);
extern DL_IMPORT(int) (*PyObject_ClearWeakRefs)(PyObject *); extern DL_IMPORT(void) (*PyObject_ClearWeakRefs)(PyObject *);
/* Helpers for printing recursive container types */ /* Helpers for printing recursive container types */
extern DL_IMPORT(int) Py_ReprEnter(PyObject *); extern DL_IMPORT(int) Py_ReprEnter(PyObject *);

View File

@ -692,7 +692,7 @@ weakref_proxy(PyObject *self, PyObject *args)
* until one resurrects the object, at which point it stops invalidating * until one resurrects the object, at which point it stops invalidating
* weak references and returns false. * weak references and returns false.
*/ */
static int static
cleanup_helper(PyObject *object) cleanup_helper(PyObject *object)
{ {
PyWeakReference **list; PyWeakReference **list;
@ -702,7 +702,7 @@ cleanup_helper(PyObject *object)
|| object->ob_refcnt != 0) { || object->ob_refcnt != 0) {
PyErr_BadInternalCall(); PyErr_BadInternalCall();
/* not sure what we should return here */ /* not sure what we should return here */
return 1; return;
} }
list = GET_WEAKREFS_LISTPTR(object); list = GET_WEAKREFS_LISTPTR(object);
while (*list != NULL) { while (*list != NULL) {
@ -722,7 +722,7 @@ cleanup_helper(PyObject *object)
Py_DECREF(callback); Py_DECREF(callback);
} }
} }
return (object->ob_refcnt > 0 ? 0 : 1); return;
} }

View File

@ -516,8 +516,7 @@ instance_dealloc(register PyInstanceObject *inst)
extern long _Py_RefTotal; extern long _Py_RefTotal;
#endif #endif
if (!PyObject_ClearWeakRefs((PyObject *) inst)) PyObject_ClearWeakRefs((PyObject *) inst);
return;
/* Temporarily resurrect the object. */ /* Temporarily resurrect the object. */
#ifdef Py_TRACE_REFS #ifdef Py_TRACE_REFS

View File

@ -1475,13 +1475,13 @@ PyObject_Free(void *p)
call site instead of requiring a test for NULL. call site instead of requiring a test for NULL.
*/ */
static int static void
empty_clear_weak_refs(PyObject *o) empty_clear_weak_refs(PyObject *o)
{ {
return 1; return;
} }
int (*PyObject_ClearWeakRefs)(PyObject *) = empty_clear_weak_refs; void (*PyObject_ClearWeakRefs)(PyObject *) = empty_clear_weak_refs;