瀏覽代碼

Fixed build warnings

Sam Lantinga 8 月之前
父節點
當前提交
889a788913
共有 2 個文件被更改,包括 3 次插入3 次删除
  1. 2 2
      src/joystick/gdk/SDL_gameinputjoystick.c
  2. 1 1
      src/video/windows/SDL_windowsgameinput.c

+ 2 - 2
src/joystick/gdk/SDL_gameinputjoystick.c

@@ -603,7 +603,7 @@ static void GAMEINPUT_JoystickUpdate(SDL_Joystick *joystick)
             uint32_t i;
             uint32_t button_count = IGameInputReading_GetControllerButtonState(reading, info->controllerButtonCount, button_state);
             for (i = 0; i < button_count; ++i) {
-                SDL_SendJoystickButton(timestamp, joystick, i, button_state[i]);
+                SDL_SendJoystickButton(timestamp, joystick, (Uint8)i, button_state[i]);
             }
             SDL_stack_free(button_state);
         }
@@ -613,7 +613,7 @@ static void GAMEINPUT_JoystickUpdate(SDL_Joystick *joystick)
             uint32_t i;
             uint32_t axis_count = IGameInputReading_GetControllerAxisState(reading, info->controllerAxisCount, axis_state);
             for (i = 0; i < axis_count; ++i) {
-                SDL_SendJoystickAxis(timestamp, joystick, i, CONVERT_AXIS(axis_state[i]));
+                SDL_SendJoystickAxis(timestamp, joystick, (Uint8)i, CONVERT_AXIS(axis_state[i]));
             }
             SDL_stack_free(axis_state);
         }

+ 1 - 1
src/video/windows/SDL_windowsgameinput.c

@@ -313,7 +313,7 @@ static void GAMEINPUT_HandleMouseDelta(WIN_GameInputData *data, SDL_Window *wind
         }
         if (delta.buttons) {
             for (int i = 0; i < MAX_GAMEINPUT_BUTTONS; ++i) {
-                const GameInputMouseButtons mask = (1 << i); 
+                const GameInputMouseButtons mask = (1 << i);
                 if (delta.buttons & mask) {
                     SDL_SendMouseButton(timestamp, window, mouseID, (state.buttons & mask) ? SDL_PRESSED : SDL_RELEASED, GAMEINPUT_button_map[i]);
                 }