diff options
| author | dario-loi <loi.1940849@studenti.uniroma1.it> | 2024-11-27 14:26:58 +0100 |
|---|---|---|
| committer | dario-loi <loi.1940849@studenti.uniroma1.it> | 2024-11-27 14:28:07 +0100 |
| commit | 528209831fc8f188df895acae83174bb81996c96 (patch) | |
| tree | 84f143235b5e1e6f1d9d06764ac35addd4b97f5e /examples/rectangle.c | |
| parent | eff7f86c4b81e804b13c5606fcc73a6dbfa58677 (diff) | |
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).
Diffstat (limited to 'examples/rectangle.c')
| -rw-r--r-- | examples/rectangle.c | 4 |
1 files changed, 2 insertions, 2 deletions
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); |
