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: I0f105c3310e87172c65a09a8787a2db5a4041cc0
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
diff --git a/dbus/dbuspassiveredundancy.cpp b/dbus/dbuspassiveredundancy.cpp
index 640e587..fa8ce58 100644
--- a/dbus/dbuspassiveredundancy.cpp
+++ b/dbus/dbuspassiveredundancy.cpp
@@ -50,56 +50,57 @@
"type='signal',member='PropertiesChanged',arg0namespace='" +
std::string(redundancy::interface) + "'",
std::move([this](sdbusplus::message_t& message) {
- std::string objectName;
- std::unordered_map<std::string,
- std::variant<std::string, std::vector<std::string>>>
- result;
- try
- {
- message.read(objectName, result);
- }
- catch (const sdbusplus::exception_t&)
- {
- std::cerr << "Error reading match data";
- return;
- }
- auto findStatus = result.find("Status");
- if (findStatus == result.end())
- {
- return;
- }
- std::string status = std::get<std::string>(findStatus->second);
+ std::string objectName;
+ std::unordered_map<
+ std::string,
+ std::variant<std::string, std::vector<std::string>>>
+ result;
+ try
+ {
+ message.read(objectName, result);
+ }
+ catch (const sdbusplus::exception_t&)
+ {
+ std::cerr << "Error reading match data";
+ return;
+ }
+ auto findStatus = result.find("Status");
+ if (findStatus == result.end())
+ {
+ return;
+ }
+ std::string status = std::get<std::string>(findStatus->second);
- auto methodCall =
- passiveBus.new_method_call(message.get_sender(), message.get_path(),
- properties::interface, properties::get);
- methodCall.append(redundancy::interface, redundancy::collection);
- std::variant<std::vector<std::string>> collection;
+ auto methodCall = passiveBus.new_method_call(
+ message.get_sender(), message.get_path(),
+ properties::interface, properties::get);
+ methodCall.append(redundancy::interface, redundancy::collection);
+ std::variant<std::vector<std::string>> collection;
- try
- {
- auto reply = passiveBus.call(methodCall);
- reply.read(collection);
- }
- catch (const sdbusplus::exception_t&)
- {
- std::cerr << "Error reading match data";
- return;
- }
+ try
+ {
+ auto reply = passiveBus.call(methodCall);
+ reply.read(collection);
+ }
+ catch (const sdbusplus::exception_t&)
+ {
+ std::cerr << "Error reading match data";
+ return;
+ }
- auto data = std::get<std::vector<std::string>>(collection);
- if (status.rfind("Failed") != std::string::npos)
- {
- failed.insert(data.begin(), data.end());
- }
- else
- {
- for (const auto& d : data)
- {
- failed.erase(d);
- }
- }
-})),
+ auto data = std::get<std::vector<std::string>>(collection);
+ if (status.rfind("Failed") != std::string::npos)
+ {
+ failed.insert(data.begin(), data.end());
+ }
+ else
+ {
+ for (const auto& d : data)
+ {
+ failed.erase(d);
+ }
+ }
+ })),
passiveBus(bus)
{
populateFailures();
@@ -141,9 +142,9 @@
{
for (const auto& [owner, _] : interfaceDict)
{
- auto call = passiveBus.new_method_call(owner.c_str(), path.c_str(),
- properties::interface,
- properties::getAll);
+ auto call = passiveBus.new_method_call(
+ owner.c_str(), path.c_str(), properties::interface,
+ properties::getAll);
call.append(redundancy::interface);
std::unordered_map<