@@ -221,6 +221,8 @@ typedef struct
221
221
PyThread_type_lock lock ;
222
222
} compobject ;
223
223
224
+ #define _compobject_CAST (op ) ((compobject *)op)
225
+
224
226
static void
225
227
zlib_error (zlibstate * state , z_stream zst , int err , const char * msg )
226
228
{
@@ -706,7 +708,7 @@ zlib_decompressobj_impl(PyObject *module, int wbits, PyObject *zdict)
706
708
static void
707
709
Dealloc (compobject * self )
708
710
{
709
- PyObject * type = ( PyObject * ) Py_TYPE (self );
711
+ PyTypeObject * type = Py_TYPE (self );
710
712
PyThread_free_lock (self -> lock );
711
713
Py_XDECREF (self -> unused_data );
712
714
Py_XDECREF (self -> unconsumed_tail );
@@ -716,18 +718,20 @@ Dealloc(compobject *self)
716
718
}
717
719
718
720
static void
719
- Comp_dealloc (compobject * self )
721
+ Comp_dealloc (PyObject * op )
720
722
{
723
+ compobject * self = _compobject_CAST (op );
721
724
if (self -> is_initialised )
722
- deflateEnd (& self -> zst );
725
+ ( void ) deflateEnd (& self -> zst );
723
726
Dealloc (self );
724
727
}
725
728
726
729
static void
727
- Decomp_dealloc (compobject * self )
730
+ Decomp_dealloc (PyObject * op )
728
731
{
732
+ compobject * self = _compobject_CAST (op );
729
733
if (self -> is_initialised )
730
- inflateEnd (& self -> zst );
734
+ ( void ) inflateEnd (& self -> zst );
731
735
Dealloc (self );
732
736
}
733
737
0 commit comments