Skip to content

Commit

Permalink
Fix signed/unsigned conversion warning
Browse files Browse the repository at this point in the history
There was no bug here (as I checked for negativeness),
however it's good to get rid of warnings.
  • Loading branch information
rubenwardy committed Apr 7, 2017
1 parent c28a843 commit 271d7c3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/client/joystick_controller.cpp
Expand Up @@ -170,12 +170,12 @@ void JoystickController::onJoystickConnect(const std::vector<irr::SJoystickInfo>
s32 id = g_settings->getS32("joystick_id");
std::string layout = g_settings->get("joystick_type");

if (id < 0 || id >= joystick_infos.size()) {
if (id < 0 || (u16)id >= joystick_infos.size()) {
// TODO: auto detection
id = 0;
}

if (id >= 0 && id < joystick_infos.size()) {
if (id >= 0 && (u16)id < joystick_infos.size()) {
if (layout.empty() || layout == "auto")
setLayoutFromControllerName(joystick_infos[id].Name.c_str());
else
Expand Down

0 comments on commit 271d7c3

Please sign in to comment.