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/npad.h | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'src/core/hle/service/hid/controllers/npad.h') diff --git a/src/core/hle/service/hid/controllers/npad.h b/src/core/hle/service/hid/controllers/npad.h index 425b84abd..0a96825a5 100644 --- a/src/core/hle/service/hid/controllers/npad.h +++ b/src/core/hle/service/hid/controllers/npad.h @@ -187,7 +187,7 @@ public: static bool IsDeviceHandleValid(const Core::HID::VibrationDeviceHandle& device_handle); private: - static const std::size_t NPAD_COUNT = 10; + static constexpr std::size_t NPAD_COUNT = 10; // This is nn::hid::detail::ColorAttribute enum class ColorAttribute : u32 { @@ -470,9 +470,9 @@ private: }; struct NpadControllerData { - Core::HID::EmulatedController* device; Kernel::KEvent* styleset_changed_event{}; - NpadInternalState* shared_memory; + NpadInternalState* shared_memory = nullptr; + Core::HID::EmulatedController* device = nullptr; std::array vibration{}; bool unintended_home_button_input_protection{}; @@ -502,8 +502,7 @@ private: SixAxisSensorState sixaxis_dual_right_state{}; SixAxisSensorState sixaxis_left_lifo_state{}; SixAxisSensorState sixaxis_right_lifo_state{}; - - int callback_key; + int callback_key{}; }; void ControllerUpdate(Core::HID::ControllerTriggerType type, std::size_t controller_idx); -- cgit v1.2.3