diff --git a/Windows/DinputDevice.cpp b/Windows/DinputDevice.cpp index cd5332bcd3..774820a656 100644 --- a/Windows/DinputDevice.cpp +++ b/Windows/DinputDevice.cpp @@ -318,7 +318,7 @@ void DinputDevice::ApplyButtons(DIJOYSTATE2 &state, InputState &input_state) { } } -int DinputDevice::getNumPads() +size_t DinputDevice::getNumPads() { if (devices.empty()) { diff --git a/Windows/DinputDevice.h b/Windows/DinputDevice.h index 4b59b1c7b9..8ff94a3436 100644 --- a/Windows/DinputDevice.h +++ b/Windows/DinputDevice.h @@ -32,7 +32,7 @@ public: ~DinputDevice(); virtual int UpdateState(InputState &input_state); virtual bool IsPad() { return true; } - static int getNumPads(); + static size_t getNumPads(); private: void ApplyButtons(DIJOYSTATE2 &state, InputState &input_state); //unfortunate and unclean way to keep only one DirectInput instance around diff --git a/Windows/WindowsHost.cpp b/Windows/WindowsHost.cpp index 3a3b751e9a..bf6ca575ae 100644 --- a/Windows/WindowsHost.cpp +++ b/Windows/WindowsHost.cpp @@ -87,10 +87,10 @@ WindowsHost::WindowsHost(HWND mainWindow) { //add first XInput device to respond input.push_back(std::shared_ptr(new XinputDevice())); //find all connected DInput devices of class GamePad - int numDInputDevs = DinputDevice::getNumPads(); - for (int i = 0; i < numDInputDevs; i++) + size_t numDInputDevs = DinputDevice::getNumPads(); + for (size_t i = 0; i < numDInputDevs; i++) { - input.push_back(std::shared_ptr(new DinputDevice(i))); + input.push_back(std::shared_ptr(new DinputDevice(static_cast(i)))); } keyboard = std::shared_ptr(new KeyboardDevice()); input.push_back(keyboard);