From 7496109ff69ad26a7a95cab2570e3b6d6b376043 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Fri, 6 Sep 2019 07:23:34 -0400 Subject: [PATCH] NintendoPowerA: Make constructor explicit While we're at it we can also ensure that all class members have deterministic initial state. --- include/boo/inputdev/NintendoPowerA.hpp | 4 ++-- lib/inputdev/NintendoPowerA.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/boo/inputdev/NintendoPowerA.hpp b/include/boo/inputdev/NintendoPowerA.hpp index 20096a1..a7373a8 100644 --- a/include/boo/inputdev/NintendoPowerA.hpp +++ b/include/boo/inputdev/NintendoPowerA.hpp @@ -34,7 +34,7 @@ struct INintendoPowerACallback { }; class NintendoPowerA final : public TDeviceBase { - NintendoPowerAState m_last; + NintendoPowerAState m_last{}; void deviceDisconnected() override; void initialCycle() override; void transferCycle() override; @@ -42,7 +42,7 @@ class NintendoPowerA final : public TDeviceBase { void receivedHIDReport(const uint8_t* data, size_t length, HIDReportType tp, uint32_t message) override; public: - NintendoPowerA(DeviceToken*); + explicit NintendoPowerA(DeviceToken*); ~NintendoPowerA() override; }; } // namespace boo diff --git a/lib/inputdev/NintendoPowerA.cpp b/lib/inputdev/NintendoPowerA.cpp index fbc46dd..7b477cb 100644 --- a/lib/inputdev/NintendoPowerA.cpp +++ b/lib/inputdev/NintendoPowerA.cpp @@ -8,7 +8,7 @@ namespace boo { NintendoPowerA::NintendoPowerA(DeviceToken* token) : TDeviceBase(dev_typeid(NintendoPowerA), token) {} -NintendoPowerA::~NintendoPowerA() {} +NintendoPowerA::~NintendoPowerA() = default; void NintendoPowerA::deviceDisconnected() { std::lock_guard lk(m_callbackLock);