diff options
author | Rafał Mikrut <mikrutrafal@protonmail.com> | 2022-10-01 21:09:22 +0200 |
---|---|---|
committer | Rafał Mikrut <mikrutrafal@protonmail.com> | 2022-10-01 21:09:22 +0200 |
commit | 2233624152a3b041daeab8b0fd88a2061b7b8565 (patch) | |
tree | 27b6bc31c38e0629a23ea6142f54724045aa2bc5 /platform/linuxbsd | |
parent | 24115beb3c69e648b1d48f969785b9b0729e1be8 (diff) |
Remove usage of unitialized variables
Diffstat (limited to 'platform/linuxbsd')
-rw-r--r-- | platform/linuxbsd/crash_handler_linuxbsd.cpp | 2 | ||||
-rw-r--r-- | platform/linuxbsd/display_server_x11.cpp | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/platform/linuxbsd/crash_handler_linuxbsd.cpp b/platform/linuxbsd/crash_handler_linuxbsd.cpp index 33da094860..8c8c8588b8 100644 --- a/platform/linuxbsd/crash_handler_linuxbsd.cpp +++ b/platform/linuxbsd/crash_handler_linuxbsd.cpp @@ -89,7 +89,7 @@ static void handle_crash(int sig) { // Try to demangle the function name to provide a more readable one if (dladdr(bt_buffer[i], &info) && info.dli_sname) { if (info.dli_sname[0] == '_') { - int status; + int status = 0; char *demangled = abi::__cxa_demangle(info.dli_sname, nullptr, nullptr, &status); if (status == 0 && demangled) { diff --git a/platform/linuxbsd/display_server_x11.cpp b/platform/linuxbsd/display_server_x11.cpp index 66dea6cf1b..076769084d 100644 --- a/platform/linuxbsd/display_server_x11.cpp +++ b/platform/linuxbsd/display_server_x11.cpp @@ -3144,7 +3144,7 @@ void DisplayServerX11::_window_changed(XEvent *event) { { //the position in xconfigure is not useful here, obtain it manually - int x, y; + int x = 0, y = 0; Window child; XTranslateCoordinates(x11_display, wd.x11_window, DefaultRootWindow(x11_display), 0, 0, &x, &y, &child); new_rect.position.x = x; @@ -3307,7 +3307,7 @@ void DisplayServerX11::_check_pending_events(LocalVector<XEvent> &r_events) { XFlush(x11_display); // Non-blocking wait for next event and remove it from the queue. - XEvent ev; + XEvent ev = {}; while (XCheckIfEvent(x11_display, &ev, _predicate_all_events, nullptr)) { // Check if the input manager wants to process the event. if (XFilterEvent(&ev, None)) { |