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/functor.hpp b/control/functor.hpp
index 14d27d2..fd6fe6a 100644
--- a/control/functor.hpp
+++ b/control/functor.hpp
@@ -93,8 +93,8 @@
{}
Properties(const char* path, const char* intf, const char* prop,
U&& handler) :
- _path(path),
- _intf(intf), _prop(prop), _handler(std::forward<U>(handler))
+ _path(path), _intf(intf), _prop(prop),
+ _handler(std::forward<U>(handler))
{}
/** @brief Run signal handler function
@@ -125,8 +125,8 @@
}
// Retrieve the property's value applying any visitors necessary
- auto value = zone.getPropertyValueVisitor<T>(_intf, _prop,
- it->second);
+ auto value =
+ zone.getPropertyValueVisitor<T>(_intf, _prop, it->second);
_handler(zone, _path, _intf, _prop, std::forward<T>(value));
}
@@ -160,23 +160,23 @@
std::for_each(
group.begin(), group.end(),
[&zone, handler = std::move(_handler)](const auto& member) {
- auto path = std::get<pathPos>(member);
- auto intf = std::get<intfPos>(member);
- auto prop = std::get<propPos>(member);
- try
- {
- auto val = zone.getPropertyByName<T>(path, intf, prop);
- handler(zone, path, intf, prop, std::forward<T>(val));
- }
- catch (const sdbusplus::exception_t&)
- {
- // Property value not sent to handler
- }
- catch (const util::DBusError&)
- {
- // Property value not sent to handler
- }
- });
+ auto path = std::get<pathPos>(member);
+ auto intf = std::get<intfPos>(member);
+ auto prop = std::get<propPos>(member);
+ try
+ {
+ auto val = zone.getPropertyByName<T>(path, intf, prop);
+ handler(zone, path, intf, prop, std::forward<T>(val));
+ }
+ catch (const sdbusplus::exception_t&)
+ {
+ // Property value not sent to handler
+ }
+ catch (const util::DBusError&)
+ {
+ // Property value not sent to handler
+ }
+ });
}
private:
@@ -236,8 +236,8 @@
InterfacesAdded& operator=(InterfacesAdded&&) = default;
InterfacesAdded(const char* path, const char* intf, const char* prop,
U&& handler) :
- _path(path),
- _intf(intf), _prop(prop), _handler(std::forward<U>(handler))
+ _path(path), _intf(intf), _prop(prop),
+ _handler(std::forward<U>(handler))
{}
/** @brief Run signal handler function
@@ -276,8 +276,8 @@
}
// Retrieve the property's value applying any visitors necessary
- auto value = zone.getPropertyValueVisitor<T>(_intf, _prop,
- itProp->second);
+ auto value =
+ zone.getPropertyValueVisitor<T>(_intf, _prop, itProp->second);
_handler(zone, _path, _intf, _prop, std::forward<T>(value));
}
@@ -430,32 +430,33 @@
{
std::string name = "";
bool hasOwner = false;
- std::for_each(group.begin(), group.end(),
- [&zone, &group, &name, &hasOwner,
- handler = std::move(_handler)](const auto& member) {
- auto path = std::get<pathPos>(member);
- auto intf = std::get<intfPos>(member);
- try
- {
- auto servName = zone.getService(path, intf);
- if (name != servName)
+ std::for_each(
+ group.begin(), group.end(),
+ [&zone, &group, &name, &hasOwner,
+ handler = std::move(_handler)](const auto& member) {
+ auto path = std::get<pathPos>(member);
+ auto intf = std::get<intfPos>(member);
+ try
{
- name = servName;
- hasOwner = util::SDBusPlus::callMethodAndRead<bool>(
- zone.getBus(), "org.freedesktop.DBus",
- "/org/freedesktop/DBus", "org.freedesktop.DBus",
- "NameHasOwner", name);
- // Update service name owner state list of a group
- handler(zone, name, hasOwner);
+ auto servName = zone.getService(path, intf);
+ if (name != servName)
+ {
+ name = servName;
+ hasOwner = util::SDBusPlus::callMethodAndRead<bool>(
+ zone.getBus(), "org.freedesktop.DBus",
+ "/org/freedesktop/DBus", "org.freedesktop.DBus",
+ "NameHasOwner", name);
+ // Update service name owner state list of a group
+ handler(zone, name, hasOwner);
+ }
}
- }
- catch (const util::DBusMethodError& e)
- {
- // Failed to get service name owner state
- name = "";
- hasOwner = false;
- }
- });
+ catch (const util::DBusMethodError& e)
+ {
+ // Failed to get service name owner state
+ name = "";
+ hasOwner = false;
+ }
+ });
}
private: