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: I0f105c3310e87172c65a09a8787a2db5a4041cc0
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
diff --git a/dbus/dbusactiveread.hpp b/dbus/dbusactiveread.hpp
index 46532a6..2edb3cc 100644
--- a/dbus/dbusactiveread.hpp
+++ b/dbus/dbusactiveread.hpp
@@ -22,8 +22,8 @@
DbusActiveRead(sdbusplus::bus_t& bus, const std::string& path,
const std::string& service,
std::unique_ptr<DbusHelperInterface> helper) :
- ReadInterface(),
- _bus(bus), _path(path), _service(service), _helper(std::move(helper))
+ ReadInterface(), _bus(bus), _path(path), _service(service),
+ _helper(std::move(helper))
{}
ReadReturn read(void) override;
diff --git a/dbus/dbusconfiguration.cpp b/dbus/dbusconfiguration.cpp
index 2a06b30..7905e28 100644
--- a/dbus/dbusconfiguration.cpp
+++ b/dbus/dbusconfiguration.cpp
@@ -84,10 +84,10 @@
std::vector<std::string> getSelectedProfiles(sdbusplus::bus_t& bus)
{
std::vector<std::string> ret;
- auto mapper = bus.new_method_call("xyz.openbmc_project.ObjectMapper",
- "/xyz/openbmc_project/object_mapper",
- "xyz.openbmc_project.ObjectMapper",
- "GetSubTree");
+ auto mapper =
+ bus.new_method_call("xyz.openbmc_project.ObjectMapper",
+ "/xyz/openbmc_project/object_mapper",
+ "xyz.openbmc_project.ObjectMapper", "GetSubTree");
mapper.append("/", 0, std::array<const char*, 1>{thermalControlIface});
std::unordered_map<
std::string, std::unordered_map<std::string, std::vector<std::string>>>
@@ -281,8 +281,8 @@
auto findAttributeName = zone.find(attributeName);
if (findAttributeName != zone.end())
{
- double tmpAttributeValue = std::visit(VariantToDoubleVisitor(),
- zone.at(attributeName));
+ double tmpAttributeValue =
+ std::visit(VariantToDoubleVisitor(), zone.at(attributeName));
if (tmpAttributeValue >= 1.0)
{
value = static_cast<uint64_t>(tmpAttributeValue);
@@ -380,10 +380,10 @@
getPIDAttribute(base, "OutLimitMax"));
info.pidInfo.outLim.min = std::visit(VariantToDoubleVisitor(),
getPIDAttribute(base, "OutLimitMin"));
- info.pidInfo.slewNeg = std::visit(VariantToDoubleVisitor(),
- getPIDAttribute(base, "SlewNeg"));
- info.pidInfo.slewPos = std::visit(VariantToDoubleVisitor(),
- getPIDAttribute(base, "SlewPos"));
+ info.pidInfo.slewNeg =
+ std::visit(VariantToDoubleVisitor(), getPIDAttribute(base, "SlewNeg"));
+ info.pidInfo.slewPos =
+ std::visit(VariantToDoubleVisitor(), getPIDAttribute(base, "SlewPos"));
bool checkHysterWithSetpt = false;
double negativeHysteresis = 0;
@@ -401,18 +401,18 @@
}
if (findNeg != base.end())
{
- negativeHysteresis = std::visit(VariantToDoubleVisitor(),
- findNeg->second);
+ negativeHysteresis =
+ std::visit(VariantToDoubleVisitor(), findNeg->second);
}
if (findPos != base.end())
{
- positiveHysteresis = std::visit(VariantToDoubleVisitor(),
- findPos->second);
+ positiveHysteresis =
+ std::visit(VariantToDoubleVisitor(), findPos->second);
}
if (findDerivative != base.end())
{
- derivativeCoeff = std::visit(VariantToDoubleVisitor(),
- findDerivative->second);
+ derivativeCoeff =
+ std::visit(VariantToDoubleVisitor(), findDerivative->second);
}
info.pidInfo.checkHysterWithSetpt = checkHysterWithSetpt;
@@ -432,16 +432,16 @@
createMatches(bus, timer);
- auto mapper = bus.new_method_call("xyz.openbmc_project.ObjectMapper",
- "/xyz/openbmc_project/object_mapper",
- "xyz.openbmc_project.ObjectMapper",
- "GetSubTree");
- mapper.append("/", 0,
- std::array<const char*, 6>{
- objectManagerInterface, pidConfigurationInterface,
- pidZoneConfigurationInterface,
- stepwiseConfigurationInterface, sensorInterface,
- defaultPwmInterface});
+ auto mapper =
+ bus.new_method_call("xyz.openbmc_project.ObjectMapper",
+ "/xyz/openbmc_project/object_mapper",
+ "xyz.openbmc_project.ObjectMapper", "GetSubTree");
+ mapper.append(
+ "/", 0,
+ std::array<const char*, 6>{
+ objectManagerInterface, pidConfigurationInterface,
+ pidZoneConfigurationInterface, stepwiseConfigurationInterface,
+ sensorInterface, defaultPwmInterface});
std::unordered_map<
std::string, std::unordered_map<std::string, std::vector<std::string>>>
respData;
@@ -516,8 +516,8 @@
catch (const sdbusplus::exception_t&)
{
// this shouldn't happen, probably means daemon crashed
- throw std::runtime_error("Error getting managed objects from " +
- owner.first);
+ throw std::runtime_error(
+ "Error getting managed objects from " + owner.first);
}
for (auto& pathPair : configuration)
@@ -562,8 +562,8 @@
for (const std::string& profile : profiles)
{
if (std::find(selectedProfiles.begin(),
- selectedProfiles.end(),
- profile) != selectedProfiles.end())
+ selectedProfiles.end(), profile) !=
+ selectedProfiles.end())
{
found = true;
break;
@@ -908,11 +908,11 @@
offsetType =
std::get<std::string>(findSetpointOffset->second);
if (std::find(thresholds::types.begin(),
- thresholds::types.end(),
- offsetType) == thresholds::types.end())
+ thresholds::types.end(), offsetType) ==
+ thresholds::types.end())
{
- throw std::runtime_error("Unsupported type: " +
- offsetType);
+ throw std::runtime_error(
+ "Unsupported type: " + offsetType);
}
}
diff --git a/dbus/dbushelper.cpp b/dbus/dbushelper.cpp
index 038e784..6c1e1c0 100644
--- a/dbus/dbushelper.cpp
+++ b/dbus/dbushelper.cpp
@@ -43,10 +43,10 @@
std::string DbusHelper::getService(const std::string& intf,
const std::string& path)
{
- auto mapper = _bus.new_method_call("xyz.openbmc_project.ObjectMapper",
- "/xyz/openbmc_project/object_mapper",
- "xyz.openbmc_project.ObjectMapper",
- "GetObject");
+ auto mapper =
+ _bus.new_method_call("xyz.openbmc_project.ObjectMapper",
+ "/xyz/openbmc_project/object_mapper",
+ "xyz.openbmc_project.ObjectMapper", "GetObject");
mapper.append(path);
mapper.append(std::vector<std::string>({intf}));
diff --git a/dbus/dbuspassive.cpp b/dbus/dbuspassive.cpp
index 0963736..aa4cbaf 100644
--- a/dbus/dbuspassive.cpp
+++ b/dbus/dbuspassive.cpp
@@ -93,9 +93,8 @@
std::unique_ptr<DbusHelperInterface> helper,
const SensorProperties& settings, bool failed, const std::string& path,
const std::shared_ptr<DbusPassiveRedundancy>& redundancy) :
- ReadInterface(),
- _signal(bus, getMatch(path), dbusHandleSignal, this), _id(id),
- _helper(std::move(helper)), _failed(failed), path(path),
+ ReadInterface(), _signal(bus, getMatch(path), dbusHandleSignal, this),
+ _id(id), _helper(std::move(helper)), _failed(failed), path(path),
redundancy(redundancy)
{
@@ -277,8 +276,8 @@
auto valPropMap = msgData.find("Value");
if (valPropMap != msgData.end())
{
- double value = std::visit(VariantToDoubleVisitor(),
- valPropMap->second);
+ double value =
+ std::visit(VariantToDoubleVisitor(), valPropMap->second);
owner->updateValue(value, false);
}
diff --git a/dbus/dbuspassiveredundancy.cpp b/dbus/dbuspassiveredundancy.cpp
index 640e587..fa8ce58 100644
--- a/dbus/dbuspassiveredundancy.cpp
+++ b/dbus/dbuspassiveredundancy.cpp
@@ -50,56 +50,57 @@
"type='signal',member='PropertiesChanged',arg0namespace='" +
std::string(redundancy::interface) + "'",
std::move([this](sdbusplus::message_t& message) {
- std::string objectName;
- std::unordered_map<std::string,
- std::variant<std::string, std::vector<std::string>>>
- result;
- try
- {
- message.read(objectName, result);
- }
- catch (const sdbusplus::exception_t&)
- {
- std::cerr << "Error reading match data";
- return;
- }
- auto findStatus = result.find("Status");
- if (findStatus == result.end())
- {
- return;
- }
- std::string status = std::get<std::string>(findStatus->second);
+ std::string objectName;
+ std::unordered_map<
+ std::string,
+ std::variant<std::string, std::vector<std::string>>>
+ result;
+ try
+ {
+ message.read(objectName, result);
+ }
+ catch (const sdbusplus::exception_t&)
+ {
+ std::cerr << "Error reading match data";
+ return;
+ }
+ auto findStatus = result.find("Status");
+ if (findStatus == result.end())
+ {
+ return;
+ }
+ std::string status = std::get<std::string>(findStatus->second);
- auto methodCall =
- passiveBus.new_method_call(message.get_sender(), message.get_path(),
- properties::interface, properties::get);
- methodCall.append(redundancy::interface, redundancy::collection);
- std::variant<std::vector<std::string>> collection;
+ auto methodCall = passiveBus.new_method_call(
+ message.get_sender(), message.get_path(),
+ properties::interface, properties::get);
+ methodCall.append(redundancy::interface, redundancy::collection);
+ std::variant<std::vector<std::string>> collection;
- try
- {
- auto reply = passiveBus.call(methodCall);
- reply.read(collection);
- }
- catch (const sdbusplus::exception_t&)
- {
- std::cerr << "Error reading match data";
- return;
- }
+ try
+ {
+ auto reply = passiveBus.call(methodCall);
+ reply.read(collection);
+ }
+ catch (const sdbusplus::exception_t&)
+ {
+ std::cerr << "Error reading match data";
+ return;
+ }
- auto data = std::get<std::vector<std::string>>(collection);
- if (status.rfind("Failed") != std::string::npos)
- {
- failed.insert(data.begin(), data.end());
- }
- else
- {
- for (const auto& d : data)
- {
- failed.erase(d);
- }
- }
-})),
+ auto data = std::get<std::vector<std::string>>(collection);
+ if (status.rfind("Failed") != std::string::npos)
+ {
+ failed.insert(data.begin(), data.end());
+ }
+ else
+ {
+ for (const auto& d : data)
+ {
+ failed.erase(d);
+ }
+ }
+ })),
passiveBus(bus)
{
populateFailures();
@@ -141,9 +142,9 @@
{
for (const auto& [owner, _] : interfaceDict)
{
- auto call = passiveBus.new_method_call(owner.c_str(), path.c_str(),
- properties::interface,
- properties::getAll);
+ auto call = passiveBus.new_method_call(
+ owner.c_str(), path.c_str(), properties::interface,
+ properties::getAll);
call.append(redundancy::interface);
std::unordered_map<
diff --git a/dbus/dbuswrite.cpp b/dbus/dbuswrite.cpp
index 9531546..baae941 100644
--- a/dbus/dbuswrite.cpp
+++ b/dbus/dbuswrite.cpp
@@ -78,9 +78,9 @@
}
}
auto writeBus = sdbusplus::bus::new_default();
- auto mesg = writeBus.new_method_call(connectionName.c_str(), path.c_str(),
- "org.freedesktop.DBus.Properties",
- "Set");
+ auto mesg =
+ writeBus.new_method_call(connectionName.c_str(), path.c_str(),
+ "org.freedesktop.DBus.Properties", "Set");
mesg.append(pwmInterface, "Target",
std::variant<uint64_t>(static_cast<uint64_t>(ovalue)));
@@ -103,10 +103,9 @@
return;
}
-std::unique_ptr<WriteInterface>
- DbusWrite::createDbusWrite(const std::string& path, int64_t min,
- int64_t max,
- std::unique_ptr<DbusHelperInterface> helper)
+std::unique_ptr<WriteInterface> DbusWrite::createDbusWrite(
+ const std::string& path, int64_t min, int64_t max,
+ std::unique_ptr<DbusHelperInterface> helper)
{
std::string connectionName;
@@ -141,9 +140,9 @@
}
}
auto writeBus = sdbusplus::bus::new_default();
- auto mesg = writeBus.new_method_call(connectionName.c_str(), path.c_str(),
- "org.freedesktop.DBus.Properties",
- "Set");
+ auto mesg =
+ writeBus.new_method_call(connectionName.c_str(), path.c_str(),
+ "org.freedesktop.DBus.Properties", "Set");
mesg.append(pwmInterface, "Target",
std::variant<uint64_t>(static_cast<uint64_t>(value)));
diff --git a/dbus/dbuswrite.hpp b/dbus/dbuswrite.hpp
index 1beac27..9aec84c 100644
--- a/dbus/dbuswrite.hpp
+++ b/dbus/dbuswrite.hpp
@@ -37,8 +37,7 @@
DbusWritePercent(const std::string& path, int64_t min, int64_t max,
const std::string& connectionName) :
- WriteInterface(min, max),
- path(path), connectionName(connectionName)
+ WriteInterface(min, max), path(path), connectionName(connectionName)
{}
void write(double value) override;
@@ -59,8 +58,7 @@
DbusWrite(const std::string& path, int64_t min, int64_t max,
const std::string& connectionName) :
- WriteInterface(min, max),
- path(path), connectionName(connectionName)
+ WriteInterface(min, max), path(path), connectionName(connectionName)
{}
void write(double value) override;