From 4488719a761243bf6de95b6608d6ef6a780b7bd0 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Fri, 22 Nov 2019 15:51:25 -0500 Subject: [PATCH] InputCommon/DualShockUDPClient: In-class initialize members where applicable Deduplicates members within the constructor's initializer list. --- .../DualShockUDPClient/DualShockUDPClient.cpp | 25 ++++++++----------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/Source/Core/InputCommon/ControllerInterface/DualShockUDPClient/DualShockUDPClient.cpp b/Source/Core/InputCommon/ControllerInterface/DualShockUDPClient/DualShockUDPClient.cpp index 9ed62e5285..b98e9d42bd 100644 --- a/Source/Core/InputCommon/ControllerInterface/DualShockUDPClient/DualShockUDPClient.cpp +++ b/Source/Core/InputCommon/ControllerInterface/DualShockUDPClient/DualShockUDPClient.cpp @@ -96,16 +96,17 @@ public: private: const Proto::DsModel m_model; const int m_index; - u32 m_client_uid; + u32 m_client_uid = Common::Random::GenerateValue(); sf::UdpSocket m_socket; - Common::DVec3 m_accel; - Common::DVec3 m_gyro; - std::chrono::steady_clock::time_point m_next_reregister; - Proto::MessageType::PadDataResponse m_pad_data; - Proto::Touch m_prev_touch; - bool m_prev_touch_valid; - int m_touch_x; - int m_touch_y; + Common::DVec3 m_accel{}; + Common::DVec3 m_gyro{}; + std::chrono::steady_clock::time_point m_next_reregister = + std::chrono::steady_clock::time_point::min(); + Proto::MessageType::PadDataResponse m_pad_data{}; + Proto::Touch m_prev_touch{}; + bool m_prev_touch_valid = false; + int m_touch_x = 0; + int m_touch_y = 0; }; using MathUtil::GRAVITY_ACCELERATION; @@ -297,11 +298,7 @@ void DeInit() StopHotplugThread(); } -Device::Device(Proto::DsModel model, int index) - : m_model(model), m_index(index), - m_client_uid(Common::Random::GenerateValue()), m_accel{}, m_gyro{}, - m_next_reregister(std::chrono::steady_clock::time_point::min()), m_pad_data{}, m_prev_touch{}, - m_prev_touch_valid(false), m_touch_x(0), m_touch_y(0) +Device::Device(Proto::DsModel model, int index) : m_model{model}, m_index{index} { m_socket.setBlocking(false);