From 7bfc96fd293b099182cf78cc582cb70df47a836c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miloslav=20=C4=8C=C3=AD=C5=BE?= Date: Sun, 14 Jul 2019 03:48:53 +0200 Subject: [PATCH] Remove clang warning --- programs/make.sh | 5 +++-- small3dlib.h | 5 ++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/programs/make.sh b/programs/make.sh index 6e5b564..3d9b92e 100755 --- a/programs/make.sh +++ b/programs/make.sh @@ -1,5 +1,6 @@ #!/bin/bash -PROGRAM=testSDL +PROGRAM=helloTerminal -clear; clear; g++ -x c -g -fmax-errors=5 -pedantic -Wall -Wextra -o $PROGRAM $PROGRAM.c -lSDL2 2>&1 >/dev/null && ./$PROGRAM +clear; clear; g++ -x c -g -fmax-errors=5 -pedantic -O3 -Wall -Wextra -o $PROGRAM $PROGRAM.c -lSDL2 2>&1 >/dev/null && ./$PROGRAM +#clear; clear; clang -x c -g -pedantic -O3 -Wall -Wextra -o $PROGRAM $PROGRAM.c -lSDL2 2>&1 >/dev/null && ./$PROGRAM diff --git a/small3dlib.h b/small3dlib.h index 034f477..3452240 100644 --- a/small3dlib.h +++ b/small3dlib.h @@ -1286,9 +1286,12 @@ S3L_Unit S3L_sin(S3L_Unit x) int8_t positive = 1; if (x < S3L_SIN_TABLE_LENGTH) - x = x; + { + } else if (x < S3L_SIN_TABLE_LENGTH * 2) + { x = S3L_SIN_TABLE_LENGTH * 2 - x - 1; + } else if (x < S3L_SIN_TABLE_LENGTH * 3) { x = x - S3L_SIN_TABLE_LENGTH * 2;