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:
Sylvain Becker 2022-11-27 17:38:43 +01:00 committed by GitHub
parent 4958dafdc3
commit 6a2200823c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
387 changed files with 6094 additions and 4633 deletions

View file

@ -246,11 +246,13 @@ SDL_CleanupDeviceNotification(SDL_DeviceNotificationData *data)
RAWINPUT_UnregisterNotifications();
#endif
if (data->hNotify)
if (data->hNotify) {
UnregisterDeviceNotification(data->hNotify);
}
if (data->messageWindow)
if (data->messageWindow) {
DestroyWindow(data->messageWindow);
}
UnregisterClass(data->wincl.lpszClassName, data->wincl.hInstance);
@ -394,18 +396,18 @@ static int
SDL_StartJoystickThread(void)
{
s_mutexJoyStickEnum = SDL_CreateMutex();
if (!s_mutexJoyStickEnum) {
if (s_mutexJoyStickEnum == NULL) {
return -1;
}
s_condJoystickThread = SDL_CreateCond();
if (!s_condJoystickThread) {
if (s_condJoystickThread == NULL) {
return -1;
}
s_bJoystickThreadQuit = SDL_FALSE;
s_joystickThread = SDL_CreateThreadInternal(SDL_JoystickThread, "SDL_joystick", 64 * 1024, NULL);
if (!s_joystickThread) {
if (s_joystickThread == NULL) {
return -1;
}
return 0;
@ -414,7 +416,7 @@ SDL_StartJoystickThread(void)
static void
SDL_StopJoystickThread(void)
{
if (!s_joystickThread) {
if (s_joystickThread == NULL) {
return;
}
@ -588,8 +590,9 @@ WINDOWS_JoystickGetDeviceName(int device_index)
JoyStick_DeviceData *device = SYS_Joystick;
int index;
for (index = device_index; index > 0; index--)
for (index = device_index; index > 0; index--) {
device = device->pNext;
}
return device->joystickname;
}
@ -600,8 +603,9 @@ WINDOWS_JoystickGetDevicePath(int device_index)
JoyStick_DeviceData *device = SYS_Joystick;
int index;
for (index = device_index; index > 0; index--)
for (index = device_index; index > 0; index--) {
device = device->pNext;
}
return device->path;
}
@ -612,8 +616,9 @@ WINDOWS_JoystickGetDevicePlayerIndex(int device_index)
JoyStick_DeviceData *device = SYS_Joystick;
int index;
for (index = device_index; index > 0; index--)
for (index = device_index; index > 0; index--) {
device = device->pNext;
}
return device->bXInputDevice ? (int)device->XInputUserId : -1;
}
@ -630,8 +635,9 @@ WINDOWS_JoystickGetDeviceGUID(int device_index)
JoyStick_DeviceData *device = SYS_Joystick;
int index;
for (index = device_index; index > 0; index--)
for (index = device_index; index > 0; index--) {
device = device->pNext;
}
return device->guid;
}
@ -643,8 +649,9 @@ WINDOWS_JoystickGetDeviceInstanceID(int device_index)
JoyStick_DeviceData *device = SYS_Joystick;
int index;
for (index = device_index; index > 0; index--)
for (index = device_index; index > 0; index--) {
device = device->pNext;
}
return device->nInstanceID;
}
@ -660,8 +667,9 @@ WINDOWS_JoystickOpen(SDL_Joystick *joystick, int device_index)
JoyStick_DeviceData *device = SYS_Joystick;
int index;
for (index = device_index; index > 0; index--)
for (index = device_index; index > 0; index--) {
device = device->pNext;
}
/* allocate memory for system specific hardware data */
joystick->instance_id = device->nInstanceID;