clang-format: re-format for clang-18
clang-format-18 isn't compatible with the clang-format-17 output, so we
need to reformat the code with the latest version. The way clang-18
handles lambda formatting also changed, so we have made changes to the
organization default style format to better handle lambda formatting.
See I5e08687e696dd240402a2780158664b7113def0e for updated style.
See Iea0776aaa7edd483fa395e23de25ebf5a6288f71 for clang-18 enablement.
Change-Id: Ica590f8613f1fb89ab1ca676ac51c1cc7e38d67f
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
diff --git a/control/preconditions.cpp b/control/preconditions.cpp
index 6365d41..13f51db 100644
--- a/control/preconditions.cpp
+++ b/control/preconditions.cpp
@@ -23,21 +23,22 @@
{
return [pg = std::move(pg), sse = std::move(sse)](auto& zone, auto& group) {
// Compare given precondition entries
- auto precondState = std::all_of(pg.begin(), pg.end(),
- [&zone](auto const& entry) {
- try
- {
- return zone.getPropValueVariant(std::get<pcPathPos>(entry),
- std::get<pcIntfPos>(entry),
- std::get<pcPropPos>(entry)) ==
- std::get<pcValuePos>(entry);
- }
- catch (const std::out_of_range& oore)
- {
- // Default to property variants not equal when not found
- return false;
- }
- });
+ auto precondState =
+ std::all_of(pg.begin(), pg.end(), [&zone](const auto& entry) {
+ try
+ {
+ return zone.getPropValueVariant(
+ std::get<pcPathPos>(entry),
+ std::get<pcIntfPos>(entry),
+ std::get<pcPropPos>(entry)) ==
+ std::get<pcValuePos>(entry);
+ }
+ catch (const std::out_of_range& oore)
+ {
+ // Default to property variants not equal when not found
+ return false;
+ }
+ });
if (precondState)
{
@@ -45,7 +46,7 @@
"Preconditions passed, init the associated events",
entry("EVENT_COUNT=%u", sse.size()));
// Init the events when all the precondition(s) are true
- std::for_each(sse.begin(), sse.end(), [&zone](auto const& entry) {
+ std::for_each(sse.begin(), sse.end(), [&zone](const auto& entry) {
zone.initEvent(entry);
});
}
@@ -55,7 +56,7 @@
"Preconditions not met for events, events removed if present",
entry("EVENT_COUNT=%u", sse.size()));
// Unsubscribe the events' signals when any precondition is false
- std::for_each(sse.begin(), sse.end(), [&zone](auto const& entry) {
+ std::for_each(sse.begin(), sse.end(), [&zone](const auto& entry) {
zone.removeEvent(entry);
});
zone.setFullSpeed();
@@ -71,21 +72,22 @@
// Set/update the services of the group
zone.setServices(&group);
const auto& services = zone.getGroupServices(&group);
- auto precondState = std::any_of(
- services.begin(), services.end(),
- [](const auto& s) { return !std::get<hasOwnerPos>(s); });
+ auto precondState =
+ std::any_of(services.begin(), services.end(), [](const auto& s) {
+ return !std::get<hasOwnerPos>(s);
+ });
if (precondState)
{
// Init the events when all the precondition(s) are true
- std::for_each(sse.begin(), sse.end(), [&zone](auto const& entry) {
+ std::for_each(sse.begin(), sse.end(), [&zone](const auto& entry) {
zone.initEvent(entry);
});
}
else
{
// Unsubscribe the events' signals when any precondition is false
- std::for_each(sse.begin(), sse.end(), [&zone](auto const& entry) {
+ std::for_each(sse.begin(), sse.end(), [&zone](const auto& entry) {
zone.removeEvent(entry);
});
}