diff --git a/.github/workflows/build_freebsd.yml b/.github/workflows/build_freebsd.yml index 319808665..cd5ccaac4 100644 --- a/.github/workflows/build_freebsd.yml +++ b/.github/workflows/build_freebsd.yml @@ -43,7 +43,7 @@ jobs: env: LIBS: "-lm -lpthread -lX11 -lXi -lGL -lexecinfo" SRCS: "src/*.c third_party/bearssl/*.c" - FLAGS: "-O1 -s -fno-stack-protector -fno-math-errno -Qn -Werror -fvisibility=hidden -rdynamic" + FLAGS: "-O1 -s -fno-stack-protector -fno-math-errno -Qn -Werror -fvisibility=hidden -rdynamic -Werror" PLAT32_FLAGS: "-fno-pie -fcf-protection=none -I freebsd32/include -L freebsd32/lib" PLAT64_FLAGS: "-fno-pie -fcf-protection=none -I freebsd64/include -L freebsd64/lib" diff --git a/.github/workflows/build_linux.yml b/.github/workflows/build_linux.yml index e0ab9a074..272bea502 100644 --- a/.github/workflows/build_linux.yml +++ b/.github/workflows/build_linux.yml @@ -43,7 +43,7 @@ jobs: env: LIBS: "-lX11 -lXi -lpthread -lGL -lm -ldl" SRCS: "src/*.c third_party/bearssl/*.c" - FLAGS: "-O1 -s -fno-stack-protector -fno-math-errno -Qn -Werror -fvisibility=hidden -rdynamic" + FLAGS: "-O1 -s -fno-stack-protector -fno-math-errno -Qn -Werror -fvisibility=hidden -rdynamic -Werror" NIX32_FLAGS: "-no-pie -fno-pie -m32 -fcf-protection=none -L ./lib -Wl,--unresolved-symbols=ignore-in-shared-libs" run: | LATEST_FLAG=-DCC_COMMIT_SHA=\"${GITHUB_SHA::9}\" @@ -107,7 +107,7 @@ jobs: env: LIBS: "-lX11 -lXi -lpthread -lGL -lm -ldl" SRCS: "src/*.c third_party/bearssl/*.c" - FLAGS: "-O1 -s -fno-stack-protector -fno-math-errno -Qn -Werror -fvisibility=hidden -rdynamic" + FLAGS: "-O1 -s -fno-stack-protector -fno-math-errno -Qn -Werror -fvisibility=hidden -rdynamic -Werror" NIX64_FLAGS: "-no-pie -fno-pie -m64 -fcf-protection=none -rdynamic -L ./lib -Wl,--unresolved-symbols=ignore-in-shared-libs" run: | LATEST_FLAG=-DCC_COMMIT_SHA=\"${GITHUB_SHA::9}\" diff --git a/.github/workflows/build_netbsd.yml b/.github/workflows/build_netbsd.yml index 4d264f5cf..35e80d5c4 100644 --- a/.github/workflows/build_netbsd.yml +++ b/.github/workflows/build_netbsd.yml @@ -37,7 +37,7 @@ jobs: env: LIBS: "-lm -lpthread -lX11 -lXi -lGL -lexecinfo" SRCS: "src/*.c third_party/bearssl/*.c" - FLAGS: "-O1 -s -fno-stack-protector -fno-math-errno -Qn -Werror -Wl,-R/usr/X11R7/lib -fvisibility=hidden -rdynamic" + FLAGS: "-O1 -s -fno-stack-protector -fno-math-errno -Qn -Werror -Wl,-R/usr/X11R7/lib -fvisibility=hidden -rdynamic -Werror" PLAT64_FLAGS: "-fno-pie -fcf-protection=none -I netbsd64/include -L netbsd64/lib -Wl,--unresolved-symbols=ignore-in-shared-libs" run: | LATEST_FLAG=-DCC_COMMIT_SHA=\"${GITHUB_SHA::9}\" diff --git a/src/Entity.c b/src/Entity.c index 69b0a3ce7..b7125696f 100644 --- a/src/Entity.c +++ b/src/Entity.c @@ -66,15 +66,15 @@ void Entity_GetTransform(struct Entity* e, Vec3 pos, Vec3 scale, struct Matrix* struct Matrix tmp; Matrix_Scale(m, scale.x, scale.y, scale.z); - if (e->RotZ) { + if (e->RotZ != 0.0f) { Matrix_RotateZ( &tmp, -e->RotZ * MATH_DEG2RAD); Matrix_MulBy(m, &tmp); } - if (e->RotX) { + if (e->RotX != 0.0f) { Matrix_RotateX( &tmp, -e->RotX * MATH_DEG2RAD); Matrix_MulBy(m, &tmp); } - if (e->RotY) { + if (e->RotY != 0.0f) { Matrix_RotateY( &tmp, -e->RotY * MATH_DEG2RAD); Matrix_MulBy(m, &tmp); } diff --git a/src/Game.c b/src/Game.c index 4439fc26b..b51f4b613 100644 --- a/src/Game.c +++ b/src/Game.c @@ -840,7 +840,7 @@ void Game_RenderFrame(void) { if (Game_ScreenshotRequested) Game_TakeScreenshot(); Gfx_EndFrame(); - if (gfx_minFrameMs) LimitFPS(); + if (gfx_minFrameMs != 0.0f) LimitFPS(); } void Game_Free(void) { diff --git a/src/LScreens.c b/src/LScreens.c index d3dd37041..2862c2996 100644 --- a/src/LScreens.c +++ b/src/LScreens.c @@ -1084,9 +1084,9 @@ static void CheckResourcesScreen_Activated(struct LScreen* s_) { } static void CheckResourcesScreen_ResetArea(struct Context2D* ctx, int x, int y, int width, int height) { - int R = BitmapCol_R(Launcher_Theme.BackgroundColor) * 0.78f; /* 153 -> 120 */ - int G = BitmapCol_G(Launcher_Theme.BackgroundColor) * 0.70f; /* 127 -> 89 */ - int B = BitmapCol_B(Launcher_Theme.BackgroundColor) * 0.88f; /* 172 -> 151 */ + float R = BitmapCol_R(Launcher_Theme.BackgroundColor) * 0.78f; /* 153 -> 120 */ + float G = BitmapCol_G(Launcher_Theme.BackgroundColor) * 0.70f; /* 127 -> 89 */ + float B = BitmapCol_B(Launcher_Theme.BackgroundColor) * 0.88f; /* 172 -> 151 */ Gradient_Noise(ctx, BitmapColor_RGB(R, G, B), 4, x, y, width, height); } diff --git a/src/Stream.c b/src/Stream.c index b298cb17e..6ce8ef4bf 100644 --- a/src/Stream.c +++ b/src/Stream.c @@ -209,10 +209,13 @@ static cc_result Stream_PortionSkip(struct Stream* s, cc_uint32 count) { } static cc_result Stream_PortionPosition(struct Stream* s, cc_uint32* position) { - *position = s->meta.portion.length - s->meta.portion.left; return 0; + *position = s->meta.portion.length - s->meta.portion.left; + return 0; } + static cc_result Stream_PortionLength(struct Stream* s, cc_uint32* length) { - *length = s->meta.portion.length; return 0; + *length = s->meta.portion.length; + return 0; } void Stream_ReadonlyPortion(struct Stream* s, struct Stream* source, cc_uint32 len) { diff --git a/src/Vectors.c b/src/Vectors.c index c69baab71..142df1194 100644 --- a/src/Vectors.c +++ b/src/Vectors.c @@ -14,7 +14,7 @@ void Vec3_Normalise(Vec3* v) { float scale, lenSquared; lenSquared = v->x * v->x + v->y * v->y + v->z * v->z; /* handle zero vector */ - if (!lenSquared) return; + if (lenSquared == 0.0f) return; scale = 1.0f / Math_SqrtF(lenSquared); v->x = v->x * scale; diff --git a/src/saturn/Platform_Saturn.c b/src/saturn/Platform_Saturn.c index 4c8cd4f33..627c65413 100644 --- a/src/saturn/Platform_Saturn.c +++ b/src/saturn/Platform_Saturn.c @@ -113,7 +113,6 @@ static void Stopwatch_Init(void) { cpu_frt_ovi_set(ovf_handler); cpu_frt_interrupt_priority_set(15); - cpu_frt_count_set(0); }