FreeLookController: Fix signed/unsigned warning

Loop index int i was being compared against GetControllerCount() which
returned a size_t.  This was the only place GetControllerCount() was
called from so the change of return type doesn't disturb anything else.

Changing the loop index to size_t wouldn't work as well since it's
passed into GetController(), which takes an int and is called from many
places, so it would need a cast anyway on an already busy line.
This commit is contained in:
Dentomologist 2021-02-12 17:21:48 -08:00
parent 686314b548
commit 692aaed60c
2 changed files with 3 additions and 3 deletions

View File

@ -186,9 +186,9 @@ bool InputConfig::ControllersNeedToBeCreated() const
return m_controllers.empty(); return m_controllers.empty();
} }
std::size_t InputConfig::GetControllerCount() const int InputConfig::GetControllerCount() const
{ {
return m_controllers.size(); return static_cast<int>(m_controllers.size());
} }
void InputConfig::RegisterHotplugCallback() void InputConfig::RegisterHotplugCallback()

View File

@ -41,7 +41,7 @@ public:
std::string GetGUIName() const { return m_gui_name; } std::string GetGUIName() const { return m_gui_name; }
std::string GetProfileName() const { return m_profile_name; } std::string GetProfileName() const { return m_profile_name; }
std::size_t GetControllerCount() const; int GetControllerCount() const;
// These should be used after creating all controllers and before clearing them, respectively. // These should be used after creating all controllers and before clearing them, respectively.
void RegisterHotplugCallback(); void RegisterHotplugCallback();