diff options
author | Yury Selivanov <yury@magic.io> | 2018-09-27 18:55:55 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-09-27 18:55:55 (GMT) |
commit | 994269ccee5574f03cda6b018399347fc52bf330 (patch) | |
tree | cfbe48e07cd233b9f7899a81cb64dba35a8cb0d2 /Modules/_asynciomodule.c | |
parent | 3f22811fef73aec848d961593d95fa877f77ecbf (diff) | |
download | cpython-994269ccee5574f03cda6b018399347fc52bf330.zip cpython-994269ccee5574f03cda6b018399347fc52bf330.tar.gz cpython-994269ccee5574f03cda6b018399347fc52bf330.tar.bz2 |
bpo-34762: Update PyContext* to PyObject* in asyncio and decimal (GH-9609)
This fixes various compiler warnings.
Diffstat (limited to 'Modules/_asynciomodule.c')
-rw-r--r-- | Modules/_asynciomodule.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/Modules/_asynciomodule.c b/Modules/_asynciomodule.c index fc91ebd..6bf0fd6 100644 --- a/Modules/_asynciomodule.c +++ b/Modules/_asynciomodule.c @@ -61,7 +61,7 @@ typedef enum { PyObject_HEAD \ PyObject *prefix##_loop; \ PyObject *prefix##_callback0; \ - PyContext *prefix##_context0; \ + PyObject *prefix##_context0; \ PyObject *prefix##_callbacks; \ PyObject *prefix##_exception; \ PyObject *prefix##_result; \ @@ -81,7 +81,7 @@ typedef struct { PyObject *task_fut_waiter; PyObject *task_coro; PyObject *task_name; - PyContext *task_context; + PyObject *task_context; int task_must_cancel; int task_log_destroy_pending; } TaskObj; @@ -340,7 +340,7 @@ get_event_loop(void) static int -call_soon(PyObject *loop, PyObject *func, PyObject *arg, PyContext *ctx) +call_soon(PyObject *loop, PyObject *func, PyObject *arg, PyObject *ctx) { PyObject *handle; PyObject *stack[3]; @@ -451,7 +451,7 @@ future_schedule_callbacks(FutureObj *fut) PyObject *cb = PyTuple_GET_ITEM(cb_tup, 0); PyObject *ctx = PyTuple_GET_ITEM(cb_tup, 1); - if (call_soon(fut->fut_loop, cb, (PyObject *)fut, (PyContext *)ctx)) { + if (call_soon(fut->fut_loop, cb, (PyObject *)fut, ctx)) { /* If an error occurs in pure-Python implementation, all callbacks are cleared. */ Py_CLEAR(fut->fut_callbacks); @@ -619,7 +619,7 @@ future_get_result(FutureObj *fut, PyObject **result) } static PyObject * -future_add_done_callback(FutureObj *fut, PyObject *arg, PyContext *ctx) +future_add_done_callback(FutureObj *fut, PyObject *arg, PyObject *ctx) { if (!future_is_alive(fut)) { PyErr_SetString(PyExc_RuntimeError, "uninitialized Future object"); @@ -906,16 +906,15 @@ _asyncio_Future_add_done_callback_impl(FutureObj *self, PyObject *fn, /*[clinic end generated code: output=7ce635bbc9554c1e input=15ab0693a96e9533]*/ { if (context == NULL) { - context = (PyObject *)PyContext_CopyCurrent(); + context = PyContext_CopyCurrent(); if (context == NULL) { return NULL; } - PyObject *res = future_add_done_callback( - self, fn, (PyContext *)context); + PyObject *res = future_add_done_callback(self, fn, context); Py_DECREF(context); return res; } - return future_add_done_callback(self, fn, (PyContext *)context); + return future_add_done_callback(self, fn, context); } /*[clinic input] |