diff --git a/.clang-format b/.clang-format index c89e01a..07121bf 100644 --- a/.clang-format +++ b/.clang-format @@ -1,7 +1,7 @@ AlignAfterOpenBracket: BlockIndent AlignConsecutiveMacros: true -AllowShortIfStatementsOnASingleLine: true -AllowShortLoopsOnASingleLine: true +AllowShortIfStatementsOnASingleLine: false +AllowShortLoopsOnASingleLine: false BasedOnStyle: LLVM BinPackArguments: false BinPackParameters: false diff --git a/Makefile b/Makefile index 73286c7..f9be24f 100644 --- a/Makefile +++ b/Makefile @@ -1,3 +1,5 @@ +VERSION ?= 9.0.1 + prefix ?= /usr/local exec_prefix ?= $(prefix) bindir ?= $(exec_prefix)/bin diff --git a/glxgears.c b/glxgears.c index 3c6af3b..70ff8b0 100644 --- a/glxgears.c +++ b/glxgears.c @@ -225,14 +225,16 @@ static void draw(void) { fflush(stdout); T0 = t; Frames = 0; - if ((t >= 999.0 * autoexit) && (autoexit)) cleanup(); + if ((t >= 999.0 * autoexit) && (autoexit)) + cleanup(); } } static void idle(void) { static double t0 = -1.; double dt, t = glutGet(GLUT_ELAPSED_TIME) / 1000.0; - if (t0 < 0.0) t0 = t; + if (t0 < 0.0) + t0 = t; dt = t - t0; t0 = t; @@ -268,7 +270,7 @@ static void key(unsigned char k, int, int) { Animate = !Animate; update_idle_func(); break; - case 27: /* Escape */ + case '\e': cleanup(); default: return; @@ -351,7 +353,7 @@ static void visible(int vis) { } void parse_args(int argc, char *argv[]) { - for (GLint i = 1; i < argc; i++) { + for (GLint i = 1; i < argc; i++) if (strcmp(argv[i], "-info") == 0) { printf("GL_VENDOR = %s\n", (char *)glGetString(GL_VENDOR)); printf("GL_RENDERER = %s\n", (char *)glGetString(GL_RENDERER)); @@ -362,10 +364,8 @@ void parse_args(int argc, char *argv[]) { autoexit = 30; printf("Auto Exit after %i seconds.\n", autoexit); fflush(stdout); - } else if (strcmp(argv[i], "-noanim") == 0) { + } else if (strcmp(argv[i], "-noanim") == 0) Animate = GL_FALSE; - } - } } int main(int argc, char *argv[]) {