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 /util.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 'util.c')
-rw-r--r-- | util.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -97,7 +97,7 @@ int r_opendir(r_dir_t *rdir, const char *dirname, bool recursive) } rdir->stcap = 512; - rdir->stack = emalloc(rdir->stcap * sizeof(char*)); + rdir->stack = emalloc(rdir->stcap * sizeof(*rdir->stack)); rdir->stlen = 0; rdir->name = (char*) dirname; @@ -164,7 +164,7 @@ char* r_readdir(r_dir_t *rdir, bool skip_dotfiles) if (rdir->stlen == rdir->stcap) { rdir->stcap *= 2; rdir->stack = erealloc(rdir->stack, - rdir->stcap * sizeof(char*)); + rdir->stcap * sizeof(*rdir->stack)); } rdir->stack[rdir->stlen++] = filename; continue; |