summaryrefslogtreecommitdiff
path: root/platform/uwp
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2022-04-04 15:06:57 +0200
committerRémi Verschelde <rverschelde@gmail.com>2022-04-04 19:49:50 +0200
commitf8ab79e68af20e18e1d868b64d6dfd0c429bc554 (patch)
treea9d2df2e2df939c189135b1c36a01e06b37b80b2 /platform/uwp
parent53317bbe146dd19a919685df8d846c55568daba1 (diff)
Zero initialize all pointer class and struct members
This prevents the pitfall of UB when checking if they have been assigned something valid by comparing to nullptr.
Diffstat (limited to 'platform/uwp')
-rw-r--r--platform/uwp/joypad_uwp.h2
-rw-r--r--platform/uwp/os_uwp.h10
2 files changed, 6 insertions, 6 deletions
diff --git a/platform/uwp/joypad_uwp.h b/platform/uwp/joypad_uwp.h
index 29f5109056..0869f1961d 100644
--- a/platform/uwp/joypad_uwp.h
+++ b/platform/uwp/joypad_uwp.h
@@ -68,7 +68,7 @@ private:
ControllerDevice controllers[MAX_CONTROLLERS];
- InputDefault *input;
+ InputDefault *input = nullptr;
void OnGamepadAdded(Platform::Object ^ sender, Windows::Gaming::Input::Gamepad ^ value);
void OnGamepadRemoved(Platform::Object ^ sender, Windows::Gaming::Input::Gamepad ^ value);
diff --git a/platform/uwp/os_uwp.h b/platform/uwp/os_uwp.h
index 573d86af7c..f955be1da9 100644
--- a/platform/uwp/os_uwp.h
+++ b/platform/uwp/os_uwp.h
@@ -74,7 +74,7 @@ private:
KEY_EVENT_BUFFER_SIZE = 512
};
- FILE *stdo;
+ FILE *stdo = nullptr;
KeyEvent key_event_buffer[KEY_EVENT_BUFFER_SIZE];
int key_event_pos;
@@ -87,16 +87,16 @@ private:
bool outside;
int old_x, old_y;
Point2i center;
- RenderingServer *rendering_server;
+ RenderingServer *rendering_server = nullptr;
int pressrc;
- ContextEGL_UWP *gl_context;
+ ContextEGL_UWP *gl_context = nullptr;
Windows::UI::Core::CoreWindow ^ window;
VideoMode video_mode;
int video_driver_index;
- MainLoop *main_loop;
+ MainLoop *main_loop = nullptr;
AudioDriverXAudio2 audio_driver;
@@ -111,7 +111,7 @@ private:
CursorShape cursor_shape;
- InputDefault *input;
+ InputDefault *input = nullptr;
JoypadUWP ^ joypad;