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

(cherry picked from commit 6a2200823c to reduce conflicts merging between SDL2 and SDL3)
This commit is contained in:
Sylvain Becker authored and Sam Lantinga committed 2022-11-28 12:33:03 -08:00
1 parent 0739d237ad
commit fb0ce375f0
386 files changed
+6103 -4637

No files matched your search

+1 -1
View File
@@ -11,7 +11,7 @@
int
main(int argc, char *argv[])
{
return (SDL_main(argc, argv));
return SDL_main(argc, argv);
}
#else
/* Nothing to do on this platform */
+5 -4
View File
@@ -65,8 +65,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);
}
}
}
}
@@ -75,7 +76,7 @@ StartBeApp(void *unused)
App->Run();
delete App;
return (0);
return 0;
}
/* Initialize the Be Application, if it's not already started */
@@ -116,7 +117,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 */
@@ -147,7 +148,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;
}
+2 -5
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();
+3 -3
View File
@@ -28,9 +28,9 @@
__attribute__((weak))
void reset_IOP() {
SifInitRpc(0);
while(!SifIopReset(NULL, 0)) {
while (!SifIopReset(NULL, 0)) {
}
while(!SifIopSync()){
while (!SifIopSync()) {
}
}
@@ -59,7 +59,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();
+2 -1
View File
@@ -47,8 +47,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;
}
+2 -2
View File
@@ -56,13 +56,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);