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: Ifce6b1c3f18e81bdb9e98f04b685e3aa6b69d292
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
diff --git a/.clang-format b/.clang-format
index d43e884..28e3328 100644
--- a/.clang-format
+++ b/.clang-format
@@ -87,7 +87,7 @@
IndentWrappedFunctionNames: true
InsertNewlineAtEOF: true
KeepEmptyLinesAtTheStartOfBlocks: false
-LambdaBodyIndentation: OuterScope
+LambdaBodyIndentation: Signature
LineEnding: LF
MacroBlockBegin: ''
MacroBlockEnd: ''
@@ -98,13 +98,14 @@
ObjCSpaceBeforeProtocolList: true
PackConstructorInitializers: BinPack
PenaltyBreakAssignment: 25
-PenaltyBreakBeforeFirstCallParameter: 19
+PenaltyBreakBeforeFirstCallParameter: 50
PenaltyBreakComment: 300
PenaltyBreakFirstLessLess: 120
PenaltyBreakString: 1000
+PenaltyBreakTemplateDeclaration: 10
PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 60
-PenaltyIndentedWhitespace: 0
+PenaltyIndentedWhitespace: 1
PointerAlignment: Left
QualifierAlignment: Left
ReferenceAlignment: Left
diff --git a/elog-errors.hpp b/elog-errors.hpp
index ab3cadc..e215431 100644
--- a/elog-errors.hpp
+++ b/elog-errors.hpp
@@ -63,7 +63,7 @@
*/
static constexpr auto str_short = "ESEL";
using type = std::tuple<std::decay_t<decltype("ESEL=%s")>, const char*>;
- explicit constexpr ESEL(const char* a) : _entry(entry("ESEL=%s", a)){};
+ explicit constexpr ESEL(const char* a) : _entry(entry("ESEL=%s", a)) {};
type _entry;
};
} // namespace _Event
@@ -109,7 +109,7 @@
static constexpr auto str_short = "PROCEDURE";
using type = std::tuple<std::decay_t<decltype("PROCEDURE=%u")>, uint32_t>;
explicit constexpr PROCEDURE(uint32_t a) :
- _entry(entry("PROCEDURE=%u", a)){};
+ _entry(entry("PROCEDURE=%u", a)) {};
type _entry;
};
} // namespace _Procedure
@@ -157,7 +157,7 @@
using type =
std::tuple<std::decay_t<decltype("CALLOUT_ERRNO=%d")>, int32_t>;
explicit constexpr CALLOUT_ERRNO(int32_t a) :
- _entry(entry("CALLOUT_ERRNO=%d", a)){};
+ _entry(entry("CALLOUT_ERRNO=%d", a)) {};
type _entry;
};
struct CALLOUT_DEVICE_PATH
@@ -171,7 +171,7 @@
using type = std::tuple<std::decay_t<decltype("CALLOUT_DEVICE_PATH=%s")>,
const char*>;
explicit constexpr CALLOUT_DEVICE_PATH(const char* a) :
- _entry(entry("CALLOUT_DEVICE_PATH=%s", a)){};
+ _entry(entry("CALLOUT_DEVICE_PATH=%s", a)) {};
type _entry;
};
} // namespace _Device
@@ -220,7 +220,7 @@
using type =
std::tuple<std::decay_t<decltype("CALLOUT_GPIO_NUM=%u")>, uint32_t>;
explicit constexpr CALLOUT_GPIO_NUM(uint32_t a) :
- _entry(entry("CALLOUT_GPIO_NUM=%u", a)){};
+ _entry(entry("CALLOUT_GPIO_NUM=%u", a)) {};
type _entry;
};
} // namespace _GPIO
@@ -272,7 +272,7 @@
using type =
std::tuple<std::decay_t<decltype("CALLOUT_IIC_BUS=%s")>, const char*>;
explicit constexpr CALLOUT_IIC_BUS(const char* a) :
- _entry(entry("CALLOUT_IIC_BUS=%s", a)){};
+ _entry(entry("CALLOUT_IIC_BUS=%s", a)) {};
type _entry;
};
struct CALLOUT_IIC_ADDR
@@ -286,7 +286,7 @@
using type =
std::tuple<std::decay_t<decltype("CALLOUT_IIC_ADDR=0x%hx")>, uint16_t>;
explicit constexpr CALLOUT_IIC_ADDR(uint16_t a) :
- _entry(entry("CALLOUT_IIC_ADDR=0x%hx", a)){};
+ _entry(entry("CALLOUT_IIC_ADDR=0x%hx", a)) {};
type _entry;
};
} // namespace _IIC
@@ -339,7 +339,7 @@
using type = std::tuple<std::decay_t<decltype("CALLOUT_INVENTORY_PATH=%s")>,
const char*>;
explicit constexpr CALLOUT_INVENTORY_PATH(const char* a) :
- _entry(entry("CALLOUT_INVENTORY_PATH=%s", a)){};
+ _entry(entry("CALLOUT_INVENTORY_PATH=%s", a)) {};
type _entry;
};
} // namespace _Inventory
@@ -389,7 +389,7 @@
std::tuple<std::decay_t<decltype("CALLOUT_IPMI_SENSOR_NUM=%u")>,
uint32_t>;
explicit constexpr CALLOUT_IPMI_SENSOR_NUM(uint32_t a) :
- _entry(entry("CALLOUT_IPMI_SENSOR_NUM=%u", a)){};
+ _entry(entry("CALLOUT_IPMI_SENSOR_NUM=%u", a)) {};
type _entry;
};
} // namespace _IPMISensor
@@ -436,7 +436,7 @@
*/
static constexpr auto str_short = "ESEL";
using type = std::tuple<std::decay_t<decltype("ESEL=%s")>, const char*>;
- explicit constexpr ESEL(const char* a) : _entry(entry("ESEL=%s", a)){};
+ explicit constexpr ESEL(const char* a) : _entry(entry("ESEL=%s", a)) {};
type _entry;
};
} // namespace _Event
@@ -482,7 +482,7 @@
*/
static constexpr auto str_short = "ESEL";
using type = std::tuple<std::decay_t<decltype("ESEL=%s")>, const char*>;
- explicit constexpr ESEL(const char* a) : _entry(entry("ESEL=%s", a)){};
+ explicit constexpr ESEL(const char* a) : _entry(entry("ESEL=%s", a)) {};
type _entry;
};
} // namespace _MaintenanceProcedure
diff --git a/host-interface.cpp b/host-interface.cpp
index 47e4437..08dfdd9 100644
--- a/host-interface.cpp
+++ b/host-interface.cpp
@@ -41,10 +41,10 @@
{
auto sensorID = std::get<uint8_t>(data);
- auto cmd = std::make_tuple(std::make_pair(IPMI_CMD_OCC_RESET, sensorID),
- std::bind(&Host::commandStatusHandler, this,
- std::placeholders::_1,
- std::placeholders::_2));
+ auto cmd = std::make_tuple(
+ std::make_pair(IPMI_CMD_OCC_RESET, sensorID),
+ std::bind(&Host::commandStatusHandler, this, std::placeholders::_1,
+ std::placeholders::_2));
return ipmid_send_cmd_to_host(std::move(cmd));
}
diff --git a/oemhandler.cpp b/oemhandler.cpp
index 3f5a151..80ea42e 100644
--- a/oemhandler.cpp
+++ b/oemhandler.cpp
@@ -70,8 +70,8 @@
*/
auto found = std::find_if(invSensors.begin(), invSensors.end(),
[&sensor](const auto& iter) {
- return (iter.second.sensorID == sensor);
- });
+ return (iter.second.sensorID == sensor);
+ });
if (found != invSensors.end())
{
return found->first;
@@ -227,11 +227,9 @@
// function to commit the error log in to long term
// storage. Likely via the ipmi add_sel command.
///////////////////////////////////////////////////////////////////////////////
-ipmi_ret_t ipmi_ibm_oem_partial_esel(ipmi_netfn_t netfn, ipmi_cmd_t cmd,
- ipmi_request_t request,
- ipmi_response_t response,
- ipmi_data_len_t data_len,
- ipmi_context_t context)
+ipmi_ret_t ipmi_ibm_oem_partial_esel(
+ ipmi_netfn_t netfn, ipmi_cmd_t cmd, ipmi_request_t request,
+ ipmi_response_t response, ipmi_data_len_t data_len, ipmi_context_t context)
{
uint8_t* reqptr = (uint8_t*)request;
esel_request_t esel_req;
@@ -319,11 +317,9 @@
// Prepare for FW Update.
// Execute needed commands to prepare the system for a fw update from the host.
-ipmi_ret_t ipmi_ibm_oem_prep_fw_update(ipmi_netfn_t netfn, ipmi_cmd_t cmd,
- ipmi_request_t request,
- ipmi_response_t response,
- ipmi_data_len_t data_len,
- ipmi_context_t context)
+ipmi_ret_t ipmi_ibm_oem_prep_fw_update(
+ ipmi_netfn_t netfn, ipmi_cmd_t cmd, ipmi_request_t request,
+ ipmi_response_t response, ipmi_data_len_t data_len, ipmi_context_t context)
{
ipmi_ret_t ipmi_rc = IPMI_CC_OK;
*data_len = 0;
@@ -360,11 +356,9 @@
return ipmi_rc;
}
-ipmi_ret_t ipmi_ibm_oem_bmc_factory_reset(ipmi_netfn_t netfn, ipmi_cmd_t cmd,
- ipmi_request_t request,
- ipmi_response_t response,
- ipmi_data_len_t data_len,
- ipmi_context_t context)
+ipmi_ret_t ipmi_ibm_oem_bmc_factory_reset(
+ ipmi_netfn_t netfn, ipmi_cmd_t cmd, ipmi_request_t request,
+ ipmi_response_t response, ipmi_data_len_t data_len, ipmi_context_t context)
{
sdbusplus::bus_t bus{ipmid_get_sd_bus_connection()};
diff --git a/oemhandler.hpp b/oemhandler.hpp
index 9c5f563..931f979 100644
--- a/oemhandler.hpp
+++ b/oemhandler.hpp
@@ -40,11 +40,9 @@
*/
void createLogEntry(const std::string& eSELData);
-ipmi_ret_t ipmi_ibm_oem_partial_esel(ipmi_netfn_t netfn, ipmi_cmd_t cmd,
- ipmi_request_t request,
- ipmi_response_t response,
- ipmi_data_len_t data_len,
- ipmi_context_t context);
+ipmi_ret_t ipmi_ibm_oem_partial_esel(
+ ipmi_netfn_t netfn, ipmi_cmd_t cmd, ipmi_request_t request,
+ ipmi_response_t response, ipmi_data_len_t data_len, ipmi_context_t context);
struct esel_request_t
{