@@ -1586,8 +1586,9 @@ ptr_from_index(Py_buffer *base, Py_ssize_t index)
1586
1586
}
1587
1587
1588
1588
static PyObject *
1589
- ndarray_item (NDArrayObject * self , Py_ssize_t index )
1589
+ ndarray_item (PyObject * op , Py_ssize_t index )
1590
1590
{
1591
+ NDArrayObject * self = (NDArrayObject * )op ;
1591
1592
ndbuf_t * ndbuf = self -> head ;
1592
1593
Py_buffer * base = & ndbuf -> base ;
1593
1594
char * ptr ;
@@ -1801,7 +1802,7 @@ ndarray_subscript(PyObject *op, PyObject *key)
1801
1802
Py_ssize_t index = PyLong_AsSsize_t (key );
1802
1803
if (index == -1 && PyErr_Occurred ())
1803
1804
return NULL ;
1804
- return ndarray_item (self , index );
1805
+ return ndarray_item (op , index );
1805
1806
}
1806
1807
1807
1808
nd = (NDArrayObject * )ndarray_new (& NDArray_Type , NULL , NULL );
@@ -1966,10 +1967,10 @@ static PyMappingMethods ndarray_as_mapping = {
1966
1967
};
1967
1968
1968
1969
static PySequenceMethods ndarray_as_sequence = {
1969
- 0 , /* sq_length */
1970
- 0 , /* sq_concat */
1971
- 0 , /* sq_repeat */
1972
- ( ssizeargfunc ) ndarray_item , /* sq_item */
1970
+ 0 , /* sq_length */
1971
+ 0 , /* sq_concat */
1972
+ 0 , /* sq_repeat */
1973
+ ndarray_item , /* sq_item */
1973
1974
};
1974
1975
1975
1976
@@ -2742,16 +2743,17 @@ staticarray_init(PyObject *self, PyObject *args, PyObject *kwds)
2742
2743
}
2743
2744
2744
2745
static void
2745
- staticarray_dealloc (StaticArrayObject * self )
2746
+ staticarray_dealloc (PyObject * self )
2746
2747
{
2747
2748
PyObject_Free (self );
2748
2749
}
2749
2750
2750
2751
/* Return a buffer for a PyBUF_FULL_RO request. Flags are not checked,
2751
2752
which makes this object a non-compliant exporter! */
2752
2753
static int
2753
- staticarray_getbuf (StaticArrayObject * self , Py_buffer * view , int flags )
2754
+ staticarray_getbuf (PyObject * op , Py_buffer * view , int flags )
2754
2755
{
2756
+ StaticArrayObject * self = (StaticArrayObject * )op ;
2755
2757
* view = static_buffer ;
2756
2758
2757
2759
if (self -> legacy_mode ) {
@@ -2765,7 +2767,7 @@ staticarray_getbuf(StaticArrayObject *self, Py_buffer *view, int flags)
2765
2767
}
2766
2768
2767
2769
static PyBufferProcs staticarray_as_buffer = {
2768
- ( getbufferproc ) staticarray_getbuf , /* bf_getbuffer */
2770
+ staticarray_getbuf , /* bf_getbuffer */
2769
2771
NULL , /* bf_releasebuffer */
2770
2772
};
2771
2773
@@ -2774,7 +2776,7 @@ static PyTypeObject StaticArray_Type = {
2774
2776
"staticarray" , /* Name of this type */
2775
2777
sizeof (StaticArrayObject ), /* Basic object size */
2776
2778
0 , /* Item size for varobject */
2777
- ( destructor ) staticarray_dealloc , /* tp_dealloc */
2779
+ staticarray_dealloc , /* tp_dealloc */
2778
2780
0 , /* tp_vectorcall_offset */
2779
2781
0 , /* tp_getattr */
2780
2782
0 , /* tp_setattr */
0 commit comments