1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2024-12-23 17:34:00 +03:00

test-bus-match: small modernization

This commit is contained in:
Zbigniew Jędrzejewski-Szmek 2021-03-04 21:25:14 +01:00
parent c25eb44aef
commit dd2e9b7658

View File

@ -37,13 +37,12 @@ static bool mask_contains(unsigned a[], unsigned n) {
}
static int match_add(sd_bus_slot *slots, struct bus_match_node *root, const char *match, int value) {
struct bus_match_component *components = NULL;
unsigned n_components = 0;
struct bus_match_component *components;
unsigned n_components;
sd_bus_slot *s;
int r;
s = slots + value;
zero(*s);
r = bus_match_parse(match, &components, &n_components);
if (r < 0)
@ -74,8 +73,7 @@ int main(int argc, char *argv[]) {
_cleanup_(sd_bus_message_unrefp) sd_bus_message *m = NULL;
_cleanup_(sd_bus_flush_close_unrefp) sd_bus *bus = NULL;
enum bus_match_node_type i;
sd_bus_slot slots[19];
sd_bus_slot slots[19] = {};
int r;
test_setup_logging(LOG_INFO);
@ -124,7 +122,7 @@ int main(int argc, char *argv[]) {
assert_se(bus_match_run(NULL, &root, m) == 0);
assert_se(mask_contains((unsigned[]) { 9, 5, 10, 12, 14, 7, 15, 16, 17 }, 9));
for (i = 0; i < _BUS_MATCH_NODE_TYPE_MAX; i++) {
for (enum bus_match_node_type i = 0; i < _BUS_MATCH_NODE_TYPE_MAX; i++) {
char buf[32];
const char *x;