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: I8c84201cb2343a8c8a5507a49de0721a1bee7063
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
diff --git a/libpldmresponder/bios_config.cpp b/libpldmresponder/bios_config.cpp
index 712555d..f58e7de 100644
--- a/libpldmresponder/bios_config.cpp
+++ b/libpldmresponder/bios_config.cpp
@@ -45,8 +45,7 @@
pldm::requester::Handler<pldm::requester::Request>* handler,
pldm::responder::platform_config::Handler* platformConfigHandler,
pldm::responder::bios::Callback requestPLDMServiceName) :
- jsonDir(jsonDir),
- tableDir(tableDir), dbusHandler(dbusHandler), eid(eid),
+ jsonDir(jsonDir), tableDir(tableDir), dbusHandler(dbusHandler), eid(eid),
instanceIdDb(instanceIdDb), handler(handler),
platformConfigHandler(platformConfigHandler),
requestPLDMServiceName(requestPLDMServiceName)
@@ -350,8 +349,8 @@
valueDisplayNames.insert(valueDisplayNames.end(),
vdn.begin(), vdn.end());
}
- auto getValue = [](uint16_t handle,
- const Table& table) -> std::string {
+ auto getValue =
+ [](uint16_t handle, const Table& table) -> std::string {
auto stringEntry = pldm_bios_table_string_find_by_handle(
table.data(), table.size(), handle);
@@ -414,8 +413,8 @@
// get default_value
for (size_t i = 0; i < defIndices.size(); i++)
{
- defaultValue = getValue(pvHandls[defIndices[i]],
- *stringTable);
+ defaultValue =
+ getValue(pvHandls[defIndices[i]], *stringTable);
}
break;
@@ -518,8 +517,8 @@
try
{
auto& bus = dbusHandler->getBus();
- auto service = dbusHandler->getService(biosConfigPath,
- biosConfigInterface);
+ auto service =
+ dbusHandler->getService(biosConfigPath, biosConfigInterface);
auto method = bus.new_method_call(service.c_str(), biosConfigPath,
dbusProperties, "Set");
std::variant<BaseBIOSTable> value = baseBIOSTableMaps;
@@ -571,9 +570,9 @@
{
auto& bus = dbusHandler->getBus();
auto service = dbusHandler->getService(biosObjPath, biosInterface);
- auto method = bus.new_method_call(service.c_str(), biosObjPath,
- "org.freedesktop.DBus.Properties",
- "Get");
+ auto method =
+ bus.new_method_call(service.c_str(), biosObjPath,
+ "org.freedesktop.DBus.Properties", "Get");
method.append(biosInterface, "BaseBIOSTable");
auto reply = bus.call(method, dbusTimeout);
std::variant<BaseBIOSTable> varBiosTable{};
@@ -722,10 +721,9 @@
return std::string(buffer.data(), buffer.data() + strLength);
}
-std::string
- BIOSConfig::displayStringHandle(uint16_t handle, uint8_t index,
- const std::optional<Table>& attrTable,
- const std::optional<Table>& stringTable)
+std::string BIOSConfig::displayStringHandle(
+ uint16_t handle, uint8_t index, const std::optional<Table>& attrTable,
+ const std::optional<Table>& stringTable)
{
auto attrEntry = pldm_bios_table_attr_find_by_handle(
attrTable->data(), attrTable->size(), handle);
@@ -905,8 +903,8 @@
auto attrValHeader = table::attribute_value::decodeHeader(attrValueEntry);
- auto attrEntry = table::attribute::findByHandle(*attrTable,
- attrValHeader.attrHandle);
+ auto attrEntry =
+ table::attribute::findByHandle(*attrTable, attrValHeader.attrHandle);
if (!attrEntry)
{
return PLDM_ERROR;
@@ -918,8 +916,8 @@
return rc;
}
- auto destTable = table::attribute_value::updateTable(*attrValueTable, entry,
- size);
+ auto destTable =
+ table::attribute_value::updateTable(*attrValueTable, entry, size);
if (!destTable)
{
@@ -1095,8 +1093,8 @@
auto iter = std::find_if(biosAttributes.begin(), biosAttributes.end(),
[&attributeName](const auto& attr) {
- return attr->name == attributeName;
- });
+ return attr->name == attributeName;
+ });
if (iter == biosAttributes.end())
{
@@ -1161,26 +1159,26 @@
pldm::utils::DBusHandler::getBus(),
propertiesChanged(objPath, objInterface),
[this](sdbusplus::message_t& msg) {
- constexpr auto propertyName = "PendingAttributes";
+ constexpr auto propertyName = "PendingAttributes";
- using Value =
- std::variant<std::string, PendingAttributes, BaseBIOSTable>;
- using Properties = std::map<DbusProp, Value>;
+ using Value =
+ std::variant<std::string, PendingAttributes, BaseBIOSTable>;
+ using Properties = std::map<DbusProp, Value>;
- Properties props{};
- std::string intf;
- msg.read(intf, props);
+ Properties props{};
+ std::string intf;
+ msg.read(intf, props);
- auto valPropMap = props.find(propertyName);
- if (valPropMap == props.end())
- {
- return;
- }
+ auto valPropMap = props.find(propertyName);
+ if (valPropMap == props.end())
+ {
+ return;
+ }
- PendingAttributes pendingAttributes =
- std::get<PendingAttributes>(valPropMap->second);
- this->constructPendingAttribute(pendingAttributes);
- });
+ PendingAttributes pendingAttributes =
+ std::get<PendingAttributes>(valPropMap->second);
+ this->constructPendingAttribute(pendingAttributes);
+ });
biosAttrMatch.emplace_back(std::move(updateBIOSMatch));
}