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: I917f3a65c985f3df3bb4d7a1bef0a13da54ab7bd
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
diff --git a/ibm_vpd_utils.cpp b/ibm_vpd_utils.cpp
index de38c6e..d015d86 100644
--- a/ibm_vpd_utils.cpp
+++ b/ibm_vpd_utils.cpp
@@ -717,16 +717,16 @@
std::string hexString;
std::visit(
[&hexString](auto&& kw) {
- std::stringstream ss;
- std::string hexRep = "0x";
- ss << hexRep;
- for (auto& kwVal : kw)
- {
- ss << std::setfill('0') << std::setw(2) << std::hex
- << static_cast<int>(kwVal);
- }
- hexString = ss.str();
- },
+ std::stringstream ss;
+ std::string hexRep = "0x";
+ ss << hexRep;
+ for (auto& kwVal : kw)
+ {
+ ss << std::setfill('0') << std::setw(2) << std::hex
+ << static_cast<int>(kwVal);
+ }
+ hexString = ss.str();
+ },
kw);
return hexString;
}
@@ -736,18 +736,18 @@
std::string kwString{};
std::visit(
[&kwString](auto&& kwVal) {
- const auto it =
- std::find_if(kwVal.begin(), kwVal.end(),
- [](const auto& kw) { return !isprint(kw); });
- if (it != kwVal.end())
- {
- kwString = hexString(kwVal);
- }
- else
- {
- kwString = std::string(kwVal.begin(), kwVal.end());
- }
- },
+ const auto it =
+ std::find_if(kwVal.begin(), kwVal.end(),
+ [](const auto& kw) { return !isprint(kw); });
+ if (it != kwVal.end())
+ {
+ kwString = hexString(kwVal);
+ }
+ else
+ {
+ kwString = std::string(kwVal.begin(), kwVal.end());
+ }
+ },
kwVal);
return kwString;
}
@@ -1007,10 +1007,10 @@
// TODO: How do we handle multiple chassis?
std::string powerState{};
auto bus = sdbusplus::bus::new_default();
- auto properties = bus.new_method_call("xyz.openbmc_project.State.Chassis0",
- "/xyz/openbmc_project/state/chassis0",
- "org.freedesktop.DBus.Properties",
- "Get");
+ auto properties =
+ bus.new_method_call("xyz.openbmc_project.State.Chassis0",
+ "/xyz/openbmc_project/state/chassis0",
+ "org.freedesktop.DBus.Properties", "Get");
properties.append("xyz.openbmc_project.State.Chassis");
properties.append("CurrentPowerState");
auto result = bus.call(properties);