Fix signed/unsigned conversion warning
authorrubenwardy <rubenwardy@gmail.com>
Fri, 7 Apr 2017 18:06:50 +0000 (19:06 +0100)
committerrubenwardy <rubenwardy@gmail.com>
Fri, 7 Apr 2017 18:06:50 +0000 (19:06 +0100)
There was no bug here (as I checked for negativeness),
however it's good to get rid of warnings.

src/client/joystick_controller.cpp

index 311cd22fb3803a368ac9d4410c019949603897dc..e6a572adbee17313343427fa55407fcd3f0a77f7 100644 (file)
@@ -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