From f958aa504e88e346f16743bf713d6104ae2be1c7 Mon Sep 17 00:00:00 2001 From: Joachim Wiberg Date: Thu, 15 Apr 2021 08:44:03 +0200 Subject: [PATCH] cond_set_path(): minor, improve debug, 'new' -> 'next' - Avoid using reserved C++ keyword 'new' - Rename new -> next - Rename old -> prev - Add debug for value being set to cond path Signed-off-by: Joachim Wiberg --- src/cond-w.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/cond-w.c b/src/cond-w.c index 7cc73bc2..fef3e75d 100644 --- a/src/cond-w.c +++ b/src/cond-w.c @@ -127,12 +127,12 @@ static int cond_checkpath(const char *path) return 0; } -int cond_set_path(const char *path, enum cond_state new) +int cond_set_path(const char *path, enum cond_state next) { - enum cond_state old; + enum cond_state prev; unsigned int rgen; - _d("%s", path); + _d("%s <= %d", path, next); rgen = cond_get_gen(_PATH_RECONF); if (!rgen) { @@ -140,9 +140,9 @@ int cond_set_path(const char *path, enum cond_state new) return -1; } - old = cond_get_path(path); + prev = cond_get_path(path); - switch (new) { + switch (next) { case COND_ON: if (cond_checkpath(path)) return 0; @@ -159,7 +159,7 @@ int cond_set_path(const char *path, enum cond_state new) return 0; } - return new != old; + return next != prev; } /* Should only be used by cond_set*(), cond_clear(), and usr plugin! */