Commit Graph

6 Commits (master)

Author SHA1 Message Date
NRK f2f4903de4 apply clang-format
minus the bogus changes

Co-authored-by: Berke Kocaoğlu <berke.kocaoglu@metu.edu.tr>
1 year ago
NRK a051ad210d update copyright year 1 year ago
NRK 94d531fd82 autoreload: simplify and cleanup (#342)
the current code is quite hacky and complex as it mixes multiple pointers. all
of this complexity is unnecessary. drop it by introducing an explicit scratch
buffer instead of implicitly abusing `arl->filename` as one. this also reduces
some unnecessary allocation overhead.

additionally, the argument to arl_setup must be the result of `realpath(3)` (as
commented in `nsxiv.h`). instead of commenting it, assert it.

and lastly, rename `arl_setup` to `arl_add` since it's not doing any "setup"
but rather *adding* a file to watch.

Reviewed-on: https://codeberg.org/nsxiv/nsxiv/pulls/342
Reviewed-by: explosion-mental <explosion-mental@noreply.codeberg.org>
2 years ago
NRK b162aee497 sort and group includes
* includes are sorted alphabetically

* their grouping and layout is the following:
  - nsxiv.h will be the first include
  - followed by any internal headers (e.g "commands.h" "config.h")
  - followed by system headers (<stdlib.h> etc)
  - followed by third party headers (X.h libwebp etc)

* also add `llvm-include-order` check to clang-tidy so that it can catch
  unsorted includes during CI.
2 years ago
NRK 5c3a796e55 [ci]: slience some clang-tidy warnings
the warnings on r_readdir(), img_load_gif() and strcpy seems to be false
positives. the warning about fmt being unused is valid, but not worth
fixing with additional #ifdef guards.

use `assert` to silence the false positive cases when possible,
otherwise use a NOLINT comment with an explanation.
2 years ago
explosion-mental f9662efb1f
merge autoreload_{inotify,nop}.c into autoreload.c (#263) 2 years ago