Make overriding explicit and remove redundant virtual specifiers on overriding destructors - Core & UnitTests

This commit is contained in:
Dr. Dystopia
2025-04-16 09:17:46 +02:00
parent 0b0151770a
commit f240e20e3f
130 changed files with 195 additions and 199 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;