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: I21d2ca8065f24fd73509229c517f5caf48934b60
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
diff --git a/extensions/openpower-pels/user_data_json.cpp b/extensions/openpower-pels/user_data_json.cpp
index 34da02f..0d621ec 100644
--- a/extensions/openpower-pels/user_data_json.cpp
+++ b/extensions/openpower-pels/user_data_json.cpp
@@ -253,10 +253,9 @@
* @return std::optional<std::string> - The JSON string if it could be created,
* else std::nullopt
*/
-std::optional<std::string> getPythonJSON(uint16_t componentID, uint8_t subType,
- uint8_t version,
- const std::vector<uint8_t>& data,
- uint8_t creatorID)
+std::optional<std::string>
+ getPythonJSON(uint16_t componentID, uint8_t subType, uint8_t version,
+ const std::vector<uint8_t>& data, uint8_t creatorID)
{
PyObject *pName, *pModule, *eType, *eValue, *eTraceback, *pKey;
std::string pErrStr;
@@ -291,8 +290,8 @@
}
else
{
- std::unique_ptr<PyObject, decltype(&pyDecRef)> modPtr(pModule,
- &pyDecRef);
+ std::unique_ptr<PyObject, decltype(&pyDecRef)> modPtr(
+ pModule, &pyDecRef);
std::string funcToCall = "parseUDToJson";
pKey = PyUnicode_FromString(funcToCall.c_str());
std::unique_ptr<PyObject, decltype(&pyDecRef)> keyPtr(pKey, &pyDecRef);
@@ -315,8 +314,8 @@
{
auto ud = data.data();
PyObject* pArgs = PyTuple_New(3);
- std::unique_ptr<PyObject, decltype(&pyDecRef)> argPtr(pArgs,
- &pyDecRef);
+ std::unique_ptr<PyObject, decltype(&pyDecRef)> argPtr(
+ pArgs, &pyDecRef);
PyTuple_SetItem(pArgs, 0,
PyLong_FromUnsignedLong((unsigned long)subType));
PyTuple_SetItem(pArgs, 1,
@@ -331,8 +330,8 @@
{
std::unique_ptr<PyObject, decltype(&pyDecRef)> resPtr(
pResult, &pyDecRef);
- PyObject* pBytes = PyUnicode_AsEncodedString(pResult, "utf-8",
- "~E~");
+ PyObject* pBytes =
+ PyUnicode_AsEncodedString(pResult, "utf-8", "~E~");
std::unique_ptr<PyObject, decltype(&pyDecRef)> pyBytePtr(
pBytes, &pyDecRef);
const char* output = PyBytes_AS_STRING(pBytes);
@@ -393,11 +392,10 @@
return std::nullopt;
}
-std::optional<std::string> getJSON(uint16_t componentID, uint8_t subType,
- uint8_t version,
- const std::vector<uint8_t>& data,
- uint8_t creatorID,
- const std::vector<std::string>& plugins)
+std::optional<std::string>
+ getJSON(uint16_t componentID, uint8_t subType, uint8_t version,
+ const std::vector<uint8_t>& data, uint8_t creatorID,
+ const std::vector<std::string>& plugins)
{
std::string subsystem = getNumberString("%c", tolower(creatorID));
std::string component = getNumberString("%04x", componentID);