strv: make iterator in STRV_FOREACH() declaread in the loop

This also avoids multiple evaluations in STRV_FOREACH_BACKWARDS()
This commit is contained in:
Yu Watanabe
2022-03-19 08:33:33 +09:00
parent 80a226b26b
commit de010b0b2e
210 changed files with 109 additions and 621 deletions
-3
View File
@@ -12,7 +12,6 @@
#include "systemctl.h"
static int normalize_filenames(char **names) {
char **u;
int r;
STRV_FOREACH(u, names)
@@ -40,7 +39,6 @@ static int normalize_filenames(char **names) {
}
static int normalize_names(char **names) {
char **u;
bool was_path = false;
STRV_FOREACH(u, names) {
@@ -141,7 +139,6 @@ int verb_enable(int argc, char *argv[], void *userdata) {
sd_bus *bus;
if (STR_IN_SET(verb, "mask", "unmask")) {
char **name;
_cleanup_(lookup_paths_free) LookupPaths lp = {};
r = lookup_paths_init(&lp, arg_scope, 0, arg_root);