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: I1210c7b95e65a82cc5675ada03441af6727a3930
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
diff --git a/src/cpuinfo_utils.cpp b/src/cpuinfo_utils.cpp
index 82277ab..005bc86 100644
--- a/src/cpuinfo_utils.cpp
+++ b/src/cpuinfo_utils.cpp
@@ -174,14 +174,14 @@
*dbusConn, service, object, interface, propertyName,
[handler, propertyName = std::string(propertyName)](
boost::system::error_code ec, const PropertyType& newValue) {
- if (ec)
- {
- std::cerr << "Failed to read property " << propertyName << ": "
- << ec << "\n";
- return;
- }
- handler(newValue);
- });
+ if (ec)
+ {
+ std::cerr << "Failed to read property " << propertyName << ": "
+ << ec << "\n";
+ return;
+ }
+ handler(newValue);
+ });
using ChangedPropertiesType =
std::vector<std::pair<std::string, InterfaceVariant>>;
@@ -218,13 +218,13 @@
sdbusplus::bus::match::rules::sender(service) +
sdbusplus::bus::match::rules::propertiesChanged(object, interface),
[commonPropHandler](sdbusplus::message_t& reply) {
- ChangedPropertiesType changedProps;
- // ignore first param (interface name), it has to be correct
- reply.read(std::string(), changedProps);
+ ChangedPropertiesType changedProps;
+ // ignore first param (interface name), it has to be correct
+ reply.read(std::string(), changedProps);
- DEBUG_PRINT << "PropertiesChanged handled\n";
- commonPropHandler(changedProps);
- });
+ DEBUG_PRINT << "PropertiesChanged handled\n";
+ commonPropHandler(changedProps);
+ });
// Set up a match for the InterfacesAdded signal from the service's
// ObjectManager. This is useful in the case where the object is not added
@@ -236,28 +236,29 @@
sdbusplus::bus::match::rules::interfacesAdded(),
[object = std::string(object), interface = std::string(interface),
commonPropHandler](sdbusplus::message_t& reply) {
- sdbusplus::message::object_path changedObject;
- reply.read(changedObject);
- if (changedObject != object)
- {
- return;
- }
-
- std::vector<std::pair<std::string, ChangedPropertiesType>>
- changedInterfaces;
- reply.read(changedInterfaces);
-
- for (const auto& [changedInterface, changedProps] : changedInterfaces)
- {
- if (changedInterface != interface)
+ sdbusplus::message::object_path changedObject;
+ reply.read(changedObject);
+ if (changedObject != object)
{
- continue;
+ return;
}
- DEBUG_PRINT << "InterfacesAdded handled\n";
- commonPropHandler(changedProps);
- }
- });
+ std::vector<std::pair<std::string, ChangedPropertiesType>>
+ changedInterfaces;
+ reply.read(changedInterfaces);
+
+ for (const auto& [changedInterface, changedProps] :
+ changedInterfaces)
+ {
+ if (changedInterface != interface)
+ {
+ continue;
+ }
+
+ DEBUG_PRINT << "InterfacesAdded handled\n";
+ commonPropHandler(changedProps);
+ }
+ });
if (propertiesChangedMatch != nullptr)
{