mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-10-05 01:16:26 +00:00
Clang-Tidy fixes (#6725)
This commit is contained in:
@@ -271,8 +271,8 @@ static SDL_bool HIDAPI_DriverPS5_IsSupportedDevice(SDL_HIDAPI_Device *device, co
|
||||
|
||||
if (SONY_THIRDPARTY_VENDOR(vendor_id)) {
|
||||
if (device && device->dev) {
|
||||
if ((size = ReadFeatureReport(device->dev, k_EPS5FeatureReportIdCapabilities, data, sizeof(data))) == 48 &&
|
||||
data[2] == 0x28) {
|
||||
size = ReadFeatureReport(device->dev, k_EPS5FeatureReportIdCapabilities, data, sizeof data);
|
||||
if (size == 48 && data[2] == 0x28) {
|
||||
/* Supported third party controller */
|
||||
return SDL_TRUE;
|
||||
} else {
|
||||
@@ -396,8 +396,8 @@ static SDL_bool HIDAPI_DriverPS5_InitDevice(SDL_HIDAPI_Device *device)
|
||||
This will also enable enhanced reports over Bluetooth
|
||||
*/
|
||||
if (ReadFeatureReport(device->dev, k_EPS5FeatureReportIdSerialNumber, data, sizeof(data)) >= 7) {
|
||||
SDL_snprintf(serial, sizeof(serial), "%.2x-%.2x-%.2x-%.2x-%.2x-%.2x",
|
||||
data[6], data[5], data[4], data[3], data[2], data[1]);
|
||||
(void)SDL_snprintf(serial, sizeof serial, "%.2x-%.2x-%.2x-%.2x-%.2x-%.2x",
|
||||
data[6], data[5], data[4], data[3], data[2], data[1]);
|
||||
}
|
||||
|
||||
/* Read the firmware version
|
||||
@@ -408,6 +408,7 @@ static SDL_bool HIDAPI_DriverPS5_InitDevice(SDL_HIDAPI_Device *device)
|
||||
}
|
||||
}
|
||||
|
||||
size = ReadFeatureReport(device->dev, k_EPS5FeatureReportIdCapabilities, data, sizeof data);
|
||||
/* Get the device capabilities */
|
||||
if (device->vendor_id == USB_VENDOR_SONY) {
|
||||
ctx->sensors_supported = SDL_TRUE;
|
||||
@@ -415,8 +416,7 @@ static SDL_bool HIDAPI_DriverPS5_InitDevice(SDL_HIDAPI_Device *device)
|
||||
ctx->vibration_supported = SDL_TRUE;
|
||||
ctx->playerled_supported = SDL_TRUE;
|
||||
ctx->touchpad_supported = SDL_TRUE;
|
||||
} else if ((size = ReadFeatureReport(device->dev, k_EPS5FeatureReportIdCapabilities, data, sizeof(data))) == 48 &&
|
||||
data[2] == 0x28) {
|
||||
} else if (size == 48 && data[2] == 0x28) {
|
||||
Uint8 capabilities = data[4];
|
||||
Uint8 capabilities2 = data[20];
|
||||
Uint8 device_type = data[5];
|
||||
|
Reference in New Issue
Block a user