File tree 1 file changed +7
-3
lines changed 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -144,25 +144,29 @@ typedef struct {
144
144
Py_buffer write_buffer ;
145
145
} OverlappedObject ;
146
146
147
+ #define OverlappedObject_CAST (op ) ((OverlappedObject *)(op))
148
+
147
149
/*
148
150
Note: tp_clear (overlapped_clear) is not implemented because it
149
151
requires cancelling the IO operation if it's pending and the cancellation is
150
152
quite complex and can fail (see: overlapped_dealloc).
151
153
*/
152
154
static int
153
- overlapped_traverse (OverlappedObject * self , visitproc visit , void * arg )
155
+ overlapped_traverse (PyObject * op , visitproc visit , void * arg )
154
156
{
157
+ OverlappedObject * self = OverlappedObject_CAST (op );
155
158
Py_VISIT (self -> read_buffer );
156
159
Py_VISIT (self -> write_buffer .obj );
157
160
Py_VISIT (Py_TYPE (self ));
158
161
return 0 ;
159
162
}
160
163
161
164
static void
162
- overlapped_dealloc (OverlappedObject * self )
165
+ overlapped_dealloc (PyObject * op )
163
166
{
164
167
DWORD bytes ;
165
168
int err = GetLastError ();
169
+ OverlappedObject * self = OverlappedObject_CAST (op );
166
170
167
171
PyObject_GC_UnTrack (self );
168
172
if (self -> pending ) {
@@ -3215,7 +3219,7 @@ winapi_clear(PyObject *module)
3215
3219
static void
3216
3220
winapi_free (void * module )
3217
3221
{
3218
- winapi_clear ((PyObject * )module );
3222
+ ( void ) winapi_clear ((PyObject * )module );
3219
3223
}
3220
3224
3221
3225
static struct PyModuleDef winapi_module = {
You can’t perform that action at this time.
0 commit comments