From 528209831fc8f188df895acae83174bb81996c96 Mon Sep 17 00:00:00 2001 From: dario-loi Date: Wed, 27 Nov 2024 14:26:58 +0100 Subject: Code quality and warning removal Solved all code quality issues, removed dead code. Correctly freed fps buffer in texture_show_fps.c Correctly checked for argc size before accessing argv (did not show up in warnings but it's still dangerous) Reordered some resource acquisition operations in examples in order to avoid framebuffer creation if wrong inputs are specified (we fail first). --- examples/rectangle.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'examples/rectangle.c') diff --git a/examples/rectangle.c b/examples/rectangle.c index 1b3a6f7..38def2e 100644 --- a/examples/rectangle.c +++ b/examples/rectangle.c @@ -1,7 +1,7 @@ #define FBGL_IMPLEMENTATION #include "fbgl.h" -int main(int argc, char *argv[]) +int main(void) { fbgl_t buffer; if (fbgl_init("/dev/fb0", &buffer) == -1) { @@ -53,7 +53,7 @@ int main(int argc, char *argv[]) color_index = 0; } - usleep(50000); // Delay to make the animation visible (adjust as needed) + nanosleep((struct timespec[]){ { 0, (int)5e7 } }, NULL); } fbgl_destroy(&buffer); -- cgit v1.2.3