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/platform.hpp b/libpldmresponder/platform.hpp
index e43058e..47c9ecf 100644
--- a/libpldmresponder/platform.hpp
+++ b/libpldmresponder/platform.hpp
@@ -28,9 +28,9 @@
{
namespace platform
{
-using generatePDR = std::function<void(const pldm::utils::DBusHandler& dBusIntf,
- const pldm::utils::Json& json,
- pdr_utils::RepoInterface& repo)>;
+using generatePDR = std::function<void(
+ const pldm::utils::DBusHandler& dBusIntf, const pldm::utils::Json& json,
+ pdr_utils::RepoInterface& repo)>;
using EffecterId = uint16_t;
using DbusObjMaps =
@@ -58,8 +58,7 @@
pldm::requester::Handler<pldm::requester::Request>* handler,
sdeventplus::Event& event, bool buildPDRLazily = false,
const std::optional<EventMap>& addOnHandlersMap = std::nullopt) :
- eid(eid),
- instanceIdDb(instanceIdDb), pdrRepo(repo),
+ eid(eid), instanceIdDb(instanceIdDb), pdrRepo(repo),
hostPDRHandler(hostPDRHandler),
dbusToPLDMEventHandler(dbusToPLDMEventHandler), fruHandler(fruHandler),
dBusIntf(dBusIntf), platformConfigHandler(platformConfigHandler),
@@ -76,47 +75,48 @@
handlers.emplace(
PLDM_GET_PDR,
[this](pldm_tid_t, const pldm_msg* request, size_t payloadLength) {
- return this->getPDR(request, payloadLength);
- });
+ return this->getPDR(request, payloadLength);
+ });
handlers.emplace(
PLDM_SET_NUMERIC_EFFECTER_VALUE,
[this](pldm_tid_t, const pldm_msg* request, size_t payloadLength) {
- return this->setNumericEffecterValue(request, payloadLength);
- });
+ return this->setNumericEffecterValue(request, payloadLength);
+ });
handlers.emplace(
PLDM_GET_NUMERIC_EFFECTER_VALUE,
[this](pldm_tid_t, const pldm_msg* request, size_t payloadLength) {
- return this->getNumericEffecterValue(request, payloadLength);
- });
+ return this->getNumericEffecterValue(request, payloadLength);
+ });
handlers.emplace(
PLDM_SET_STATE_EFFECTER_STATES,
[this](pldm_tid_t, const pldm_msg* request, size_t payloadLength) {
- return this->setStateEffecterStates(request, payloadLength);
- });
+ return this->setStateEffecterStates(request, payloadLength);
+ });
handlers.emplace(
PLDM_PLATFORM_EVENT_MESSAGE,
[this](pldm_tid_t, const pldm_msg* request, size_t payloadLength) {
- return this->platformEventMessage(request, payloadLength);
- });
+ return this->platformEventMessage(request, payloadLength);
+ });
handlers.emplace(
PLDM_GET_STATE_SENSOR_READINGS,
[this](pldm_tid_t, const pldm_msg* request, size_t payloadLength) {
- return this->getStateSensorReadings(request, payloadLength);
- });
+ return this->getStateSensorReadings(request, payloadLength);
+ });
// Default handler for PLDM Events
eventHandlers[PLDM_SENSOR_EVENT].emplace_back(
[this](const pldm_msg* request, size_t payloadLength,
uint8_t formatVersion, uint8_t tid, size_t eventDataOffset) {
- return this->sensorEvent(request, payloadLength, formatVersion, tid,
- eventDataOffset);
- });
+ return this->sensorEvent(request, payloadLength, formatVersion,
+ tid, eventDataOffset);
+ });
eventHandlers[PLDM_PDR_REPOSITORY_CHG_EVENT].emplace_back(
[this](const pldm_msg* request, size_t payloadLength,
uint8_t formatVersion, uint8_t tid, size_t eventDataOffset) {
- return this->pldmPDRRepositoryChgEvent(
- request, payloadLength, formatVersion, tid, eventDataOffset);
- });
+ return this->pldmPDRRepositoryChgEvent(
+ request, payloadLength, formatVersion, tid,
+ eventDataOffset);
+ });
// Additional OEM event handlers for PLDM events, append it to the
// standard handlers
@@ -359,8 +359,8 @@
if (pdr->effecter_id != effecterId)
{
pdr = nullptr;
- pdrRecord = stateEffecterPDRs.getNextRecord(pdrRecord,
- pdrEntry);
+ pdrRecord =
+ stateEffecterPDRs.getNextRecord(pdrRecord, pdrEntry);
continue;
}
@@ -385,15 +385,15 @@
int rc = PLDM_SUCCESS;
try
{
- const auto& [dbusMappings,
- dbusValMaps] = effecterDbusObjMaps.at(effecterId);
+ const auto& [dbusMappings, dbusValMaps] =
+ effecterDbusObjMaps.at(effecterId);
for (uint8_t currState = 0; currState < compEffecterCnt;
++currState)
{
std::vector<StateSetNum> allowed{};
// computation is based on table 79 from DSP0248 v1.1.1
- uint8_t bitfieldIndex = stateField[currState].effecter_state /
- 8;
+ uint8_t bitfieldIndex =
+ stateField[currState].effecter_state / 8;
uint8_t bit = stateField[currState].effecter_state -
(8 * bitfieldIndex);
if (states->possible_states_size < bitfieldIndex ||