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
387 changed files with 6094 additions and 4633 deletions

View File

@@ -8,7 +8,7 @@
int
main(int argc, char *argv[])
{
return (SDL_main(argc, argv));
return SDL_main(argc, argv);
}
#else
/* Nothing to do on this platform */

View File

@@ -63,8 +63,9 @@ StartBeApp(void *unused)
BAppFileInfo app_info(&f);
if (app_info.InitCheck() == B_OK) {
char sig[B_MIME_TYPE_LENGTH];
if (app_info.GetSignature(sig) == B_OK)
if (app_info.GetSignature(sig) == B_OK) {
signature = strndup(sig, B_MIME_TYPE_LENGTH);
}
}
}
}
@@ -73,7 +74,7 @@ StartBeApp(void *unused)
App->Run();
delete App;
return (0);
return 0;
}
/* Initialize the Be Application, if it's not already started */
@@ -114,7 +115,7 @@ SDL_InitBeApp(void)
++SDL_BeAppActive;
/* The app is running, and we're ready to go */
return (0);
return 0;
}
/* Quit the Be Application, if there's nothing left to do */
@@ -145,7 +146,7 @@ SDL_QuitBeApp(void)
void SDL_BApp::ClearID(SDL_BWin *bwin) {
_SetSDLWindow(NULL, bwin->GetID());
int32 i = _GetNumWindowSlots() - 1;
while(i >= 0 && GetSDLWindow(i) == NULL) {
while (i >= 0 && GetSDLWindow(i) == NULL) {
_PopBackWindow();
--i;
}

View File

@@ -58,13 +58,10 @@ TInt E32Main()
newHeap = User::ChunkHeap(NULL, heapSize, heapSize, KMinHeapGrowBy);
if (NULL == newHeap)
{
if (newHeap == NULL) {
ret = 3;
goto cleanup;
}
else
{
} else {
oldHeap = User::SwitchHeap(newHeap);
/* Call stdlib main */
SDL_SetMainReady();

View File

@@ -25,9 +25,9 @@
__attribute__((weak))
void reset_IOP() {
SifInitRpc(0);
while(!SifIopReset(NULL, 0)) {
while (!SifIopReset(NULL, 0)) {
}
while(!SifIopSync()){
while (!SifIopSync()) {
}
}
@@ -56,7 +56,7 @@ static void waitUntilDeviceIsReady(char *path)
int ret = -1;
int retries = 50;
while(ret != 0 && retries > 0) {
while (ret != 0 && retries > 0) {
ret = stat(path, &buffer);
/* Wait until the device is ready */
nopdelay();

View File

@@ -46,8 +46,9 @@ int sdl_psp_setup_callbacks(void)
int thid;
thid = sceKernelCreateThread("update_thread",
sdl_psp_callback_thread, 0x11, 0xFA0, 0, 0);
if(thid >= 0)
if (thid >= 0) {
sceKernelStartThread(thid, 0, 0);
}
return thid;
}

View File

@@ -52,13 +52,13 @@ main_getcmdline(void)
/* Parse it into argv and argc */
argv = (char **)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, (argc + 1) * sizeof(*argv));
if (!argv) {
if (argv == NULL) {
return OutOfMemory();
}
for (i = 0; i < argc; ++i) {
DWORD len;
char *arg = WIN_StringToUTF8W(argvw[i]);
if (!arg) {
if (arg == NULL) {
return OutOfMemory();
}
len = (DWORD)SDL_strlen(arg);