From b11384a6942cdf3c6b6f55e0dcc0a438eff7158a Mon Sep 17 00:00:00 2001 From: NRK Date: Wed, 19 Oct 2022 14:46:22 +0200 Subject: code-style: misc changes (#374) * ensure static variables comes after non-static ones * remove depreciated DATA32 type * prefer `sizeof(expression)` over `sizeof(Type)`. * silence a -Wsign warning * {gif,webp} loader: use a pointer to reduce code-noise * gif loader: allocate in one place Reviewed-on: https://codeberg.org/nsxiv/nsxiv/pulls/374 Reviewed-by: TAAPArthur --- main.c | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) (limited to 'main.c') diff --git a/main.c b/main.c index 8754dae..1c8dd7b 100644 --- a/main.c +++ b/main.c @@ -62,17 +62,16 @@ tns_t tns; win_t win; appmode_t mode; -const XButtonEvent *xbutton_ev; - fileinfo_t *files; int filecnt, fileidx; int alternate; int markcnt; int markidx; - int prefix; -static bool extprefix; +bool title_dirty; +const XButtonEvent *xbutton_ev; +static bool extprefix; static bool resized = false; static struct { @@ -90,8 +89,6 @@ static struct { extcmd_t f; } wintitle; -bool title_dirty; - static struct { timeout_f handler; struct timeval when; @@ -104,9 +101,10 @@ static struct { { clear_resize }, }; -/************************** - function implementations - **************************/ +/* + * function implementations + */ + static void cleanup(void) { img_close(&img, false); @@ -891,7 +889,7 @@ int main(int argc, char *argv[]) } r_closedir(&dir); if (fileidx - start > 1) - qsort(files + start, fileidx - start, sizeof(fileinfo_t), fncmp); + qsort(files + start, fileidx - start, sizeof(*files), fncmp); } } -- cgit v1.2.3