From b2b9ee69461727247f3fc922ff4f409d53e42b64 Mon Sep 17 00:00:00 2001 From: Thibaud Date: Wed, 16 Sep 2026 20:53:06 +0200 Subject: [PATCH] Cleanup --- main.c | 4 ++-- main.js | 2 +- math.c | 6 +++--- math.h | 1 + 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/main.c b/main.c index 6df0527..c6855d0 100644 --- a/main.c +++ b/main.c @@ -39,8 +39,8 @@ void init() { void render_frame(double dt) { time += dt; - double x = 0.5 + __builtin_cos(2.0 * PI / 10.0 * time) * 0.5; - double y = 0.5 + __builtin_sin(2.0 * PI / 10.0 * time) * 0.5; + double x = 0.5 + cos(2.0 * PI / 10.0 * time) * 0.5; + double y = 0.5 + sin(2.0 * PI / 10.0 * time) * 0.5; pos.x = x * (WIDTH - SQ_SIZE); pos.y = y * (HEIGHT - SQ_SIZE); diff --git a/main.js b/main.js index b3e086b..11c8d51 100644 --- a/main.js +++ b/main.js @@ -51,7 +51,7 @@ async function init() { instance.exports.render_frame(dt); ctx.putImageData(image, 0, 0); window.requestAnimationFrame(render); - }; + }; window.requestAnimationFrame(render); } diff --git a/math.c b/math.c index d76499a..c6985b4 100644 --- a/math.c +++ b/math.c @@ -1,6 +1,6 @@ #include "math.h" // Definition of math functions needed for fdlibm -inline double fabs(double x) { return __builtin_fabs(x); } -inline double floor(double x) { return __builtin_floor(x); } -inline double copysign(double x, double y) { return __builtin_copysign(x, y); } +double fabs(double x) { return __builtin_fabs(x); } +double floor(double x) { return __builtin_floor(x); } +double copysign(double x, double y) { return __builtin_copysign(x, y); } diff --git a/math.h b/math.h index 49f8507..bdcc165 100644 --- a/math.h +++ b/math.h @@ -5,6 +5,7 @@ double fabs(double x); double floor(double x); double copysign(double x, double y); + // Provided by fdlibm double cos(double x); double sin(double x);