mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-03-20 15:51:07 +01:00
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:
@@ -106,7 +106,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); \
|
||||
} \
|
||||
@@ -231,7 +231,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.glGetShaderInfoLog(*shader, sizeof(buffer), &length, &buffer[0]);
|
||||
buffer[length] = '\0';
|
||||
SDL_Log("Shader compilation failed: %s", buffer);
|
||||
@@ -251,7 +251,7 @@ link_program(struct shader_data *data)
|
||||
GL_CHECK(ctx.glLinkProgram(data->shader_program));
|
||||
GL_CHECK(ctx.glGetProgramiv(data->shader_program, GL_LINK_STATUS, &status));
|
||||
|
||||
if(status != GL_TRUE) {
|
||||
if (status != GL_TRUE) {
|
||||
ctx.glGetProgramInfoLog(data->shader_program, sizeof(buffer), &length, &buffer[0]);
|
||||
buffer[length] = '\0';
|
||||
SDL_Log("Program linking failed: %s", buffer);
|
||||
@@ -424,12 +424,24 @@ Render(unsigned int width, unsigned int height, shader_data* data)
|
||||
data->angle_y += 2;
|
||||
data->angle_z += 1;
|
||||
|
||||
if(data->angle_x >= 360) data->angle_x -= 360;
|
||||
if(data->angle_x < 0) data->angle_x += 360;
|
||||
if(data->angle_y >= 360) data->angle_y -= 360;
|
||||
if(data->angle_y < 0) data->angle_y += 360;
|
||||
if(data->angle_z >= 360) data->angle_z -= 360;
|
||||
if(data->angle_z < 0) data->angle_z += 360;
|
||||
if (data->angle_x >= 360) {
|
||||
data->angle_x -= 360;
|
||||
}
|
||||
if (data->angle_x < 0) {
|
||||
data->angle_x += 360;
|
||||
}
|
||||
if (data->angle_y >= 360) {
|
||||
data->angle_y -= 360;
|
||||
}
|
||||
if (data->angle_y < 0) {
|
||||
data->angle_y += 360;
|
||||
}
|
||||
if (data->angle_z >= 360) {
|
||||
data->angle_z -= 360;
|
||||
}
|
||||
if (data->angle_z < 0) {
|
||||
data->angle_z += 360;
|
||||
}
|
||||
|
||||
GL_CHECK(ctx.glViewport(0, 0, width, height));
|
||||
GL_CHECK(ctx.glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT));
|
||||
@@ -545,7 +557,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;) {
|
||||
|
||||
Reference in New Issue
Block a user