summaryrefslogtreecommitdiff
path: root/Source/Core/InputCommon
diff options
context:
space:
mode:
authorDentomologist <dentomologist@gmail.com>2021-02-12 17:21:48 -0800
committerDentomologist <dentomologist@gmail.com>2021-03-07 10:09:59 -0800
commit692aaed60ce09543cc3100caf3aefdca96420f23 (patch)
tree2db4ba7cd34e38c84bf6fdad6257c10744081cc5 /Source/Core/InputCommon
parent686314b5486653d257a782b9afe4479c27863f0c (diff)
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.
Diffstat (limited to 'Source/Core/InputCommon')
-rw-r--r--Source/Core/InputCommon/InputConfig.cpp4
-rw-r--r--Source/Core/InputCommon/InputConfig.h2
2 files changed, 3 insertions, 3 deletions
diff --git a/Source/Core/InputCommon/InputConfig.cpp b/Source/Core/InputCommon/InputConfig.cpp
index 72b28b6d16..07a9b62daf 100644
--- a/Source/Core/InputCommon/InputConfig.cpp
+++ b/Source/Core/InputCommon/InputConfig.cpp
@@ -186,9 +186,9 @@ bool InputConfig::ControllersNeedToBeCreated() const
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()
diff --git a/Source/Core/InputCommon/InputConfig.h b/Source/Core/InputCommon/InputConfig.h
index 29ec661f67..0eeeedaed8 100644
--- a/Source/Core/InputCommon/InputConfig.h
+++ b/Source/Core/InputCommon/InputConfig.h
@@ -41,7 +41,7 @@ public:
std::string GetGUIName() const { return m_gui_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.
void RegisterHotplugCallback();