From 7f376277e53e67652e8547e1543af260bf9744ee Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Fri, 29 Dec 2023 09:24:22 -0800
Subject: [PATCH] Fixed warning C4244: 'initializing': conversion from
'SDL_bool' to 'Uint8', possible loss of data
---
src/joystick/hidapi/SDL_hidapi_wii.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/joystick/hidapi/SDL_hidapi_wii.c b/src/joystick/hidapi/SDL_hidapi_wii.c
index ee8b8ce9868c..bd9b26e3bee4 100644
--- a/src/joystick/hidapi/SDL_hidapi_wii.c
+++ b/src/joystick/hidapi/SDL_hidapi_wii.c
@@ -551,7 +551,7 @@ static EWiiInputReportIDs GetButtonPacketType(SDL_DriverWii_Context *ctx)
static SDL_bool RequestButtonPacketType(SDL_DriverWii_Context *ctx, EWiiInputReportIDs type)
{
Uint8 data[3];
- Uint8 tt = ctx->m_bRumbleActive;
+ Uint8 tt = (Uint8)ctx->m_bRumbleActive;
/* Continuous reporting off, tt & 4 == 0 */
if (ENABLE_CONTINUOUS_REPORTING) {
@@ -615,7 +615,7 @@ static void UpdateSlotLED(SDL_DriverWii_Context *ctx)
Uint8 data[2];
/* The lowest bit needs to have the rumble status */
- leds = ctx->m_bRumbleActive;
+ leds = (Uint8)ctx->m_bRumbleActive;
if (ctx->m_bPlayerLights) {
/* Use the same LED codes as Smash 8-player for 5-7 */
@@ -809,7 +809,7 @@ static int HIDAPI_DriverWii_RumbleJoystick(SDL_HIDAPI_Device *device, SDL_Joysti
Uint8 data[2];
data[0] = k_eWiiOutputReportIDs_Rumble;
- data[1] = active;
+ data[1] = (Uint8)active;
WriteOutput(ctx, data, sizeof(data), SDL_FALSE);
ctx->m_bRumbleActive = active;
@@ -1541,7 +1541,7 @@ static SDL_bool HIDAPI_DriverWii_UpdateDevice(SDL_HIDAPI_Device *device)
Uint8 data[2];
data[0] = k_eWiiOutputReportIDs_StatusRequest;
- data[1] = ctx->m_bRumbleActive;
+ data[1] = (Uint8)ctx->m_bRumbleActive;
WriteOutput(ctx, data, sizeof(data), SDL_FALSE);
ctx->m_ulLastStatus = now;