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/log-handler/log_handler.cpp b/bmc/log-handler/log_handler.cpp
index 9a0d296..de91ae4 100644
--- a/bmc/log-handler/log_handler.cpp
+++ b/bmc/log-handler/log_handler.cpp
@@ -36,41 +36,44 @@
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,
- "LogBlobHandler: Log file unit failed for %s\n",
- infoP->blobId.c_str());
- continue;
- }
- if (!infoP->handler->open("", std::ios::in))
- {
- fprintf(stderr,
+ if (tai.status() != ActionStatus::success)
+ {
+ fprintf(stderr,
+ "LogBlobHandler: Log file unit failed for %s\n",
+ infoP->blobId.c_str());
+ continue;
+ }
+ if (!infoP->handler->open("", std::ios::in))
+ {
+ fprintf(
+ stderr,
"LogBlobHandler: Opening log 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,
+ continue;
+ }
+ auto d = infoP->handler->read(
+ 0, std::numeric_limits<uint32_t>::max());
+ infoP->handler->close();
+ if (!d)
+ {
+ fprintf(
+ stderr,
"LogBlobHandler: Reading log file failed for %s\n",
infoP->blobId.c_str());
- continue;
+ continue;
+ }
+ *data = std::move(d);
+ } while (false);
+ for (auto sessionP : infoP->sessionsToUpdate)
+ {
+ sessionP->data = data;
}
- *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,