Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 8a13518

Browse files
committed
Remove casts to PyObject * when declaration is for PyObject *
1 parent bdbd84f commit 8a13518

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

Modules/gcmodule.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ delete_garbage(PyGC_Head *unreachable, PyGC_Head *old)
355355
else {
356356
if ((clear = op->ob_type->tp_clear) != NULL) {
357357
Py_INCREF(op);
358-
clear((PyObject *)op);
358+
clear(op);
359359
Py_DECREF(op);
360360
}
361361
}
@@ -879,7 +879,7 @@ _PyObject_GC_Malloc(size_t basicsize)
879879
#ifdef WITH_CYCLE_GC
880880
PyGC_Head *g = PyObject_MALLOC(sizeof(PyGC_Head) + basicsize);
881881
if (g == NULL)
882-
return (PyObject *)PyErr_NoMemory();
882+
return PyErr_NoMemory();
883883
g->gc.gc_next = NULL;
884884
generations[0].count++; /* number of allocated GC objects */
885885
if (generations[0].count > generations[0].threshold &&
@@ -895,7 +895,7 @@ _PyObject_GC_Malloc(size_t basicsize)
895895
#else
896896
op = PyObject_MALLOC(basicsize);
897897
if (op == NULL)
898-
return (PyObject *)PyErr_NoMemory();
898+
return PyErr_NoMemory();
899899

900900
#endif
901901
return op;

0 commit comments

Comments
 (0)