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:
@@ -111,7 +111,7 @@ quit(int rc)
|
||||
x; \
|
||||
{ \
|
||||
GLenum glError = ctx.glGetError(); \
|
||||
if(glError != GL_NO_ERROR) { \
|
||||
if (glError != GL_NO_ERROR) { \
|
||||
SDL_Log("glGetError() = %i (0x%.8x) at line %i\n", glError, glError, __LINE__); \
|
||||
quit(1); \
|
||||
} \
|
||||
@@ -148,7 +148,7 @@ process_shader(GLuint *shader, const char * source, GLint shader_type)
|
||||
GL_CHECK(ctx.glGetShaderiv(*shader, GL_COMPILE_STATUS, &status));
|
||||
|
||||
/* Dump debug info (source and log) if compilation failed. */
|
||||
if(status != GL_TRUE) {
|
||||
if (status != GL_TRUE) {
|
||||
ctx.glGetProgramInfoLog(*shader, sizeof(buffer), &length, &buffer[0]);
|
||||
buffer[length] = '\0';
|
||||
SDL_Log("Shader compilation failed: %s", buffer);fflush(stderr);
|
||||
@@ -351,10 +351,18 @@ void loop()
|
||||
}
|
||||
|
||||
|
||||
if (sym == SDLK_LEFT) g_val -= 0.05;
|
||||
if (sym == SDLK_RIGHT) g_val += 0.05;
|
||||
if (sym == SDLK_UP) g_angle -= 1;
|
||||
if (sym == SDLK_DOWN) g_angle += 1;
|
||||
if (sym == SDLK_LEFT) {
|
||||
g_val -= 0.05;
|
||||
}
|
||||
if (sym == SDLK_RIGHT) {
|
||||
g_val += 0.05;
|
||||
}
|
||||
if (sym == SDLK_UP) {
|
||||
g_angle -= 1;
|
||||
}
|
||||
if (sym == SDLK_DOWN) {
|
||||
g_angle += 1;
|
||||
}
|
||||
|
||||
|
||||
break;
|
||||
@@ -396,8 +404,7 @@ void loop()
|
||||
matrix_mvp[1][1] = -2.0f / 480.0;
|
||||
matrix_mvp[3][1] = 1.0f;
|
||||
|
||||
if (0)
|
||||
{
|
||||
if (0) {
|
||||
float *f = (float *) matrix_mvp;
|
||||
SDL_Log("-----------------------------------");
|
||||
SDL_Log("[ %f, %f, %f, %f ]", *f++, *f++, *f++, *f++);
|
||||
@@ -460,7 +467,7 @@ main(int argc, char *argv[])
|
||||
|
||||
/* Initialize test framework */
|
||||
state = SDLTest_CommonCreateState(argv, SDL_INIT_VIDEO);
|
||||
if (!state) {
|
||||
if (state == NULL) {
|
||||
return 1;
|
||||
}
|
||||
for (i = 1; i < argc;) {
|
||||
@@ -558,8 +565,9 @@ main(int argc, char *argv[])
|
||||
#if 1
|
||||
path = GetNearbyFilename(f);
|
||||
|
||||
if (path == NULL)
|
||||
if (path == NULL) {
|
||||
path = SDL_strdup(f);
|
||||
}
|
||||
|
||||
if (path == NULL) {
|
||||
SDL_Log("out of memory\n");
|
||||
@@ -567,7 +575,7 @@ main(int argc, char *argv[])
|
||||
}
|
||||
|
||||
tmp = SDL_LoadBMP(path);
|
||||
if (tmp == NULL) {
|
||||
if (tmp == NULL) {
|
||||
SDL_Log("missing image file: %s", path);
|
||||
exit(-1);
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user