Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
994269cc
Commit
994269cc
authored
Sep 27, 2018
by
Yury Selivanov
Committed by
GitHub
Sep 27, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bpo-34762: Update PyContext* to PyObject* in asyncio and decimal (GH-9609)
This fixes various compiler warnings.
parent
3f22811f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
12 deletions
+11
-12
Modules/_asynciomodule.c
Modules/_asynciomodule.c
+8
-9
Modules/_decimal/_decimal.c
Modules/_decimal/_decimal.c
+3
-3
No files found.
Modules/_asynciomodule.c
View file @
994269cc
...
...
@@ -61,7 +61,7 @@ typedef enum {
PyObject_HEAD \
PyObject *prefix##_loop; \
PyObject *prefix##_callback0; \
Py
Context *prefix##_context0;
\
Py
Object *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
;
Py
Contex
t
*
task_context
;
Py
Objec
t
*
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
,
Py
Contex
t
*
ctx
)
call_soon
(
PyObject
*
loop
,
PyObject
*
func
,
PyObject
*
arg
,
Py
Objec
t
*
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
,
Py
Contex
t
*
ctx
)
future_add_done_callback
(
FutureObj
*
fut
,
PyObject
*
arg
,
Py
Objec
t
*
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]
...
...
Modules/_decimal/_decimal.c
View file @
994269cc
...
...
@@ -122,7 +122,7 @@ incr_false(void)
}
static
Py
ContextVar
*
current_context_var
;
static
Py
Object
*
current_context_var
;
/* Template for creating new thread contexts, calling Context() without
* arguments and initializing the module_context on first access. */
...
...
@@ -1500,7 +1500,7 @@ init_current_context(void)
}
CTX
(
tl_context
)
->
status
=
0
;
Py
ContextToken
*
tok
=
PyContextVar_Set
(
current_context_var
,
tl_context
);
Py
Object
*
tok
=
PyContextVar_Set
(
current_context_var
,
tl_context
);
if
(
tok
==
NULL
)
{
Py_DECREF
(
tl_context
);
return
NULL
;
...
...
@@ -1561,7 +1561,7 @@ PyDec_SetCurrentContext(PyObject *self UNUSED, PyObject *v)
Py_INCREF
(
v
);
}
Py
ContextToken
*
tok
=
PyContextVar_Set
(
current_context_var
,
v
);
Py
Object
*
tok
=
PyContextVar_Set
(
current_context_var
,
v
);
Py_DECREF
(
v
);
if
(
tok
==
NULL
)
{
return
NULL
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment