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: I07372e75f12f406bd0555dd27e249bc7dd0958d4
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
diff --git a/src/getConfig.cpp b/src/getConfig.cpp
index 563a057..3d2cc5a 100644
--- a/src/getConfig.cpp
+++ b/src/getConfig.cpp
@@ -28,44 +28,43 @@
std::pair<std::string,
std::vector<std::pair<std::string, std::vector<std::string>>>>>;
-void GetStorageConfiguration::getStorageInfo(const std::string& path,
- const std::string& owner,
- size_t retries)
+void GetStorageConfiguration::getStorageInfo(
+ const std::string& path, const std::string& owner, size_t retries)
{
std::shared_ptr<GetStorageConfiguration> self = shared_from_this();
self->dbusConnection->async_method_call(
[self, path, owner, retries](
const boost::system::error_code ec,
boost::container::flat_map<std::string, BasicVariantType>& data) {
- if (ec)
- {
- lg2::error(
- "Error getting properties for {PATH}: {RETRIES} retries left",
- "PATH", path, "RETRIES", retries - 1, "REDFISH_MESSAGE_ID",
- std::string("OpenBMC.0.1.GetStorageInfoFail"));
- if (retries == 0U)
+ if (ec)
{
+ lg2::error(
+ "Error getting properties for {PATH}: {RETRIES} retries left",
+ "PATH", path, "RETRIES", retries - 1, "REDFISH_MESSAGE_ID",
+ std::string("OpenBMC.0.1.GetStorageInfoFail"));
+ if (retries == 0U)
+ {
+ return;
+ }
+
+ auto timer = std::make_shared<boost::asio::steady_timer>(
+ self->dbusConnection->get_io_context());
+ timer->expires_after(std::chrono::seconds(10));
+ timer->async_wait([self, timer, path, owner,
+ retries](boost::system::error_code ec) {
+ if (ec)
+ {
+ lg2::error("Timer error!");
+ return;
+ }
+ self->getStorageInfo(path, owner, retries - 1);
+ });
+
return;
}
- auto timer = std::make_shared<boost::asio::steady_timer>(
- self->dbusConnection->get_io_context());
- timer->expires_after(std::chrono::seconds(10));
- timer->async_wait([self, timer, path, owner,
- retries](boost::system::error_code ec) {
- if (ec)
- {
- lg2::error("Timer error!");
- return;
- }
- self->getStorageInfo(path, owner, retries - 1);
- });
-
- return;
- }
-
- self->respData[path] = std::move(data);
- },
+ self->respData[path] = std::move(data);
+ },
owner, path, "org.freedesktop.DBus.Properties", "GetAll",
emmcConfigInterface);
}
@@ -75,29 +74,29 @@
std::shared_ptr<GetStorageConfiguration> self = shared_from_this();
dbusConnection->async_method_call(
[self](const boost::system::error_code ec, const GetSubTreeType& ret) {
- if (ec)
- {
- lg2::error("Error calling mapper");
- return;
- }
- for (const auto& [objPath, objDict] : ret)
- {
- if (objDict.empty())
+ if (ec)
{
+ lg2::error("Error calling mapper");
return;
}
- const std::string& objOwner = objDict.begin()->first;
- /* Look for the config interface exposed by this object. */
- for (const std::string& interface : objDict.begin()->second)
+ for (const auto& [objPath, objDict] : ret)
{
- if (interface.compare(emmcConfigInterface) == 0)
+ if (objDict.empty())
{
- /* Get the properties exposed by this interface. */
- self->getStorageInfo(objPath, objOwner);
+ return;
+ }
+ const std::string& objOwner = objDict.begin()->first;
+ /* Look for the config interface exposed by this object. */
+ for (const std::string& interface : objDict.begin()->second)
+ {
+ if (interface.compare(emmcConfigInterface) == 0)
+ {
+ /* Get the properties exposed by this interface. */
+ self->getStorageInfo(objPath, objOwner);
+ }
}
}
- }
- },
+ },
mapper::busName, mapper::path, mapper::interface, mapper::subtree, "/",
0, std::vector<const char*>(1, emmcConfigInterface));
}