From 8c3196da608cd19fac9b5c8f4d2c9281bdc3f62e Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Wed, 18 Nov 2020 21:33:11 -0800 Subject: [PATCH] Fixed some compiler warnings --- src/joystick/hidapi/SDL_hidapi_ps5.c | 38 ++++++++++++++-------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/src/joystick/hidapi/SDL_hidapi_ps5.c b/src/joystick/hidapi/SDL_hidapi_ps5.c index 3d5e89a83..790f671b2 100644 --- a/src/joystick/hidapi/SDL_hidapi_ps5.c +++ b/src/joystick/hidapi/SDL_hidapi_ps5.c @@ -103,22 +103,22 @@ typedef struct typedef struct { - Uint8 ucEnableBits1; - Uint8 ucEnableBits2; - Uint8 ucRumbleRight; - Uint8 ucRumbleLeft; - Uint8 rgucUnknown1[6]; - Uint8 rgucRightTriggerEffect[11]; - Uint8 rgucLeftTriggerEffect[11]; - Uint8 rgucUnknown2[6]; - Uint8 ucLedFlags; - Uint8 rgucUnknown3[2]; - Uint8 ucLedAnim; - Uint8 ucLedBrightness; - Uint8 ucPadLights; - Uint8 ucLedRed; - Uint8 ucLedGreen; - Uint8 ucLedBlue; + Uint8 ucEnableBits1; /* 0 */ + Uint8 ucEnableBits2; /* 1 */ + Uint8 ucRumbleRight; /* 2 */ + Uint8 ucRumbleLeft; /* 3 */ + Uint8 rgucUnknown1[6]; /* 4 */ + Uint8 rgucRightTriggerEffect[11]; /* 10 */ + Uint8 rgucLeftTriggerEffect[11]; /* 21 */ + Uint8 rgucUnknown2[6]; /* 32 */ + Uint8 ucLedFlags; /* 38 */ + Uint8 rgucUnknown3[2]; /* 39 */ + Uint8 ucLedAnim; /* 41 */ + Uint8 ucLedBrightness; /* 42 */ + Uint8 ucPadLights; /* 43 */ + Uint8 ucLedRed; /* 44 */ + Uint8 ucLedGreen; /* 45 */ + Uint8 ucLedBlue; /* 46 */ } DS5EffectsState_t; typedef struct { @@ -132,8 +132,8 @@ typedef struct { SDL_bool hardware_calibration; IMUCalibrationData calibration[6]; int player_index; - Uint16 rumble_left; - Uint16 rumble_right; + Uint8 rumble_left; + Uint8 rumble_right; SDL_bool color_set; Uint8 led_red; Uint8 led_green; @@ -315,7 +315,7 @@ HIDAPI_DriverPS5_ApplyCalibrationData(SDL_DriverPS5_Context *ctx, int index, Sin /* Convert the raw data to the units expected by SDL */ if (index < 3) { - result = (result / GYRO_RES_PER_DEGREE) * M_PI / 180.0f; + result = (result / GYRO_RES_PER_DEGREE) * (float)M_PI / 180.0f; } else { result = (result / ACCEL_RES_PER_G) * SDL_STANDARD_GRAVITY; }