Fixed Visual Studio warning 4244

This commit is contained in:
Sam Lantinga
2023-03-30 14:04:32 -07:00
parent 85ee1498a5
commit 308bcbbe76
29 changed files with 160 additions and 155 deletions

View File

@@ -134,7 +134,7 @@ SDL_HapticOpen(int device_index)
/* Initialize the haptic device */
SDL_memset(haptic, 0, sizeof(*haptic));
haptic->rumble_id = -1;
haptic->index = device_index;
haptic->index = (Uint8)device_index;
if (SDL_SYS_HapticOpen(haptic) < 0) {
SDL_free(haptic);
return NULL;

View File

@@ -463,7 +463,7 @@ int SDL_DINPUT_JoystickSameHaptic(SDL_Haptic *haptic, SDL_Joystick *joystick)
int SDL_DINPUT_HapticOpenFromJoystick(SDL_Haptic *haptic, SDL_Joystick *joystick)
{
SDL_hapticlist_item *item;
int index = 0;
Uint8 index = 0;
HRESULT ret;
DIDEVICEINSTANCE joy_instance;

View File

@@ -226,7 +226,7 @@ int SDL_XINPUT_JoystickSameHaptic(SDL_Haptic *haptic, SDL_Joystick *joystick)
int SDL_XINPUT_HapticOpenFromJoystick(SDL_Haptic *haptic, SDL_Joystick *joystick)
{
SDL_hapticlist_item *item;
int index = 0;
Uint8 index = 0;
/* Since it comes from a joystick we have to try to match it with a haptic device on our haptic list. */
for (item = SDL_hapticlist; item != NULL; item = item->next) {