From 4e73ff39781c269acf812a198986e3b7ca08528d Mon Sep 17 00:00:00 2001 From: Morph <39850852+Morph1984@users.noreply.github.com> Date: Thu, 12 May 2022 02:49:52 -0400 Subject: [PATCH] input_common: Resolve C4267 warning on MSVC --- src/input_common/sdl/sdl_impl.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/input_common/sdl/sdl_impl.cpp b/src/input_common/sdl/sdl_impl.cpp index 998cafdf1..4f7a78461 100644 --- a/src/input_common/sdl/sdl_impl.cpp +++ b/src/input_common/sdl/sdl_impl.cpp @@ -335,7 +335,8 @@ std::shared_ptr SDLState::GetSDLJoystickBySDLID(SDL_JoystickID sdl_ } // There is no SDLJoystick without a mapped SDL_Joystick // Create a new SDLJoystick - auto joystick = std::make_shared(guid, map_it->second.size(), sdl_joystick); + auto joystick = std::make_shared(guid, static_cast(map_it->second.size()), + sdl_joystick); return map_it->second.emplace_back(std::move(joystick)); } auto joystick = std::make_shared(guid, 0, sdl_joystick); @@ -483,7 +484,8 @@ void SDLState::InitJoystick(int joystick_index) { (*it)->SetSDLJoystick(sdl_joystick); return; } - auto joystick = std::make_shared(guid, joystick_guid_list.size(), sdl_joystick); + auto joystick = std::make_shared(guid, static_cast(joystick_guid_list.size()), + sdl_joystick); joystick_guid_list.emplace_back(std::move(joystick)); } @@ -519,8 +521,8 @@ void SDLState::InitGameController(int controller_index) { (*it)->SetSDLGameController(sdl_controller); return; } - auto controller = - std::make_shared(guid, controller_guid_list.size(), sdl_controller); + auto controller = std::make_shared( + guid, static_cast(controller_guid_list.size()), sdl_controller); controller_guid_list.emplace_back(std::move(controller)); }