From a719af82651c146c68fe65773848c4c19db7f573 Mon Sep 17 00:00:00 2001 From: onyx-and-iris Date: Thu, 25 Jul 2024 17:34:38 +0100 Subject: [PATCH] use ++i --- src/log.c | 4 ++-- src/util.c | 2 +- src/vmrcli.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/log.c b/src/log.c index 8248a9d..e6579e7 100644 --- a/src/log.c +++ b/src/log.c @@ -118,7 +118,7 @@ void log_set_quiet(bool enable) int log_add_callback(log_LogFn fn, void *udata, int level) { - for (int i = 0; i < MAX_CALLBACKS; i++) + for (int i = 0; i < MAX_CALLBACKS; ++i) { if (!L.callbacks[i].fn) { @@ -163,7 +163,7 @@ void log_log(int level, const char *file, int line, const char *fmt, ...) va_end(ev.ap); } - for (int i = 0; i < MAX_CALLBACKS && L.callbacks[i].fn; i++) + for (int i = 0; i < MAX_CALLBACKS && L.callbacks[i].fn; ++i) { Callback *cb = &L.callbacks[i]; if (level >= cb->level) diff --git a/src/util.c b/src/util.c index 6493781..ef1d0e8 100644 --- a/src/util.c +++ b/src/util.c @@ -92,7 +92,7 @@ bool is_comment(char *s) */ struct quickcommand *command_in_quickcommands(const char *command_key, const struct quickcommand *quickcommands, int n) { - for (int i = 0; i < n; i++) + for (int i = 0; i < n; ++i) { if (strcmp(command_key, quickcommands[i].name) == 0) { diff --git a/src/vmrcli.c b/src/vmrcli.c index d509171..220c195 100644 --- a/src/vmrcli.c +++ b/src/vmrcli.c @@ -191,7 +191,7 @@ int main(int argc, char *argv[]) } else { - for (int i = optind; i < argc; i++) + for (int i = optind; i < argc; ++i) { parse_input(vmr, argv[i]); }