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/line.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'examples/line.c') diff --git a/examples/line.c b/examples/line.c index e22a113..c57fe1f 100644 --- a/examples/line.c +++ b/examples/line.c @@ -1,7 +1,7 @@ #define FBGL_IMPLEMENTATION #include "fbgl.h" -int main(int argc, char *argv[]) +int main() { fbgl_t buffer; if (fbgl_init("/dev/fb0", &buffer) == -1) { @@ -15,7 +15,7 @@ int main(int argc, char *argv[]) for (int i = 0; i < 1890; i++) { start.x = i; fbgl_draw_line(start, end, 0xFFFFFF, &buffer); - usleep(1000); // sleep for 1 millisecond + nanosleep((struct timespec[]){ { 0, 10000000 } }, NULL); } fbgl_draw_line(start, end, 0x000000, &buffer); -- cgit v1.2.3