@@ -221,6 +221,8 @@ typedef struct
221221 PyThread_type_lock lock ;
222222} compobject ;
223223
224+ #define _compobject_CAST (op ) ((compobject *)op)
225+
224226static void
225227zlib_error (zlibstate * state , z_stream zst , int err , const char * msg )
226228{
@@ -706,7 +708,7 @@ zlib_decompressobj_impl(PyObject *module, int wbits, PyObject *zdict)
706708static void
707709Dealloc (compobject * self )
708710{
709- PyObject * type = ( PyObject * ) Py_TYPE (self );
711+ PyTypeObject * type = Py_TYPE (self );
710712 PyThread_free_lock (self -> lock );
711713 Py_XDECREF (self -> unused_data );
712714 Py_XDECREF (self -> unconsumed_tail );
@@ -716,18 +718,20 @@ Dealloc(compobject *self)
716718}
717719
718720static void
719- Comp_dealloc (compobject * self )
721+ Comp_dealloc (PyObject * op )
720722{
723+ compobject * self = _compobject_CAST (op );
721724 if (self -> is_initialised )
722- deflateEnd (& self -> zst );
725+ ( void ) deflateEnd (& self -> zst );
723726 Dealloc (self );
724727}
725728
726729static void
727- Decomp_dealloc (compobject * self )
730+ Decomp_dealloc (PyObject * op )
728731{
732+ compobject * self = _compobject_CAST (op );
729733 if (self -> is_initialised )
730- inflateEnd (& self -> zst );
734+ ( void ) inflateEnd (& self -> zst );
731735 Dealloc (self );
732736}
733737
0 commit comments