From 384d86b584c542f81d29f32501bcc0362106842f Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Fri, 23 Jul 2021 23:48:23 -0700 Subject: [PATCH] Fixed compile warnings with Visual Studio --- src/joystick/hidapi/SDL_hidapi_ps4.c | 2 +- src/joystick/hidapi/SDL_hidapi_ps5.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/joystick/hidapi/SDL_hidapi_ps4.c b/src/joystick/hidapi/SDL_hidapi_ps4.c index a32e88fe5..0cc51d0a2 100644 --- a/src/joystick/hidapi/SDL_hidapi_ps4.c +++ b/src/joystick/hidapi/SDL_hidapi_ps4.c @@ -649,7 +649,7 @@ HIDAPI_DriverPS4_SendJoystickEffect(SDL_HIDAPI_Device *device, SDL_Joystick *joy offset = 4; } - SDL_memcpy(&data[offset], effect, SDL_min((sizeof(data) - offset), size)); + SDL_memcpy(&data[offset], effect, SDL_min((sizeof(data) - offset), (size_t)size)); if (ctx->is_bluetooth) { /* Bluetooth reports need a CRC at the end of the packet (at least on Linux) */ diff --git a/src/joystick/hidapi/SDL_hidapi_ps5.c b/src/joystick/hidapi/SDL_hidapi_ps5.c index 232435f53..82eab6a2e 100644 --- a/src/joystick/hidapi/SDL_hidapi_ps5.c +++ b/src/joystick/hidapi/SDL_hidapi_ps5.c @@ -711,7 +711,7 @@ HIDAPI_DriverPS5_SendJoystickEffect(SDL_HIDAPI_Device *device, SDL_Joystick *joy offset = 1; } - SDL_memcpy(&data[offset], effect, SDL_min((sizeof(data) - offset), size)); + SDL_memcpy(&data[offset], effect, SDL_min((sizeof(data) - offset), (size_t)size)); if (ctx->is_bluetooth) { /* Bluetooth reports need a CRC at the end of the packet (at least on Linux) */