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: Ica590f8613f1fb89ab1ca676ac51c1cc7e38d67f
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
diff --git a/monitor/json_parser.cpp b/monitor/json_parser.cpp
index 20a3bcb..5faccb4 100644
--- a/monitor/json_parser.cpp
+++ b/monitor/json_parser.cpp
@@ -176,14 +176,15 @@
ignoreAboveMax = sensor["ignore_above_max"].get<bool>();
}
- SensorDefinition def{.name = sensor["name"].get<std::string>(),
- .hasTarget = sensor["has_target"].get<bool>(),
- .targetInterface = targetIntf,
- .targetPath = targetPath,
- .factor = factor,
- .offset = offset,
- .threshold = threshold,
- .ignoreAboveMax = ignoreAboveMax};
+ SensorDefinition def{
+ .name = sensor["name"].get<std::string>(),
+ .hasTarget = sensor["has_target"].get<bool>(),
+ .targetInterface = targetIntf,
+ .targetPath = targetPath,
+ .factor = factor,
+ .offset = offset,
+ .threshold = threshold,
+ .ignoreAboveMax = ignoreAboveMax};
sensorDefs.push_back(std::move(def));
}
@@ -373,20 +374,21 @@
setFuncOnPresent = fan["set_func_on_present"].get<bool>();
}
- FanDefinition def{.name = fan["inventory"].get<std::string>(),
- .method = method,
- .funcDelay = funcDelay,
- .timeout = timeout,
- .deviation = deviation,
- .upperDeviation = upperDeviation,
- .numSensorFailsForNonfunc = nonfuncSensorsCount,
- .monitorStartDelay = monitorDelay,
- .countInterval = countInterval,
- .nonfuncRotorErrDelay = nonfuncRotorErrorDelay,
- .fanMissingErrDelay = fanMissingErrorDelay,
- .sensorList = std::move(sensorDefs),
- .condition = cond,
- .funcOnPresent = setFuncOnPresent};
+ FanDefinition def{
+ .name = fan["inventory"].get<std::string>(),
+ .method = method,
+ .funcDelay = funcDelay,
+ .timeout = timeout,
+ .deviation = deviation,
+ .upperDeviation = upperDeviation,
+ .numSensorFailsForNonfunc = nonfuncSensorsCount,
+ .monitorStartDelay = monitorDelay,
+ .countInterval = countInterval,
+ .nonfuncRotorErrDelay = nonfuncRotorErrorDelay,
+ .fanMissingErrDelay = fanMissingErrorDelay,
+ .sensorList = std::move(sensorDefs),
+ .condition = cond,
+ .funcOnPresent = setFuncOnPresent};
fanDefs.push_back(std::move(def));
}
@@ -438,11 +440,11 @@
[count]() { return std::make_unique<MissingFanFRUCause>(count); }},
{"nonfunc_fan_rotors",
[count]() {
- return std::make_unique<NonfuncFanRotorCause>(count);
- }},
+ return std::make_unique<NonfuncFanRotorCause>(count);
+ }},
{"fan_frus_with_nonfunc_rotors", [count]() {
- return std::make_unique<FanFRUsWithNonfuncRotorsCause>(count);
- }}};
+ return std::make_unique<FanFRUsWithNonfuncRotorsCause>(count);
+ }}};
auto it = causes.find(powerOffCause);
if (it != causes.end())
@@ -512,8 +514,8 @@
}
else
{
- auto msg = std::format("Invalid 'type' entry {} in power off config",
- type);
+ auto msg =
+ std::format("Invalid 'type' entry {} in power off config", type);
log<level::ERR>(msg.c_str());
throw std::runtime_error(msg.c_str());
}
@@ -521,10 +523,9 @@
return action;
}
-std::vector<std::unique_ptr<PowerOffRule>>
- getPowerOffRules(const json& obj,
- std::shared_ptr<PowerInterfaceBase>& powerInterface,
- PowerOffAction::PrePowerOffFunc& func)
+std::vector<std::unique_ptr<PowerOffRule>> getPowerOffRules(
+ const json& obj, std::shared_ptr<PowerInterfaceBase>& powerInterface,
+ PowerOffAction::PrePowerOffFunc& func)
{
std::vector<std::unique_ptr<PowerOffRule>> rules;