mirror of
https://github.com/python/cpython.git
synced 2025-12-05 00:52:25 +00:00
gh-120155: Initialize variables in _tkinter.c (#120156)
Initialize variables in _tkinter.c to make static analyzers happy.
This commit is contained in:
parent
cccc9f63c6
commit
78634cfa3d
1 changed files with 7 additions and 2 deletions
|
|
@ -1438,7 +1438,7 @@ Tkapp_Call(PyObject *selfptr, PyObject *args)
|
||||||
marshal the parameters to the interpreter thread. */
|
marshal the parameters to the interpreter thread. */
|
||||||
Tkapp_CallEvent *ev;
|
Tkapp_CallEvent *ev;
|
||||||
Tcl_Condition cond = NULL;
|
Tcl_Condition cond = NULL;
|
||||||
PyObject *exc;
|
PyObject *exc = NULL; // init to make static analyzers happy
|
||||||
if (!WaitForMainloop(self))
|
if (!WaitForMainloop(self))
|
||||||
return NULL;
|
return NULL;
|
||||||
ev = (Tkapp_CallEvent*)attemptckalloc(sizeof(Tkapp_CallEvent));
|
ev = (Tkapp_CallEvent*)attemptckalloc(sizeof(Tkapp_CallEvent));
|
||||||
|
|
@ -1712,7 +1712,8 @@ var_invoke(EventFunc func, PyObject *selfptr, PyObject *args, int flags)
|
||||||
TkappObject *self = (TkappObject*)selfptr;
|
TkappObject *self = (TkappObject*)selfptr;
|
||||||
if (self->threaded && self->thread_id != Tcl_GetCurrentThread()) {
|
if (self->threaded && self->thread_id != Tcl_GetCurrentThread()) {
|
||||||
VarEvent *ev;
|
VarEvent *ev;
|
||||||
PyObject *res, *exc;
|
// init 'res' and 'exc' to make static analyzers happy
|
||||||
|
PyObject *res = NULL, *exc = NULL;
|
||||||
Tcl_Condition cond = NULL;
|
Tcl_Condition cond = NULL;
|
||||||
|
|
||||||
/* The current thread is not the interpreter thread. Marshal
|
/* The current thread is not the interpreter thread. Marshal
|
||||||
|
|
@ -2413,6 +2414,8 @@ _tkinter_tkapp_createcommand_impl(TkappObject *self, const char *name,
|
||||||
data->self = self;
|
data->self = self;
|
||||||
data->func = Py_NewRef(func);
|
data->func = Py_NewRef(func);
|
||||||
if (self->threaded && self->thread_id != Tcl_GetCurrentThread()) {
|
if (self->threaded && self->thread_id != Tcl_GetCurrentThread()) {
|
||||||
|
err = 0; // init to make static analyzers happy
|
||||||
|
|
||||||
Tcl_Condition cond = NULL;
|
Tcl_Condition cond = NULL;
|
||||||
CommandEvent *ev = (CommandEvent*)attemptckalloc(sizeof(CommandEvent));
|
CommandEvent *ev = (CommandEvent*)attemptckalloc(sizeof(CommandEvent));
|
||||||
if (ev == NULL) {
|
if (ev == NULL) {
|
||||||
|
|
@ -2468,6 +2471,8 @@ _tkinter_tkapp_deletecommand_impl(TkappObject *self, const char *name)
|
||||||
TRACE(self, ("((sss))", "rename", name, ""));
|
TRACE(self, ("((sss))", "rename", name, ""));
|
||||||
|
|
||||||
if (self->threaded && self->thread_id != Tcl_GetCurrentThread()) {
|
if (self->threaded && self->thread_id != Tcl_GetCurrentThread()) {
|
||||||
|
err = 0; // init to make static analyzers happy
|
||||||
|
|
||||||
Tcl_Condition cond = NULL;
|
Tcl_Condition cond = NULL;
|
||||||
CommandEvent *ev;
|
CommandEvent *ev;
|
||||||
ev = (CommandEvent*)attemptckalloc(sizeof(CommandEvent));
|
ev = (CommandEvent*)attemptckalloc(sizeof(CommandEvent));
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue