From 0f3ad939a85494a8a9bdcb6f357c774f385f647e Mon Sep 17 00:00:00 2001 From: Narr the Reg Date: Wed, 20 Apr 2022 12:00:26 -0500 Subject: service: hid: Ensure all structs are initialized --- src/core/hle/service/hid/controllers/touchscreen.h | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/core/hle/service/hid/controllers/touchscreen.h') diff --git a/src/core/hle/service/hid/controllers/touchscreen.h b/src/core/hle/service/hid/controllers/touchscreen.h index 2e1dde2f1..e57a3a80e 100644 --- a/src/core/hle/service/hid/controllers/touchscreen.h +++ b/src/core/hle/service/hid/controllers/touchscreen.h @@ -25,7 +25,7 @@ public: // This is nn::hid::TouchScreenConfigurationForNx struct TouchScreenConfigurationForNx { - TouchScreenModeForNx mode; + TouchScreenModeForNx mode{TouchScreenModeForNx::UseSystemSetting}; INSERT_PADDING_BYTES_NOINIT(0x7); INSERT_PADDING_BYTES_NOINIT(0xF); // Reserved }; @@ -49,10 +49,10 @@ private: // This is nn::hid::TouchScreenState struct TouchScreenState { - s64 sampling_number; - s32 entry_count; + s64 sampling_number{}; + s32 entry_count{}; INSERT_PADDING_BYTES(4); // Reserved - std::array states; + std::array states{}; }; static_assert(sizeof(TouchScreenState) == 0x290, "TouchScreenState is an invalid size"); @@ -64,10 +64,10 @@ private: }; static_assert(sizeof(TouchSharedMemory) == 0x3000, "TouchSharedMemory is an invalid size"); - TouchSharedMemory* shared_memory; - TouchScreenState next_state{}; - std::array fingers; - Core::HID::EmulatedConsole* console; + TouchSharedMemory* shared_memory = nullptr; + Core::HID::EmulatedConsole* console = nullptr; + + std::array fingers{}; }; } // namespace Service::HID -- cgit v1.2.3