From: rubenwardy Date: Fri, 7 Apr 2017 18:06:50 +0000 (+0100) Subject: Fix signed/unsigned conversion warning X-Git-Tag: 0.4.16~275 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=271d7c31e69db0bb6c5cf2cfb6e97ba129045d3e;p=oweals%2Fminetest.git Fix signed/unsigned conversion warning There was no bug here (as I checked for negativeness), however it's good to get rid of warnings. --- diff --git a/src/client/joystick_controller.cpp b/src/client/joystick_controller.cpp index 311cd22fb..e6a572adb 100644 --- a/src/client/joystick_controller.cpp +++ b/src/client/joystick_controller.cpp @@ -170,12 +170,12 @@ void JoystickController::onJoystickConnect(const std::vector 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