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: I1d204ff0a167c43688f2217e9dee5504c71cd4f0
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
diff --git a/util/dbus.cpp b/util/dbus.cpp
index af63487..b69b23f 100644
--- a/util/dbus.cpp
+++ b/util/dbus.cpp
@@ -428,9 +428,9 @@
             try
             {
                 // Format the vector into a single hex string to compare to.
-                std::string hexId = std::format("0x{:02x}{:02x}{:02x}{:02x}",
-                                                ids.at(0), ids.at(1), ids.at(2),
-                                                ids.at(3));
+                std::string hexId =
+                    std::format("0x{:02x}{:02x}{:02x}{:02x}", ids.at(0),
+                                ids.at(1), ids.at(2), ids.at(3));
 
                 std::map<std::string, MachineType> typeMap = {
                     {"0x50001000", MachineType::Rainier_2S4U},
@@ -479,8 +479,8 @@
     {
         // create dbus method
         auto bus = sdbusplus::bus::new_default();
-        sdbusplus::message_t method = bus.new_method_call(service, path,
-                                                          interface, function);
+        sdbusplus::message_t method =
+            bus.new_method_call(service, path, interface, function);
 
         // append additional method data
         method.append(terminusIdZero, PLDM_ENTITY_PROC, stateSetId);
@@ -514,8 +514,8 @@
     {
         // create dbus method
         auto bus = sdbusplus::bus::new_default();
-        sdbusplus::message_t method = bus.new_method_call(service, path,
-                                                          interface, function);
+        sdbusplus::message_t method =
+            bus.new_method_call(service, path, interface, function);
 
         // append additional method data
         method.append(terminusIdZero, PLDM_ENTITY_PROC, stateSetId);
@@ -546,8 +546,8 @@
     {
         // create dbus method
         auto bus = sdbusplus::bus::new_default();
-        sdbusplus::message_t method = bus.new_method_call(service, path,
-                                                          interface, function);
+        sdbusplus::message_t method =
+            bus.new_method_call(service, path, interface, function);
 
         // append endpoint ID
         method.append(Eid);
diff --git a/util/dbus.hpp b/util/dbus.hpp
index c1dc252..29851ee 100644
--- a/util/dbus.hpp
+++ b/util/dbus.hpp
@@ -65,9 +65,9 @@
     try
     {
         auto bus = sdbusplus::bus::new_default();
-        auto method = bus.new_method_call(service.c_str(), object.c_str(),
-                                          "org.freedesktop.DBus.Properties",
-                                          "Set");
+        auto method =
+            bus.new_method_call(service.c_str(), object.c_str(),
+                                "org.freedesktop.DBus.Properties", "Set");
         method.append(interface);
         method.append(propertyName);
         method.append(propertyValue);
diff --git a/util/ffdc.cpp b/util/ffdc.cpp
index 8f8069a..2c4a877 100644
--- a/util/ffdc.cpp
+++ b/util/ffdc.cpp
@@ -61,9 +61,8 @@
  * @param   max - Maximum number of messages fetch
  * @return  Vector of journal entry data
  */
-std::vector<std::string> sdjGetMessages(const std::string& field,
-                                        const std::string& fieldValue,
-                                        unsigned int max)
+std::vector<std::string> sdjGetMessages(
+    const std::string& field, const std::string& fieldValue, unsigned int max)
 {
     sd_journal* journal;
     std::vector<std::string> messages;
@@ -79,8 +78,8 @@
             if (value == fieldValue)
             {
                 // Get SYSLOG_IDENTIFIER field (process that logged message)
-                std::string syslog = sdjGetFieldValue(journal,
-                                                      "SYSLOG_IDENTIFIER");
+                std::string syslog =
+                    sdjGetFieldValue(journal, "SYSLOG_IDENTIFIER");
 
                 // Get _PID field
                 std::string pid = sdjGetFieldValue(journal, "_PID");
diff --git a/util/ffdc_file.cpp b/util/ffdc_file.cpp
index a067e0b..69ed073 100644
--- a/util/ffdc_file.cpp
+++ b/util/ffdc_file.cpp
@@ -19,8 +19,8 @@
     int fd = open(tempFile.getPath().c_str(), O_RDWR);
     if (fd == -1)
     {
-        throw std::runtime_error{std::string{"Unable to open FFDC file: "} +
-                                 strerror(errno)};
+        throw std::runtime_error{
+            std::string{"Unable to open FFDC file: "} + strerror(errno)};
     }
 
     // Store file descriptor in FileDescriptor object
@@ -33,8 +33,8 @@
     // Returns -1 if close failed.
     if (descriptor.close() == -1)
     {
-        throw std::runtime_error{std::string{"Unable to close FFDC file: "} +
-                                 strerror(errno)};
+        throw std::runtime_error{
+            std::string{"Unable to close FFDC file: "} + strerror(errno)};
     }
 
     // Delete temporary file.  Does nothing if file was already deleted.
diff --git a/util/ffdc_file.hpp b/util/ffdc_file.hpp
index 0e1e79e..f233eb2 100644
--- a/util/ffdc_file.hpp
+++ b/util/ffdc_file.hpp
@@ -164,9 +164,10 @@
 
     std::transform(i_files.begin(), i_files.end(), std::back_inserter(o_tuples),
                    [](const auto& e) {
-        return FFDCTuple(e.getFormat(), e.getSubType(), e.getVersion(),
-                         sdbusplus::message::unix_fd(e.getFileDescriptor()));
-    });
+                       return FFDCTuple(
+                           e.getFormat(), e.getSubType(), e.getVersion(),
+                           sdbusplus::message::unix_fd(e.getFileDescriptor()));
+                   });
 }
 
 } // namespace util
diff --git a/util/pdbg.cpp b/util/pdbg.cpp
index b499d83..50b4e7d 100644
--- a/util/pdbg.cpp
+++ b/util/pdbg.cpp
@@ -145,8 +145,8 @@
     // There should always be a parent chip. Throw an error if not found.
     if (nullptr == parentChip)
     {
-        throw std::logic_error("No parent chip found: i_target=" +
-                               std::string{getPath(i_target)});
+        throw std::logic_error(
+            "No parent chip found: i_target=" + std::string{getPath(i_target)});
     }
 
     return parentChip;
@@ -200,8 +200,8 @@
     }
     else
     {
-        throw std::logic_error("Unexpected parent chip: " +
-                               std::string{getPath(i_parentChip)});
+        throw std::logic_error(
+            "Unexpected parent chip: " + std::string{getPath(i_parentChip)});
     }
 
     // Iterate all children of the parent and match the unit position.
@@ -247,24 +247,24 @@
         // Rainier 4U
         case util::dbus::MachineType::Rainier_2S4U:
         case util::dbus::MachineType::Rainier_1S4U:
-            filePath = fs::path{PACKAGE_DIR
-                                "util-data/peer-targets-rainier-4u.json"};
+            filePath =
+                fs::path{PACKAGE_DIR "util-data/peer-targets-rainier-4u.json"};
             break;
         // Rainier 2U
         case util::dbus::MachineType::Rainier_2S2U:
         case util::dbus::MachineType::Rainier_1S2U:
-            filePath = fs::path{PACKAGE_DIR
-                                "util-data/peer-targets-rainier-2u.json"};
+            filePath =
+                fs::path{PACKAGE_DIR "util-data/peer-targets-rainier-2u.json"};
             break;
         // Everest
         case util::dbus::MachineType::Everest:
-            filePath = fs::path{PACKAGE_DIR
-                                "util-data/peer-targets-everest.json"};
+            filePath =
+                fs::path{PACKAGE_DIR "util-data/peer-targets-everest.json"};
             break;
         // Bonnell
         case util::dbus::MachineType::Bonnell:
-            filePath = fs::path{PACKAGE_DIR
-                                "util-data/peer-targets-bonnell.json"};
+            filePath =
+                fs::path{PACKAGE_DIR "util-data/peer-targets-bonnell.json"};
             break;
         default:
             trace::err("Invalid machine type found %d",
@@ -490,8 +490,8 @@
     auto mcc = pdbg_target_parent("mcc", ocmb);
     if (nullptr == mcc)
     {
-        throw std::logic_error("No parent MCC found for " +
-                               std::string{getPath(ocmb)});
+        throw std::logic_error(
+            "No parent MCC found for " + std::string{getPath(ocmb)});
     }
 
     // Read the associated DSTL_FIR_MASK.
diff --git a/util/pldm.cpp b/util/pldm.cpp
index 9dbe138..bbf2ce7 100644
--- a/util/pldm.cpp
+++ b/util/pldm.cpp
@@ -46,11 +46,9 @@
  *
  *  @return PLDM request message to be sent to host, empty message on error
  */
-std::vector<uint8_t> prepareSetEffecterReq(uint16_t effecterId,
-                                           uint8_t effecterCount,
-                                           uint8_t stateIdPos,
-                                           uint8_t stateSetValue,
-                                           uint8_t mctpEid)
+std::vector<uint8_t> prepareSetEffecterReq(
+    uint16_t effecterId, uint8_t effecterCount, uint8_t stateIdPos,
+    uint8_t stateSetValue, uint8_t mctpEid)
 {
     // get mctp instance associated with the endpoint ID
     uint8_t mctpInstance;
@@ -312,41 +310,42 @@
                 sdbusplus::bus::match::rules::path(path) +
                 sdbusplus::bus::match::rules::interface(interface),
             [&](auto& msg) {
-        uint8_t sensorTid{};
-        uint16_t sensorId{};
-        uint8_t msgSensorOffset{};
-        uint8_t eventState{};
-        uint8_t previousEventState{};
+                uint8_t sensorTid{};
+                uint16_t sensorId{};
+                uint8_t msgSensorOffset{};
+                uint8_t eventState{};
+                uint8_t previousEventState{};
 
-        // get sensor event details
-        msg.read(sensorTid, sensorId, msgSensorOffset, eventState,
-                 previousEventState);
+                // get sensor event details
+                msg.read(sensorTid, sensorId, msgSensorOffset, eventState,
+                         previousEventState);
 
-        // does sensor offset match?
-        if (sbeSensorOffset == msgSensorOffset)
-        {
-            // does sensor ID match?
-            auto sensorEntry = sensorToSbeInstance.find(sensorId);
-            if (sensorEntry != sensorToSbeInstance.end())
-            {
-                const uint8_t instance = sensorEntry->second;
-
-                // if instances matche check status
-                if (instance == sbeInstance)
+                // does sensor offset match?
+                if (sbeSensorOffset == msgSensorOffset)
                 {
-                    if (eventState == static_cast<uint8_t>(SBE_HRESET_READY))
+                    // does sensor ID match?
+                    auto sensorEntry = sensorToSbeInstance.find(sensorId);
+                    if (sensorEntry != sensorToSbeInstance.end())
                     {
-                        hresetStatus = "success";
-                    }
-                    else if (eventState ==
-                             static_cast<uint8_t>(SBE_HRESET_FAILED))
-                    {
-                        hresetStatus = "fail";
+                        const uint8_t instance = sensorEntry->second;
+
+                        // if instances matche check status
+                        if (instance == sbeInstance)
+                        {
+                            if (eventState ==
+                                static_cast<uint8_t>(SBE_HRESET_READY))
+                            {
+                                hresetStatus = "success";
+                            }
+                            else if (eventState ==
+                                     static_cast<uint8_t>(SBE_HRESET_FAILED))
+                            {
+                                hresetStatus = "fail";
+                            }
+                        }
                     }
                 }
-            }
-        }
-    });
+            });
 
     // send request to issue hreset of sbe
     int pldmFd = -1; // mctp socket file descriptor
diff --git a/util/temporary_file.cpp b/util/temporary_file.cpp
index 68b1d24..0bd4d08 100644
--- a/util/temporary_file.cpp
+++ b/util/temporary_file.cpp
@@ -14,8 +14,8 @@
 TemporaryFile::TemporaryFile()
 {
     // Build template path required by mkstemp()
-    std::string templatePath = fs::temp_directory_path() /
-                               "openpower-hw-diags-XXXXXX";
+    std::string templatePath =
+        fs::temp_directory_path() / "openpower-hw-diags-XXXXXX";
 
     // Generate unique file name, create file, and open it.  The XXXXXX
     // characters are replaced by mkstemp() to make the file name unique.