tree-wide: replace FLAGS_SET(..., 1 << v) with BIT_SET(..., v)
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
||||
|
||||
#include "bitfield.h"
|
||||
#include "condition.h"
|
||||
#include "conf-parser.h"
|
||||
#include "escape.h"
|
||||
@@ -38,12 +39,9 @@ int network_config_state_to_string_alloc(NetworkConfigState s, char **ret) {
|
||||
assert(ret);
|
||||
|
||||
for (size_t i = 0; i < ELEMENTSOF(states); i++)
|
||||
if (FLAGS_SET(s, 1 << i)) {
|
||||
assert(states[i]);
|
||||
|
||||
if (!strextend_with_separator(&buf, ",", states[i]))
|
||||
if (BIT_SET(s, i))
|
||||
if (!strextend_with_separator(&buf, ",", ASSERT_PTR(states[i])))
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
*ret = TAKE_PTR(buf);
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user