Fix MSVC warnings, rename shadowed variables, fix uninitialized values, change warnings=all to use /W4.

This commit is contained in:
bruvzg
2022-09-29 12:53:28 +03:00
parent 5b7f62af55
commit 0103af1ddd
240 changed files with 3390 additions and 3431 deletions

View File

@@ -61,19 +61,19 @@ void MenuButton::_popup_visibility_changed(bool p_visible) {
}
if (switch_on_hover) {
Window *window = Object::cast_to<Window>(get_viewport());
if (window) {
mouse_pos_adjusted = window->get_position();
Window *wnd = Object::cast_to<Window>(get_viewport());
if (wnd) {
mouse_pos_adjusted = wnd->get_position();
if (window->is_embedded()) {
Window *window_parent = Object::cast_to<Window>(window->get_parent()->get_viewport());
while (window_parent) {
if (!window_parent->is_embedded()) {
mouse_pos_adjusted += window_parent->get_position();
if (wnd->is_embedded()) {
Window *wnd_parent = Object::cast_to<Window>(wnd->get_parent()->get_viewport());
while (wnd_parent) {
if (!wnd_parent->is_embedded()) {
mouse_pos_adjusted += wnd_parent->get_position();
break;
}
window_parent = Object::cast_to<Window>(window_parent->get_parent()->get_viewport());
wnd_parent = Object::cast_to<Window>(wnd_parent->get_parent()->get_viewport());
}
}