From 88beeffafe18ba03436784ea1e4cbe16129f1203 Mon Sep 17 00:00:00 2001 From: nova Date: Sun, 6 Jul 2025 05:10:14 +0200 Subject: [PATCH] fixed some compiler warnings --- backend.c | 4 ++-- interactions.c | 16 +++++----------- main.c | 2 -- 3 files changed, 7 insertions(+), 15 deletions(-) diff --git a/backend.c b/backend.c index eeb0a8a..e59853e 100644 --- a/backend.c +++ b/backend.c @@ -13,6 +13,7 @@ extern unsigned int settings; extern unsigned int file_modifiers; extern unsigned int color_count; extern color *colors; +unsigned long file_offset; char* concat(const char *s1, const char *s2){ const size_t len1 = strlen(s1); @@ -150,10 +151,9 @@ void print_dir(WINDOW *win, unsigned long *line_width, unsigned long *dir_file_c if (*dir_file_count > 9) { offset_front = (snprintf(NULL, 0, "%ld", *dir_file_count)) + 1; } - for (i = 0; i < *dir_file_count; i++) { + for (i = file_offset; i < *dir_file_count; i++) { unsigned long offset_back = *line_width - (snprintf(NULL,0,"%ld",dir_content[i].file_size) + 1); - unsigned long allowed_width = *line_width+1; if (dir_content[i].status & FILE_STATUS_SELECTED) { is_selected = 1; diff --git a/interactions.c b/interactions.c index db56568..c569d00 100644 --- a/interactions.c +++ b/interactions.c @@ -40,6 +40,7 @@ extern char *terminal_width_empty_line; int read_string(WINDOW *win, int y, int x, char *str); int strcmp_offset(char *in0, char *in1, char offset); +extern void render_pass(); void user_interactions() { @@ -268,9 +269,8 @@ void open_with(){ wresize(win_b, 5, terminal_width/3); /*the div3 just looks cool*/ render_pass(); - unsigned long local_width; unsigned long local_height; - getmaxyx(win_b, local_height, local_width); + local_height = getmaxy(win_b); /* TODO(2025-06-22T01:24:36) fix fixed buffer size */ @@ -308,9 +308,8 @@ void rename_hovered(){ render_pass(); - unsigned long local_width; unsigned long local_height; - getmaxyx(win_b, local_height, local_width); + local_height = getmaxy(win_b); /* TODO(2025-06-22T01:24:30) fix fixed buffer size */ char *str = malloc(255); @@ -366,9 +365,6 @@ void delete(){ render_pass(); - unsigned long local_width; - unsigned long local_height; - getmaxyx(win_b, local_height, local_width); timeout(-1); /* negative numbers block until enter is pressed */ /* TODO(2025-06-22T01:24:30) fix fixed buffer size */ @@ -421,9 +417,8 @@ void makedir(){ wresize(win_b, 5, terminal_width/3); /*the div3 just looks cool*/ render_pass(); - unsigned long local_width; unsigned long local_height; - getmaxyx(win_b, local_height, local_width); + local_height = getmaxy(win_b); /* TODO(2025-07-03T01:19:55) fix fixed buffer size */ char *str = malloc(255); @@ -444,9 +439,8 @@ void makefile(){ wresize(win_b, 5, terminal_width/3); /*the div3 just looks cool*/ render_pass(); - unsigned long local_width; unsigned long local_height; - getmaxyx(win_b, local_height, local_width); + local_height = getmaxy(win_b); /* TODO(2025-07-03T01:19:49) fix fixed buffer size */ char *str = malloc(255); diff --git a/main.c b/main.c index 1d2ca36..ee6a82c 100644 --- a/main.c +++ b/main.c @@ -89,7 +89,6 @@ int main(){ render_pass(); } - /* threading_free(); pthread_join(thread_l, NULL); @@ -97,7 +96,6 @@ int main(){ pthread_join(thread_m, NULL); pthread_join(thread_t, NULL); pthread_join(thread_b, NULL); - */ delwin(win_l); delwin(win_m);