static int
-structseq_traverse(PyStructSequence *obj, visitproc visit, void *arg)
+structseq_traverse(PyObject *op, visitproc visit, void *arg)
{
+ PyStructSequence *obj = (PyStructSequence *)op;
if (Py_TYPE(obj)->tp_flags & Py_TPFLAGS_HEAPTYPE) {
Py_VISIT(Py_TYPE(obj));
}
}
static void
-structseq_dealloc(PyStructSequence *obj)
+structseq_dealloc(PyObject *op)
{
+ PyStructSequence *obj = (PyStructSequence *)op;
Py_ssize_t i, size;
PyObject_GC_UnTrack(obj);
static PyObject *
-structseq_repr(PyStructSequence *obj)
+structseq_repr(PyObject *op)
{
+ PyStructSequence *obj = (PyStructSequence *)op;
PyTypeObject *typ = Py_TYPE(obj);
// count 5 characters per item: "x=1, "
Py_ssize_t n_hidden = n_members - desc->n_in_sequence;
type->tp_basicsize = sizeof(PyStructSequence) + (n_hidden - 1) * sizeof(PyObject *);
type->tp_itemsize = sizeof(PyObject *);
- type->tp_dealloc = (destructor)structseq_dealloc;
- type->tp_repr = (reprfunc)structseq_repr;
+ type->tp_dealloc = structseq_dealloc;
+ type->tp_repr = structseq_repr;
type->tp_doc = desc->doc;
type->tp_base = &PyTuple_Type;
type->tp_methods = structseq_methods;
type->tp_new = structseq_new;
type->tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | tp_flags;
- type->tp_traverse = (traverseproc) structseq_traverse;
+ type->tp_traverse = structseq_traverse;
type->tp_members = tp_members;
}
}
/* Initialize Slots */
- slots[0] = (PyType_Slot){Py_tp_dealloc, (destructor)structseq_dealloc};
- slots[1] = (PyType_Slot){Py_tp_repr, (reprfunc)structseq_repr};
+ slots[0] = (PyType_Slot){Py_tp_dealloc, structseq_dealloc};
+ slots[1] = (PyType_Slot){Py_tp_repr, structseq_repr};
slots[2] = (PyType_Slot){Py_tp_doc, (void *)desc->doc};
slots[3] = (PyType_Slot){Py_tp_methods, structseq_methods};
slots[4] = (PyType_Slot){Py_tp_new, structseq_new};
slots[5] = (PyType_Slot){Py_tp_members, members};
- slots[6] = (PyType_Slot){Py_tp_traverse, (traverseproc)structseq_traverse};
+ slots[6] = (PyType_Slot){Py_tp_traverse, structseq_traverse};
slots[7] = (PyType_Slot){0, 0};
/* Initialize Spec */