tree-wide: drop !! casts to booleans

This commit is contained in:
Frantisek Sumsal 2023-12-25 11:46:28 +01:00
parent fcd2db31c0
commit 0a6a59650e
4 changed files with 13 additions and 13 deletions

View file

@ -627,7 +627,7 @@ static int message_new_reply(
return r;
}
t->dont_send = !!(call->header->flags & BUS_MESSAGE_NO_REPLY_EXPECTED);
t->dont_send = FLAGS_SET(call->header->flags, BUS_MESSAGE_NO_REPLY_EXPECTED);
t->enforced_reply_signature = call->enforced_reply_signature;
/* let's copy the sensitive flag over. Let's do that as a safety precaution to keep a transaction

View file

@ -217,7 +217,7 @@ static int bus_socket_auth_verify_client(sd_bus *b) {
/* And possibly check the third line, too */
if (b->accept_fd) {
l = lines[i++];
b->can_fds = !!memory_startswith(l, lines[i] - l, "AGREE_UNIX_FD");
b->can_fds = memory_startswith(l, lines[i] - l, "AGREE_UNIX_FD");
}
assert(i == n);

View file

@ -321,7 +321,7 @@ _public_ int sd_bus_set_bus_client(sd_bus *bus, int b) {
assert_return(!bus->patch_sender, -EPERM);
assert_return(!bus_origin_changed(bus), -ECHILD);
bus->bus_client = !!b;
bus->bus_client = b;
return 0;
}
@ -331,7 +331,7 @@ _public_ int sd_bus_set_monitor(sd_bus *bus, int b) {
assert_return(bus->state == BUS_UNSET, -EPERM);
assert_return(!bus_origin_changed(bus), -ECHILD);
bus->is_monitor = !!b;
bus->is_monitor = b;
return 0;
}
@ -341,7 +341,7 @@ _public_ int sd_bus_negotiate_fds(sd_bus *bus, int b) {
assert_return(bus->state == BUS_UNSET, -EPERM);
assert_return(!bus_origin_changed(bus), -ECHILD);
bus->accept_fd = !!b;
bus->accept_fd = b;
return 0;
}
@ -353,7 +353,7 @@ _public_ int sd_bus_negotiate_timestamp(sd_bus *bus, int b) {
/* This is not actually supported by any of our transports these days, but we do honour it for synthetic
* replies, and maybe one day classic D-Bus learns this too */
bus->attach_timestamp = !!b;
bus->attach_timestamp = b;
return 0;
}
@ -380,7 +380,7 @@ _public_ int sd_bus_set_server(sd_bus *bus, int b, sd_id128_t server_id) {
assert_return(bus->state == BUS_UNSET, -EPERM);
assert_return(!bus_origin_changed(bus), -ECHILD);
bus->is_server = !!b;
bus->is_server = b;
bus->server_id = server_id;
return 0;
}
@ -391,7 +391,7 @@ _public_ int sd_bus_set_anonymous(sd_bus *bus, int b) {
assert_return(bus->state == BUS_UNSET, -EPERM);
assert_return(!bus_origin_changed(bus), -ECHILD);
bus->anonymous_auth = !!b;
bus->anonymous_auth = b;
return 0;
}
@ -401,7 +401,7 @@ _public_ int sd_bus_set_trusted(sd_bus *bus, int b) {
assert_return(bus->state == BUS_UNSET, -EPERM);
assert_return(!bus_origin_changed(bus), -ECHILD);
bus->trusted = !!b;
bus->trusted = b;
return 0;
}
@ -419,7 +419,7 @@ _public_ int sd_bus_set_allow_interactive_authorization(sd_bus *bus, int b) {
assert_return(bus = bus_resolve(bus), -ENOPKG);
assert_return(!bus_origin_changed(bus), -ECHILD);
bus->allow_interactive_authorization = !!b;
bus->allow_interactive_authorization = b;
return 0;
}
@ -437,7 +437,7 @@ _public_ int sd_bus_set_watch_bind(sd_bus *bus, int b) {
assert_return(bus->state == BUS_UNSET, -EPERM);
assert_return(!bus_origin_changed(bus), -ECHILD);
bus->watch_bind = !!b;
bus->watch_bind = b;
return 0;
}
@ -455,7 +455,7 @@ _public_ int sd_bus_set_connected_signal(sd_bus *bus, int b) {
assert_return(bus->state == BUS_UNSET, -EPERM);
assert_return(!bus_origin_changed(bus), -ECHILD);
bus->connected_signal = !!b;
bus->connected_signal = b;
return 0;
}

View file

@ -5038,7 +5038,7 @@ _public_ int sd_event_set_watchdog(sd_event *e, int b) {
}
}
e->watchdog = !!b;
e->watchdog = b;
return e->watchdog;
fail: