}
static PyObject *
-ndarray_item(NDArrayObject *self, Py_ssize_t index)
+ndarray_item(PyObject *op, Py_ssize_t index)
{
+ NDArrayObject *self = (NDArrayObject *)op;
ndbuf_t *ndbuf = self->head;
Py_buffer *base = &ndbuf->base;
char *ptr;
Py_ssize_t index = PyLong_AsSsize_t(key);
if (index == -1 && PyErr_Occurred())
return NULL;
- return ndarray_item(self, index);
+ return ndarray_item(op, index);
}
nd = (NDArrayObject *)ndarray_new(&NDArray_Type, NULL, NULL);
};
static PySequenceMethods ndarray_as_sequence = {
- 0, /* sq_length */
- 0, /* sq_concat */
- 0, /* sq_repeat */
- (ssizeargfunc)ndarray_item, /* sq_item */
+ 0, /* sq_length */
+ 0, /* sq_concat */
+ 0, /* sq_repeat */
+ ndarray_item, /* sq_item */
};
}
static void
-staticarray_dealloc(StaticArrayObject *self)
+staticarray_dealloc(PyObject *self)
{
PyObject_Free(self);
}
/* Return a buffer for a PyBUF_FULL_RO request. Flags are not checked,
which makes this object a non-compliant exporter! */
static int
-staticarray_getbuf(StaticArrayObject *self, Py_buffer *view, int flags)
+staticarray_getbuf(PyObject *op, Py_buffer *view, int flags)
{
+ StaticArrayObject *self = (StaticArrayObject *)op;
*view = static_buffer;
if (self->legacy_mode) {
}
static PyBufferProcs staticarray_as_buffer = {
- (getbufferproc)staticarray_getbuf, /* bf_getbuffer */
+ staticarray_getbuf, /* bf_getbuffer */
NULL, /* bf_releasebuffer */
};
"staticarray", /* Name of this type */
sizeof(StaticArrayObject), /* Basic object size */
0, /* Item size for varobject */
- (destructor)staticarray_dealloc, /* tp_dealloc */
+ staticarray_dealloc, /* tp_dealloc */
0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */