diff options
author | NRK <nrk@disroot.org> | 2023-02-10 06:35:53 +0100 |
---|---|---|
committer | NRK <nrk@disroot.org> | 2023-03-11 13:37:04 +0100 |
commit | f2f4903de4bd3ce06c03dd66f0c9a7dda97a3550 (patch) | |
tree | e0771fca7b5fb4a88be5aee839f7a29e5696d4ee /autoreload.c | |
parent | 2434e83807360bfe43e3c404be12438f00a894ab (diff) | |
download | nsxiv-f2f4903de4bd3ce06c03dd66f0c9a7dda97a3550.tar.zst |
apply clang-format
minus the bogus changes
Co-authored-by: Berke Kocaoğlu <berke.kocaoglu@metu.edu.tr>
Diffstat (limited to 'autoreload.c')
-rw-r--r-- | autoreload.c | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/autoreload.c b/autoreload.c index 1c2fbf7..8b3f6da 100644 --- a/autoreload.c +++ b/autoreload.c @@ -28,7 +28,10 @@ #include <sys/inotify.h> #include <unistd.h> -static struct { char *buf; size_t len; } scratch; +static struct { + char *buf; + size_t len; +} scratch; void arl_init(arl_t *arl) { @@ -94,7 +97,10 @@ bool arl_handle(arl_t *arl) char *ptr; const struct inotify_event *e; /* inotify_event aligned buffer */ - static union { char d[4096]; struct inotify_event e; } buf; + static union { + char d[4096]; + struct inotify_event e; + } buf; while (true) { ssize_t len = read(arl->fd, buf.d, sizeof(buf.d)); @@ -105,7 +111,7 @@ bool arl_handle(arl_t *arl) break; } for (ptr = buf.d; ptr < buf.d + len; ptr += sizeof(*e) + e->len) { - e = (const struct inotify_event*) ptr; + e = (const struct inotify_event *)ptr; if (e->wd == arl->wd_file && (e->mask & IN_CLOSE_WRITE)) { reload = true; } else if (e->wd == arl->wd_file && (e->mask & IN_DELETE_SELF)) { @@ -128,18 +134,18 @@ void arl_init(arl_t *arl) void arl_cleanup(arl_t *arl) { - (void) arl; + (void)arl; } void arl_add(arl_t *arl, const char *filepath) { - (void) arl; - (void) filepath; + (void)arl; + (void)filepath; } bool arl_handle(arl_t *arl) { - (void) arl; + (void)arl; return false; } |