@@ -605,15 +605,17 @@ heapctype_init(PyObject *self, PyObject *args, PyObject *kwargs)
605
605
}
606
606
607
607
static int
608
- heapgcctype_traverse (HeapCTypeObject * self , visitproc visit , void * arg )
608
+ heapgcctype_traverse (PyObject * op , visitproc visit , void * arg )
609
609
{
610
+ HeapCTypeObject * self = (HeapCTypeObject * )op ;
610
611
Py_VISIT (Py_TYPE (self ));
611
612
return 0 ;
612
613
}
613
614
614
615
static void
615
- heapgcctype_dealloc (HeapCTypeObject * self )
616
+ heapgcctype_dealloc (PyObject * op )
616
617
{
618
+ HeapCTypeObject * self = (HeapCTypeObject * )op ;
617
619
PyTypeObject * tp = Py_TYPE (self );
618
620
PyObject_GC_UnTrack (self );
619
621
PyObject_GC_Del (self );
@@ -642,8 +644,9 @@ PyDoc_STRVAR(heapctype__doc__,
642
644
"The 'value' attribute is set to 10 in __init__." );
643
645
644
646
static void
645
- heapctype_dealloc (HeapCTypeObject * self )
647
+ heapctype_dealloc (PyObject * op )
646
648
{
649
+ HeapCTypeObject * self = (HeapCTypeObject * )op ;
647
650
PyTypeObject * tp = Py_TYPE (self );
648
651
PyObject_Free (self );
649
652
Py_DECREF (tp );
@@ -716,8 +719,9 @@ typedef struct {
716
719
} HeapCTypeWithBufferObject ;
717
720
718
721
static int
719
- heapctypewithbuffer_getbuffer (HeapCTypeWithBufferObject * self , Py_buffer * view , int flags )
722
+ heapctypewithbuffer_getbuffer (PyObject * op , Py_buffer * view , int flags )
720
723
{
724
+ HeapCTypeWithBufferObject * self = (HeapCTypeWithBufferObject * )op ;
721
725
self -> buffer [0 ] = '1' ;
722
726
self -> buffer [1 ] = '2' ;
723
727
self -> buffer [2 ] = '3' ;
@@ -727,8 +731,9 @@ heapctypewithbuffer_getbuffer(HeapCTypeWithBufferObject *self, Py_buffer *view,
727
731
}
728
732
729
733
static void
730
- heapctypewithbuffer_releasebuffer (HeapCTypeWithBufferObject * self , Py_buffer * view )
734
+ heapctypewithbuffer_releasebuffer (PyObject * op , Py_buffer * view )
731
735
{
736
+ HeapCTypeWithBufferObject * self = (HeapCTypeWithBufferObject * )op ;
732
737
assert (view -> obj == (void * ) self );
733
738
}
734
739
@@ -873,9 +878,9 @@ typedef struct {
873
878
} HeapCTypeWithDictObject ;
874
879
875
880
static void
876
- heapctypewithdict_dealloc (HeapCTypeWithDictObject * self )
881
+ heapctypewithdict_dealloc (PyObject * op )
877
882
{
878
-
883
+ HeapCTypeWithDictObject * self = ( HeapCTypeWithDictObject * ) op ;
879
884
PyTypeObject * tp = Py_TYPE (self );
880
885
Py_XDECREF (self -> dict );
881
886
PyObject_Free (self );
@@ -917,22 +922,23 @@ static PyType_Spec HeapCTypeWithDict2_spec = {
917
922
};
918
923
919
924
static int
920
- heapmanaged_traverse (HeapCTypeObject * self , visitproc visit , void * arg )
925
+ heapmanaged_traverse (PyObject * self , visitproc visit , void * arg )
921
926
{
922
927
Py_VISIT (Py_TYPE (self ));
923
928
return PyObject_VisitManagedDict ((PyObject * )self , visit , arg );
924
929
}
925
930
926
931
static int
927
- heapmanaged_clear (HeapCTypeObject * self )
932
+ heapmanaged_clear (PyObject * self )
928
933
{
929
- PyObject_ClearManagedDict (( PyObject * ) self );
934
+ PyObject_ClearManagedDict (self );
930
935
return 0 ;
931
936
}
932
937
933
938
static void
934
- heapmanaged_dealloc (HeapCTypeObject * self )
939
+ heapmanaged_dealloc (PyObject * op )
935
940
{
941
+ HeapCTypeObject * self = (HeapCTypeObject * )op ;
936
942
PyTypeObject * tp = Py_TYPE (self );
937
943
PyObject_ClearManagedDict ((PyObject * )self );
938
944
PyObject_GC_UnTrack (self );
@@ -1016,9 +1022,9 @@ static struct PyMemberDef heapctypewithweakref_members[] = {
1016
1022
};
1017
1023
1018
1024
static void
1019
- heapctypewithweakref_dealloc (HeapCTypeWithWeakrefObject * self )
1025
+ heapctypewithweakref_dealloc (PyObject * op )
1020
1026
{
1021
-
1027
+ HeapCTypeWithWeakrefObject * self = ( HeapCTypeWithWeakrefObject * ) op ;
1022
1028
PyTypeObject * tp = Py_TYPE (self );
1023
1029
if (self -> weakreflist != NULL )
1024
1030
PyObject_ClearWeakRefs ((PyObject * ) self );
@@ -1071,16 +1077,18 @@ heapctypesetattr_init(PyObject *self, PyObject *args, PyObject *kwargs)
1071
1077
}
1072
1078
1073
1079
static void
1074
- heapctypesetattr_dealloc (HeapCTypeSetattrObject * self )
1080
+ heapctypesetattr_dealloc (PyObject * op )
1075
1081
{
1082
+ HeapCTypeSetattrObject * self = (HeapCTypeSetattrObject * )op ;
1076
1083
PyTypeObject * tp = Py_TYPE (self );
1077
1084
PyObject_Free (self );
1078
1085
Py_DECREF (tp );
1079
1086
}
1080
1087
1081
1088
static int
1082
- heapctypesetattr_setattro (HeapCTypeSetattrObject * self , PyObject * attr , PyObject * value )
1089
+ heapctypesetattr_setattro (PyObject * op , PyObject * attr , PyObject * value )
1083
1090
{
1091
+ HeapCTypeSetattrObject * self = (HeapCTypeSetattrObject * )op ;
1084
1092
PyObject * svalue = PyUnicode_FromString ("value" );
1085
1093
if (svalue == NULL )
1086
1094
return -1 ;
@@ -1237,8 +1245,9 @@ HeapCCollection_new(PyTypeObject *subtype, PyObject *args, PyObject *kwds)
1237
1245
}
1238
1246
1239
1247
static Py_ssize_t
1240
- HeapCCollection_length (PyVarObject * self )
1248
+ HeapCCollection_length (PyObject * op )
1241
1249
{
1250
+ PyVarObject * self = (PyVarObject * )op ;
1242
1251
return Py_SIZE (self );
1243
1252
}
1244
1253
0 commit comments