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

@@ -26,10 +26,10 @@ SDL_HASINTERSECTION(const RECTTYPE * A, const RECTTYPE * B)
{
SCALARTYPE Amin, Amax, Bmin, Bmax;
if (!A) {
if (A == NULL) {
SDL_InvalidParamError("A");
return SDL_FALSE;
} else if (!B) {
} else if (B == NULL) {
SDL_InvalidParamError("B");
return SDL_FALSE;
} else if (SDL_RECTEMPTY(A) || SDL_RECTEMPTY(B)) {
@@ -72,13 +72,13 @@ SDL_INTERSECTRECT(const RECTTYPE * A, const RECTTYPE * B, RECTTYPE * result)
{
SCALARTYPE Amin, Amax, Bmin, Bmax;
if (!A) {
if (A == NULL) {
SDL_InvalidParamError("A");
return SDL_FALSE;
} else if (!B) {
} else if (B == NULL) {
SDL_InvalidParamError("B");
return SDL_FALSE;
} else if (!result) {
} else if (result == NULL) {
SDL_InvalidParamError("result");
return SDL_FALSE;
} else if (SDL_RECTEMPTY(A) || SDL_RECTEMPTY(B)) { /* Special cases for empty rects */
@@ -123,13 +123,13 @@ SDL_UNIONRECT(const RECTTYPE * A, const RECTTYPE * B, RECTTYPE * result)
{
SCALARTYPE Amin, Amax, Bmin, Bmax;
if (!A) {
if (A == NULL) {
SDL_InvalidParamError("A");
return;
} else if (!B) {
} else if (B == NULL) {
SDL_InvalidParamError("B");
return;
} else if (!result) {
} else if (result == NULL) {
SDL_InvalidParamError("result");
return;
} else if (SDL_RECTEMPTY(A)) { /* Special cases for empty Rects */
@@ -183,7 +183,7 @@ SDL_bool SDL_ENCLOSEPOINTS(const POINTTYPE * points, int count, const RECTTYPE *
SCALARTYPE x, y;
int i;
if (!points) {
if (points == NULL) {
SDL_InvalidParamError("points");
return SDL_FALSE;
} else if (count < 1) {
@@ -305,19 +305,19 @@ SDL_INTERSECTRECTANDLINE(const RECTTYPE * rect, SCALARTYPE *X1, SCALARTYPE *Y1,
SCALARTYPE recty2;
int outcode1, outcode2;
if (!rect) {
if (rect == NULL) {
SDL_InvalidParamError("rect");
return SDL_FALSE;
} else if (!X1) {
} else if (X1 == NULL) {
SDL_InvalidParamError("X1");
return SDL_FALSE;
} else if (!Y1) {
} else if (Y1 == NULL) {
SDL_InvalidParamError("Y1");
return SDL_FALSE;
} else if (!X2) {
} else if (X2 == NULL) {
SDL_InvalidParamError("X2");
return SDL_FALSE;
} else if (!Y2) {
} else if (Y2 == NULL) {
SDL_InvalidParamError("Y2");
return SDL_FALSE;
} else if (SDL_RECTEMPTY(rect)) {