mirror of
https://github.com/godotengine/godot
synced 2024-10-14 15:20:59 +00:00
fixed uninitialized variables and false positives found by CppCheck
This commit is contained in:
parent
bf957a414a
commit
9fcf9ee813
|
@ -39,7 +39,7 @@ void BackgroundProgress::_add_task(const String &p_task, const String &p_label,
|
||||||
|
|
||||||
_THREAD_SAFE_METHOD_
|
_THREAD_SAFE_METHOD_
|
||||||
ERR_FAIL_COND(tasks.has(p_task));
|
ERR_FAIL_COND(tasks.has(p_task));
|
||||||
Task t;
|
BackgroundProgress::Task t;
|
||||||
t.hb = memnew(HBoxContainer);
|
t.hb = memnew(HBoxContainer);
|
||||||
Label *l = memnew(Label);
|
Label *l = memnew(Label);
|
||||||
l->set_text(p_label + " ");
|
l->set_text(p_label + " ");
|
||||||
|
@ -112,7 +112,7 @@ void BackgroundProgress::add_task(const String &p_task, const String &p_label, i
|
||||||
void BackgroundProgress::task_step(const String &p_task, int p_step) {
|
void BackgroundProgress::task_step(const String &p_task, int p_step) {
|
||||||
|
|
||||||
//this code is weird, but it prevents deadlock.
|
//this code is weird, but it prevents deadlock.
|
||||||
bool no_updates;
|
bool no_updates = true;
|
||||||
{
|
{
|
||||||
_THREAD_SAFE_METHOD_
|
_THREAD_SAFE_METHOD_
|
||||||
no_updates = updates.empty();
|
no_updates = updates.empty();
|
||||||
|
@ -167,7 +167,7 @@ void ProgressDialog::_popup() {
|
||||||
void ProgressDialog::add_task(const String &p_task, const String &p_label, int p_steps, bool p_can_cancel) {
|
void ProgressDialog::add_task(const String &p_task, const String &p_label, int p_steps, bool p_can_cancel) {
|
||||||
|
|
||||||
ERR_FAIL_COND(tasks.has(p_task));
|
ERR_FAIL_COND(tasks.has(p_task));
|
||||||
Task t;
|
ProgressDialog::Task t;
|
||||||
t.vb = memnew(VBoxContainer);
|
t.vb = memnew(VBoxContainer);
|
||||||
VBoxContainer *vb2 = memnew(VBoxContainer);
|
VBoxContainer *vb2 = memnew(VBoxContainer);
|
||||||
t.vb->add_margin_child(p_label, vb2);
|
t.vb->add_margin_child(p_label, vb2);
|
||||||
|
|
|
@ -429,6 +429,7 @@ void InputDefault::_parse_input_event_impl(const Ref<InputEvent> &p_event, bool
|
||||||
action.physics_frame = Engine::get_singleton()->get_physics_frames();
|
action.physics_frame = Engine::get_singleton()->get_physics_frames();
|
||||||
action.idle_frame = Engine::get_singleton()->get_idle_frames();
|
action.idle_frame = Engine::get_singleton()->get_idle_frames();
|
||||||
action.pressed = p_event->is_action_pressed(E->key());
|
action.pressed = p_event->is_action_pressed(E->key());
|
||||||
|
action.strength = 0.f;
|
||||||
action_state[E->key()] = action;
|
action_state[E->key()] = action;
|
||||||
}
|
}
|
||||||
action_state[E->key()].strength = p_event->get_action_strength(E->key());
|
action_state[E->key()].strength = p_event->get_action_strength(E->key());
|
||||||
|
@ -562,6 +563,7 @@ void InputDefault::action_press(const StringName &p_action) {
|
||||||
action.physics_frame = Engine::get_singleton()->get_physics_frames();
|
action.physics_frame = Engine::get_singleton()->get_physics_frames();
|
||||||
action.idle_frame = Engine::get_singleton()->get_idle_frames();
|
action.idle_frame = Engine::get_singleton()->get_idle_frames();
|
||||||
action.pressed = true;
|
action.pressed = true;
|
||||||
|
action.strength = 0.f;
|
||||||
|
|
||||||
action_state[p_action] = action;
|
action_state[p_action] = action;
|
||||||
}
|
}
|
||||||
|
@ -573,6 +575,7 @@ void InputDefault::action_release(const StringName &p_action) {
|
||||||
action.physics_frame = Engine::get_singleton()->get_physics_frames();
|
action.physics_frame = Engine::get_singleton()->get_physics_frames();
|
||||||
action.idle_frame = Engine::get_singleton()->get_idle_frames();
|
action.idle_frame = Engine::get_singleton()->get_idle_frames();
|
||||||
action.pressed = false;
|
action.pressed = false;
|
||||||
|
action.strength = 0.f;
|
||||||
|
|
||||||
action_state[p_action] = action;
|
action_state[p_action] = action;
|
||||||
}
|
}
|
||||||
|
|
|
@ -2498,7 +2498,7 @@ bool ShaderLanguage::_get_completable_identifier(BlockNode *p_block, CompletionT
|
||||||
|
|
||||||
identifier = StringName();
|
identifier = StringName();
|
||||||
|
|
||||||
TkPos pos;
|
TkPos pos = { 0, 0 };
|
||||||
|
|
||||||
Token tk = _get_token();
|
Token tk = _get_token();
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue