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: Iceec1dc95b6c908ec6c21fb40093de9dd18bf11a
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
diff --git a/redfish-core/lib/thermal.hpp b/redfish-core/lib/thermal.hpp
index 84bf37a..7a5586f 100644
--- a/redfish-core/lib/thermal.hpp
+++ b/redfish-core/lib/thermal.hpp
@@ -32,18 +32,18 @@
[&app](const crow::Request& req,
const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
const std::string& chassisName) {
- if (!redfish::setUpRedfishRoute(app, req, asyncResp))
- {
- return;
- }
+ if (!redfish::setUpRedfishRoute(app, req, asyncResp))
+ {
+ return;
+ }
- auto sensorAsyncResp = std::make_shared<SensorsAsyncResp>(
- asyncResp, chassisName, sensors::dbus::thermalPaths,
- sensors::node::thermal);
+ auto sensorAsyncResp = std::make_shared<SensorsAsyncResp>(
+ asyncResp, chassisName, sensors::dbus::thermalPaths,
+ sensors::node::thermal);
- // TODO Need to get Chassis Redundancy information.
- getChassisData(sensorAsyncResp);
- });
+ // TODO Need to get Chassis Redundancy information.
+ getChassisData(sensorAsyncResp);
+ });
BMCWEB_ROUTE(app, "/redfish/v1/Chassis/<str>/Thermal/")
.privileges(redfish::privileges::patchThermal)
@@ -51,44 +51,47 @@
[&app](const crow::Request& req,
const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
const std::string& chassisName) {
- if (!redfish::setUpRedfishRoute(app, req, asyncResp))
- {
- return;
- }
+ if (!redfish::setUpRedfishRoute(app, req, asyncResp))
+ {
+ return;
+ }
- std::optional<std::vector<nlohmann::json::object_t>>
- temperatureCollections;
- std::optional<std::vector<nlohmann::json::object_t>> fanCollections;
- std::unordered_map<std::string, std::vector<nlohmann::json::object_t>>
- allCollections;
+ std::optional<std::vector<nlohmann::json::object_t>>
+ temperatureCollections;
+ std::optional<std::vector<nlohmann::json::object_t>>
+ fanCollections;
+ std::unordered_map<std::string,
+ std::vector<nlohmann::json::object_t>>
+ allCollections;
- auto sensorsAsyncResp = std::make_shared<SensorsAsyncResp>(
- asyncResp, chassisName, sensors::dbus::thermalPaths,
- sensors::node::thermal);
+ auto sensorsAsyncResp = std::make_shared<SensorsAsyncResp>(
+ asyncResp, chassisName, sensors::dbus::thermalPaths,
+ sensors::node::thermal);
- if (!json_util::readJsonPatch(req, sensorsAsyncResp->asyncResp->res,
- "Temperatures", temperatureCollections,
- "Fans", fanCollections))
- {
- return;
- }
- if (!temperatureCollections && !fanCollections)
- {
- messages::resourceNotFound(sensorsAsyncResp->asyncResp->res,
- "Thermal", "Temperatures / Voltages");
- return;
- }
- if (temperatureCollections)
- {
- allCollections.emplace("Temperatures",
- *std::move(temperatureCollections));
- }
- if (fanCollections)
- {
- allCollections.emplace("Fans", *std::move(fanCollections));
- }
- setSensorsOverride(sensorsAsyncResp, allCollections);
- });
+ if (!json_util::readJsonPatch(
+ req, sensorsAsyncResp->asyncResp->res, "Temperatures",
+ temperatureCollections, "Fans", fanCollections))
+ {
+ return;
+ }
+ if (!temperatureCollections && !fanCollections)
+ {
+ messages::resourceNotFound(sensorsAsyncResp->asyncResp->res,
+ "Thermal",
+ "Temperatures / Voltages");
+ return;
+ }
+ if (temperatureCollections)
+ {
+ allCollections.emplace("Temperatures",
+ *std::move(temperatureCollections));
+ }
+ if (fanCollections)
+ {
+ allCollections.emplace("Fans", *std::move(fanCollections));
+ }
+ setSensorsOverride(sensorsAsyncResp, allCollections);
+ });
}
} // namespace redfish