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: I09e19a126d456dc184fd70e82d4e4e4217fa8ee7
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
diff --git a/bmc/version-handler/test/version_mock.hpp b/bmc/version-handler/test/version_mock.hpp
index d8035a5..71fabaf 100644
--- a/bmc/version-handler/test/version_mock.hpp
+++ b/bmc/version-handler/test/version_mock.hpp
@@ -9,10 +9,9 @@
namespace ipmi_flash
{
-static HandlerConfig<VersionBlobHandler::ActionPack>
- createMockVersionConfig(const std::string& id,
- ImageHandlerMock** im = nullptr,
- TriggerMock** tm = nullptr)
+static HandlerConfig<VersionBlobHandler::ActionPack> createMockVersionConfig(
+ const std::string& id, ImageHandlerMock** im = nullptr,
+ TriggerMock** tm = nullptr)
{
HandlerConfig<VersionBlobHandler::ActionPack> ret;
ret.blobId = id;
diff --git a/bmc/version-handler/version_handler.cpp b/bmc/version-handler/version_handler.cpp
index f26884b..5b285f8 100644
--- a/bmc/version-handler/version_handler.cpp
+++ b/bmc/version-handler/version_handler.cpp
@@ -23,38 +23,39 @@
info->handler = std::move(config.handler);
info->actions->onOpen->setCallback(
[infoP = info.get()](TriggerableActionInterface& tai) {
- auto data = std::make_shared<std::optional<std::vector<uint8_t>>>();
- do
- {
- if (tai.status() != ActionStatus::success)
+ auto data =
+ std::make_shared<std::optional<std::vector<uint8_t>>>();
+ do
{
- fprintf(stderr, "Version file unit failed for %s\n",
- infoP->blobId.c_str());
- continue;
- }
- if (!infoP->handler->open("", std::ios::in))
+ if (tai.status() != ActionStatus::success)
+ {
+ fprintf(stderr, "Version file unit failed for %s\n",
+ infoP->blobId.c_str());
+ continue;
+ }
+ if (!infoP->handler->open("", std::ios::in))
+ {
+ fprintf(stderr, "Opening version file failed for %s\n",
+ infoP->blobId.c_str());
+ continue;
+ }
+ auto d = infoP->handler->read(
+ 0, std::numeric_limits<uint32_t>::max());
+ infoP->handler->close();
+ if (!d)
+ {
+ fprintf(stderr, "Reading version file failed for %s\n",
+ infoP->blobId.c_str());
+ continue;
+ }
+ *data = std::move(d);
+ } while (false);
+ for (auto sessionP : infoP->sessionsToUpdate)
{
- fprintf(stderr, "Opening version file failed for %s\n",
- infoP->blobId.c_str());
- continue;
+ sessionP->data = data;
}
- auto d = infoP->handler->read(
- 0, std::numeric_limits<uint32_t>::max());
- infoP->handler->close();
- if (!d)
- {
- fprintf(stderr, "Reading version file failed for %s\n",
- infoP->blobId.c_str());
- continue;
- }
- *data = std::move(d);
- } while (false);
- for (auto sessionP : infoP->sessionsToUpdate)
- {
- sessionP->data = data;
- }
- infoP->sessionsToUpdate.clear();
- });
+ infoP->sessionsToUpdate.clear();
+ });
if (!blobInfoMap.try_emplace(info->blobId, std::move(info)).second)
{
fprintf(stderr, "Ignoring duplicate config for %s\n",
diff --git a/bmc/version-handler/version_handlers_builder.cpp b/bmc/version-handler/version_handlers_builder.cpp
index 044f4e3..d0b7360 100644
--- a/bmc/version-handler/version_handlers_builder.cpp
+++ b/bmc/version-handler/version_handlers_builder.cpp
@@ -75,8 +75,8 @@
}
else
{
- throw std::runtime_error("Invalid handler type: " +
- handlerType);
+ throw std::runtime_error(
+ "Invalid handler type: " + handlerType);
}
/* actions are required (presently). */
@@ -96,8 +96,8 @@
}
else
{
- throw std::runtime_error("Invalid preparation type: " +
- onOpenType);
+ throw std::runtime_error(
+ "Invalid preparation type: " + onOpenType);
}
output.actions = std::move(pack);