mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-10-17 07:16:00 +00:00
Cleanup add brace (#6545)
* Add braces after if conditions * More add braces after if conditions * Add braces after while() conditions * Fix compilation because of macro being modified * Add braces to for loop * Add braces after if/goto * Move comments up * Remove extra () in the 'return ...;' statements * More remove extra () in the 'return ...;' statements * More remove extra () in the 'return ...;' statements after merge * Fix inconsistent patterns are xxx == NULL vs !xxx * More "{}" for "if() break;" and "if() continue;" * More "{}" after if() short statement * More "{}" after "if () return;" statement * More fix inconsistent patterns are xxx == NULL vs !xxx * Revert some modificaion on SDL_RLEaccel.c * SDL_RLEaccel: no short statement * Cleanup 'if' where the bracket is in a new line * Cleanup 'while' where the bracket is in a new line * Cleanup 'for' where the bracket is in a new line * Cleanup 'else' where the bracket is in a new line
This commit is contained in:
@@ -211,13 +211,13 @@ static SDL_bool WriteOutput(SDL_DriverWii_Context *ctx, const Uint8 *data, int s
|
||||
}
|
||||
#endif
|
||||
if (sync) {
|
||||
return (SDL_hid_write(ctx->device->dev, data, size) >= 0);
|
||||
return SDL_hid_write(ctx->device->dev, data, size) >= 0;
|
||||
} else {
|
||||
/* Use the rumble thread for general asynchronous writes */
|
||||
if (SDL_HIDAPI_LockRumble() < 0) {
|
||||
return SDL_FALSE;
|
||||
}
|
||||
return (SDL_HIDAPI_SendRumbleAndUnlock(ctx->device, data, size) >= 0);
|
||||
return SDL_HIDAPI_SendRumbleAndUnlock(ctx->device, data, size) >= 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -229,7 +229,7 @@ static SDL_bool ReadInputSync(SDL_DriverWii_Context *ctx, EWiiInputReportIDs exp
|
||||
int nRead = 0;
|
||||
while ((nRead = ReadInput(ctx)) != -1) {
|
||||
if (nRead > 0) {
|
||||
if (ctx->m_rgucReadBuffer[0] == expectedID && (!isMine || isMine(ctx->m_rgucReadBuffer))) {
|
||||
if (ctx->m_rgucReadBuffer[0] == expectedID && (isMine == NULL || isMine(ctx->m_rgucReadBuffer))) {
|
||||
return SDL_TRUE;
|
||||
}
|
||||
} else {
|
||||
@@ -729,7 +729,7 @@ HIDAPI_DriverWii_InitDevice(SDL_HIDAPI_Device *device)
|
||||
SDL_DriverWii_Context *ctx;
|
||||
|
||||
ctx = (SDL_DriverWii_Context *)SDL_calloc(1, sizeof(*ctx));
|
||||
if (!ctx) {
|
||||
if (ctx == NULL) {
|
||||
SDL_OutOfMemory();
|
||||
return SDL_FALSE;
|
||||
}
|
||||
@@ -1524,7 +1524,7 @@ HIDAPI_DriverWii_UpdateDevice(SDL_HIDAPI_Device *device)
|
||||
/* Read error, device is disconnected */
|
||||
HIDAPI_JoystickDisconnected(device, device->joysticks[0]);
|
||||
}
|
||||
return (size >= 0);
|
||||
return size >= 0;
|
||||
}
|
||||
|
||||
static void
|
||||
|
Reference in New Issue
Block a user