Merge pull request #13522 from tygyh/Enforce-overriding-destructor-style-Core&UnitTests

Core & UnitTests: Make overriding explicit and remove redundant virtual specifiers on overriding destructors
This commit is contained in:
Jordan Woyak 2025-06-07 17:55:14 -05:00 committed by GitHub
commit 65f3ba70f5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
126 changed files with 188 additions and 192 deletions

View file

@ -117,7 +117,7 @@ public:
class Output : public Control
{
public:
virtual ~Output() = default;
~Output() override = default;
virtual void SetState(ControlState state) = 0;
Output* ToOutput() override { return this; }
};

View file

@ -60,13 +60,13 @@ public:
Core::DeviceRemoval UpdateInput() override;
Joystick(const LPDIRECTINPUTDEVICE8 device);
~Joystick();
~Joystick() override;
std::string GetName() const override;
std::string GetSource() const override;
int GetSortPriority() const override { return -3; }
bool IsValid() const final override;
bool IsValid() const final;
private:
const LPDIRECTINPUTDEVICE8 m_device;

View file

@ -97,7 +97,7 @@ public:
Core::DeviceRemoval UpdateInput() override;
KeyboardMouse(const LPDIRECTINPUTDEVICE8 kb_device, const LPDIRECTINPUTDEVICE8 mo_device);
~KeyboardMouse();
~KeyboardMouse() override;
std::string GetName() const override;
std::string GetSource() const override;

View file

@ -71,11 +71,8 @@ private:
: m_name(name), m_input(input), m_range(range), m_offset(offset)
{
}
std::string GetName() const final override { return m_name; }
ControlState GetState() const final override
{
return (ControlState(m_input) + m_offset) / m_range;
}
std::string GetName() const final { return m_name; }
ControlState GetState() const final { return (ControlState(m_input) + m_offset) / m_range; }
private:
const char* m_name;
@ -203,7 +200,7 @@ class InputBackend final : public ciface::InputBackend
{
public:
InputBackend(ControllerInterface* controller_interface);
~InputBackend();
~InputBackend() override;
void PopulateDevices() override;
private:

View file

@ -26,7 +26,7 @@ class InputBackend final : public ciface::InputBackend
{
public:
InputBackend(ControllerInterface* controller_interface);
~InputBackend();
~InputBackend() override;
void PopulateDevices() override;
void UpdateInput(std::vector<std::weak_ptr<ciface::Core::Device>>& devices_to_remove) override;

View file

@ -93,8 +93,8 @@ private:
: m_name(name), m_input(input), m_range(range)
{
}
std::string GetName() const final override { return m_name; }
ControlState GetState() const final override { return ControlState(m_input) / m_range; }
std::string GetName() const final { return m_name; }
ControlState GetState() const final { return ControlState(m_input) / m_range; }
private:
const char* m_name;

View file

@ -51,7 +51,7 @@ public:
std::string GetName() const override { return m_name; }
ControlState GetState() const final override { return ControlState(m_value) / m_extent; }
ControlState GetState() const final { return ControlState(m_value) / m_extent; }
protected:
const T& m_value;

View file

@ -29,7 +29,7 @@ class Device final : public Core::Device
{
public:
Device(std::unique_ptr<WiimoteReal::Wiimote> wiimote);
~Device();
~Device() override;
std::string GetName() const override;
std::string GetSource() const override;

View file

@ -31,7 +31,7 @@ class InputBackend final : public ciface::InputBackend
{
public:
InputBackend(ControllerInterface* controller_interface);
~InputBackend();
~InputBackend() override;
void PopulateDevices() override;
void HandleWindowChange() override;