diff options
author | NRK <nrk@disroot.org> | 2022-10-19 14:46:22 +0200 |
---|---|---|
committer | NRK <nrk@disroot.org> | 2022-10-19 14:46:22 +0200 |
commit | b11384a6942cdf3c6b6f55e0dcc0a438eff7158a (patch) | |
tree | 68aefd1be3dc6fe83384c1cba6e951c7ca9aa816 /main.c | |
parent | aa56aa23030e9f8680d5ef366f2bd72fd342c14f (diff) | |
download | nsxiv-b11384a6942cdf3c6b6f55e0dcc0a438eff7158a.tar.zst |
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 <taaparthur@noreply.codeberg.org>
Diffstat (limited to 'main.c')
-rw-r--r-- | main.c | 18 |
1 files changed, 8 insertions, 10 deletions
@@ -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); } } |