Clang-Tidy fixes (#6725)

This commit is contained in:
Pierre Wendling
2022-12-01 16:07:03 -05:00
committed by GitHub
parent c2ce44bead
commit 3c501b963d
184 changed files with 1312 additions and 1154 deletions

View File

@@ -153,9 +153,9 @@ static SDL_bool HIDAPI_DriverPS3_InitDevice(SDL_HIDAPI_Device *device)
/* Set the controller into report mode over USB */
{
Uint8 data[USB_PACKET_LENGTH];
int size;
if ((size = ReadFeatureReport(device->dev, 0xf2, data, 17)) < 0) {
int size = ReadFeatureReport(device->dev, 0xf2, data, 17);
if (size < 0) {
SDL_LogDebug(SDL_LOG_CATEGORY_INPUT,
"HIDAPI_DriverPS3_InitDevice(): Couldn't read feature report 0xf2");
return SDL_FALSE;
@@ -163,7 +163,8 @@ static SDL_bool HIDAPI_DriverPS3_InitDevice(SDL_HIDAPI_Device *device)
#ifdef DEBUG_PS3_PROTOCOL
HIDAPI_DumpPacket("PS3 0xF2 packet: size = %d", data, size);
#endif
if ((size = ReadFeatureReport(device->dev, 0xf5, data, 8)) < 0) {
size = ReadFeatureReport(device->dev, 0xf5, data, 8);
if (size < 0) {
SDL_LogDebug(SDL_LOG_CATEGORY_INPUT,
"HIDAPI_DriverPS3_InitDevice(): Couldn't read feature report 0xf5");
return SDL_FALSE;
@@ -578,8 +579,8 @@ static SDL_bool HIDAPI_DriverPS3ThirdParty_IsSupportedDevice(SDL_HIDAPI_Device *
if (SONY_THIRDPARTY_VENDOR(vendor_id)) {
if (device && device->dev) {
if ((size = ReadFeatureReport(device->dev, 0x03, data, sizeof(data))) == 8 &&
data[2] == 0x26) {
size = ReadFeatureReport(device->dev, 0x03, data, sizeof data);
if (size == 8 && data[2] == 0x26) {
/* Supported third party controller */
return SDL_TRUE;
} else {