Fixed some compiler warnings
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
diff --git a/src/joystick/hidapi/SDL_hidapi_ps5.c b/src/joystick/hidapi/SDL_hidapi_ps5.c
index 3d5e89a..790f671 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;
}