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:
@@ -139,7 +139,7 @@ static SDL_bool CompileShader(GLhandleARB shader, const char *source)
|
||||
|
||||
glGetObjectParameterivARB(shader, GL_OBJECT_INFO_LOG_LENGTH_ARB, &length);
|
||||
info = (char *) SDL_malloc(length + 1);
|
||||
if (!info) {
|
||||
if (info == NULL) {
|
||||
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Out of memory!");
|
||||
} else {
|
||||
glGetInfoLogARB(shader, length, NULL, info);
|
||||
@@ -167,7 +167,7 @@ static SDL_bool LinkProgram(ShaderData *data)
|
||||
|
||||
glGetObjectParameterivARB(data->program, GL_OBJECT_INFO_LOG_LENGTH_ARB, &length);
|
||||
info = (char *) SDL_malloc(length + 1);
|
||||
if (!info) {
|
||||
if (info == NULL) {
|
||||
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Out of memory!");
|
||||
} else {
|
||||
glGetInfoLogARB(data->program, length, NULL, info);
|
||||
@@ -465,7 +465,7 @@ int main(int argc, char **argv)
|
||||
|
||||
/* Create a 640x480 OpenGL screen */
|
||||
window = SDL_CreateWindow( "Shader Demo", SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, 640, 480, SDL_WINDOW_OPENGL );
|
||||
if ( !window ) {
|
||||
if (window == NULL) {
|
||||
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Unable to create OpenGL window: %s\n", SDL_GetError());
|
||||
SDL_Quit();
|
||||
exit(2);
|
||||
@@ -478,7 +478,7 @@ int main(int argc, char **argv)
|
||||
}
|
||||
|
||||
surface = SDL_LoadBMP("icon.bmp");
|
||||
if ( ! surface ) {
|
||||
if (surface == NULL) {
|
||||
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Unable to load icon.bmp: %s\n", SDL_GetError());
|
||||
SDL_Quit();
|
||||
exit(3);
|
||||
|
||||
Reference in New Issue
Block a user