mirror of
https://github.com/troglobit/finit.git
synced 2026-11-18 19:30:56 +00:00
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 <troglobit@gmail.com>
This commit is contained in:
1 parent
3d1b95aa7a
commit
f958aa504e
1 file changed
+6
-6
+6
-6
@@ -127,12 +127,12 @@ static int cond_checkpath(const char *path)
|
|||||||
return 0;
|
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;
|
unsigned int rgen;
|
||||||
|
|
||||||
_d("%s", path);
|
_d("%s <= %d", path, next);
|
||||||
|
|
||||||
rgen = cond_get_gen(_PATH_RECONF);
|
rgen = cond_get_gen(_PATH_RECONF);
|
||||||
if (!rgen) {
|
if (!rgen) {
|
||||||
@@ -140,9 +140,9 @@ int cond_set_path(const char *path, enum cond_state new)
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
old = cond_get_path(path);
|
prev = cond_get_path(path);
|
||||||
|
|
||||||
switch (new) {
|
switch (next) {
|
||||||
case COND_ON:
|
case COND_ON:
|
||||||
if (cond_checkpath(path))
|
if (cond_checkpath(path))
|
||||||
return 0;
|
return 0;
|
||||||
@@ -159,7 +159,7 @@ int cond_set_path(const char *path, enum cond_state new)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
return new != old;
|
return next != prev;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Should only be used by cond_set*(), cond_clear(), and usr plugin! */
|
/* Should only be used by cond_set*(), cond_clear(), and usr plugin! */
|
||||||
|
|||||||
Reference in new issue
Block a user