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/json/actions/timer_based_actions.cpp b/control/json/actions/timer_based_actions.cpp
index 02779bd..21dbc29 100644
--- a/control/json/actions/timer_based_actions.cpp
+++ b/control/json/actions/timer_based_actions.cpp
@@ -42,9 +42,10 @@
{
// If any of groups' value == nullopt(i.e. not configured), action is
// driven by the service owned state of the group members
- _byOwner = std::any_of(
- _groups.begin(), _groups.end(),
- [](const auto& group) { return group.getValue() == std::nullopt; });
+ _byOwner =
+ std::any_of(_groups.begin(), _groups.end(), [](const auto& group) {
+ return group.getValue() == std::nullopt;
+ });
setTimerConf(jsonObj);
setActions(jsonObj);
@@ -57,12 +58,13 @@
// If any service providing a group member is not owned, start
// timer and if all members' services are owned, stop timer.
if (std::any_of(_groups.begin(), _groups.end(), [](const auto& group) {
- const auto& members = group.getMembers();
- return std::any_of(members.begin(), members.end(),
- [&group](const auto& member) {
- return !Manager::hasOwner(member, group.getInterface());
- });
- }))
+ const auto& members = group.getMembers();
+ return std::any_of(
+ members.begin(), members.end(),
+ [&group](const auto& member) {
+ return !Manager::hasOwner(member, group.getInterface());
+ });
+ }))
{
startTimer();
}
@@ -77,16 +79,18 @@
// If all group members have a given value and it matches what's
// in the cache, start timer and if any do not match, stop
// timer.
- if (std::all_of(_groups.begin(), _groups.end(),
- [&mgr](const auto& group) {
- const auto& members = group.getMembers();
- return std::all_of(members.begin(), members.end(),
- [&mgr, &group](const auto& member) {
- return group.getValue() ==
- mgr->getProperty(member, group.getInterface(),
- group.getProperty());
- });
- }))
+ if (std::all_of(
+ _groups.begin(), _groups.end(), [&mgr](const auto& group) {
+ const auto& members = group.getMembers();
+ return std::all_of(
+ members.begin(), members.end(),
+ [&mgr, &group](const auto& member) {
+ return group.getValue() ==
+ mgr->getProperty(member,
+ group.getInterface(),
+ group.getProperty());
+ });
+ }))
{
// Timer will be started(and never stopped) when _groups is empty
startTimer();
@@ -143,8 +147,8 @@
// Add zone to _actions
std::for_each(_actions.begin(), _actions.end(),
[&zone](std::unique_ptr<ActionBase>& action) {
- action->addZone(zone);
- });
+ action->addZone(zone);
+ });
}
}