clang-format: copy latest and re-format

clang-format-16 has some backwards incompatible changes that require
additional settings for best compatibility and re-running the formatter.
Copy the latest .clang-format from the docs repository and reformat the
repository.

Change-Id: Ia240047e2472bccb2bb039ff71bea20a7a602ec4
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
diff --git a/subprojects/acpi-power-state-daemon/acpi_power_state.cpp b/subprojects/acpi-power-state-daemon/acpi_power_state.cpp
index f34bda3..7b12ef1 100644
--- a/subprojects/acpi-power-state-daemon/acpi_power_state.cpp
+++ b/subprojects/acpi-power-state-daemon/acpi_power_state.cpp
@@ -83,7 +83,6 @@
 
 int main()
 {
-
     auto b = sdbusplus::bus::new_default();
     sdbusplus::server::manager_t m{b, acpiObjPath};
 
diff --git a/subprojects/dhcp-done/dhcp-done.cpp b/subprojects/dhcp-done/dhcp-done.cpp
index e4fcbc0..818915e 100644
--- a/subprojects/dhcp-done/dhcp-done.cpp
+++ b/subprojects/dhcp-done/dhcp-done.cpp
@@ -33,8 +33,8 @@
 stdplus::ManagedFd createListener()
 {
     using namespace stdplus::fd;
-    auto sock =
-        socket(SocketDomain::INet6, SocketType::Stream, SocketProto::TCP);
+    auto sock = socket(SocketDomain::INet6, SocketType::Stream,
+                       SocketProto::TCP);
     setFileFlags(sock, getFileFlags(sock).set(stdplus::fd::FileFlag::NonBlock));
     sockaddr_in6 addr = {};
     addr.sin6_family = AF_INET6;
@@ -75,11 +75,10 @@
         sdeventplus::source::IO do_accept(
             event, listener.get(), EPOLLIN | EPOLLET,
             [&](sdeventplus::source::IO&, int, uint32_t) {
-                while (auto fd = stdplus::fd::accept(listener))
-                {
-                    stdplus::fd::sendExact(*fd, data,
-                                           stdplus::fd::SendFlags(0));
-                }
+            while (auto fd = stdplus::fd::accept(listener))
+            {
+                stdplus::fd::sendExact(*fd, data, stdplus::fd::SendFlags(0));
+            }
             });
         return event.loop();
     }
diff --git a/subprojects/libcr51sign/src/libcr51sign.c b/subprojects/libcr51sign/src/libcr51sign.c
index b9be35e..c631408 100644
--- a/subprojects/libcr51sign/src/libcr51sign.c
+++ b/subprojects/libcr51sign/src/libcr51sign.c
@@ -291,7 +291,7 @@
         uint32_t i;
         uint8_t d_region_num = 0;
         int rv;
-        struct image_region const* region;
+        const struct image_region* region;
 
         if (image_regions == NULL)
         {
@@ -738,17 +738,17 @@
             CPRINTS(ctx, "validate_descriptor: unsupported descriptor\n");
             return LIBCR51SIGN_ERROR_UNSUPPORTED_DESCRIPTOR;
         }
-        rv =
-            get_signature_struct_size(signature_scheme, &signature_struct_size);
+        rv = get_signature_struct_size(signature_scheme,
+                                       &signature_struct_size);
         if (rv != LIBCR51SIGN_SUCCESS)
         {
             return rv;
         }
 
         // Compute the size of the signed portion of the image descriptor.
-        signed_size =
-            sizeof(struct image_descriptor) +
-            ctx->descriptor.region_count * sizeof(struct image_region);
+        signed_size = sizeof(struct image_descriptor) +
+                      ctx->descriptor.region_count *
+                          sizeof(struct image_region);
         rv = get_hash_struct_size(ctx->descriptor.hash_type, &hash_struct_size);
         if (rv != LIBCR51SIGN_SUCCESS)
         {
@@ -758,8 +758,8 @@
         if (ctx->descriptor.denylist_size)
         {
             signed_size += sizeof(struct denylist);
-            signed_size +=
-                ctx->descriptor.denylist_size * sizeof(struct denylist_record);
+            signed_size += ctx->descriptor.denylist_size *
+                           sizeof(struct denylist_record);
         }
         if (ctx->descriptor.blob_size)
         {
diff --git a/subprojects/metrics-ipmi-blobs/metric.cpp b/subprojects/metrics-ipmi-blobs/metric.cpp
index bc8ac94..954d988 100644
--- a/subprojects/metrics-ipmi-blobs/metric.cpp
+++ b/subprojects/metrics-ipmi-blobs/metric.cpp
@@ -451,4 +451,4 @@
     return ret;
 }
 
-} // namespace metric_blob
\ No newline at end of file
+} // namespace metric_blob
diff --git a/subprojects/metrics-ipmi-blobs/test/util_test.cpp b/subprojects/metrics-ipmi-blobs/test/util_test.cpp
index 00c5ed8..8a7e181 100644
--- a/subprojects/metrics-ipmi-blobs/test/util_test.cpp
+++ b/subprojects/metrics-ipmi-blobs/test/util_test.cpp
@@ -154,4 +154,4 @@
 {
     ::testing::InitGoogleTest(&argc, argv);
     return RUN_ALL_TESTS();
-}
\ No newline at end of file
+}
diff --git a/subprojects/metrics-ipmi-blobs/util.cpp b/subprojects/metrics-ipmi-blobs/util.cpp
index 3057cfb..5bfc9c8 100644
--- a/subprojects/metrics-ipmi-blobs/util.cpp
+++ b/subprojects/metrics-ipmi-blobs/util.cpp
@@ -111,8 +111,8 @@
 
 std::string getCmdLine(const int pid)
 {
-    const std::string& cmdlinePath =
-        "/proc/" + std::to_string(pid) + "/cmdline";
+    const std::string& cmdlinePath = "/proc/" + std::to_string(pid) +
+                                     "/cmdline";
 
     std::string cmdline = readFileThenGrepIntoString(cmdlinePath);
     for (size_t i = 0; i < cmdline.size(); ++i)
@@ -245,8 +245,8 @@
     uint32_t pageOffset = target & ~static_cast<uint32_t>(pageSize - 1);
     uint32_t offsetInPage = target & static_cast<uint32_t>(pageSize - 1);
 
-    void* mapBase =
-        mmap(NULL, pageSize * 2, PROT_READ, MAP_SHARED, fd, pageOffset);
+    void* mapBase = mmap(NULL, pageSize * 2, PROT_READ, MAP_SHARED, fd,
+                         pageOffset);
     if (mapBase == MAP_FAILED)
     {
         close(fd);
@@ -284,7 +284,7 @@
         {"FirmwareTimestampMonotonic",
          offsetof(BootTimesMonotonic, firmwareTime)}, // negative value
         {"LoaderTimestampMonotonic",
-         offsetof(BootTimesMonotonic, loaderTime)}, // negative value
+         offsetof(BootTimesMonotonic, loaderTime)},   // negative value
         {"InitRDTimestampMonotonic", offsetof(BootTimesMonotonic, initrdTime)},
         {"UserspaceTimestampMonotonic",
          offsetof(BootTimesMonotonic, userspaceTime)},
@@ -326,8 +326,8 @@
         return false;
     }
 
-    std::string cpuinfo =
-        readFileThenGrepIntoString("/proc/cpuinfo", "Hardware");
+    std::string cpuinfo = readFileThenGrepIntoString("/proc/cpuinfo",
+                                                     "Hardware");
     // Nuvoton NPCM7XX chip has a counter which starts from power-on.
     if (cpuinfo.find("NPCM7XX") != std::string::npos)
     {
@@ -348,4 +348,4 @@
     return true;
 }
 
-} // namespace metric_blob
\ No newline at end of file
+} // namespace metric_blob
diff --git a/subprojects/ncsid/src/ncsi_sockio.h b/subprojects/ncsid/src/ncsi_sockio.h
index b41cbc4..09c610a 100644
--- a/subprojects/ncsid/src/ncsi_sockio.h
+++ b/subprojects/ncsid/src/ncsi_sockio.h
@@ -32,8 +32,7 @@
   public:
     SockIO() = default;
 
-    explicit SockIO(int sockfd) : net::SockIO(sockfd)
-    {}
+    explicit SockIO(int sockfd) : net::SockIO(sockfd) {}
 
     // This function creates a raw socket and initializes sockfd_.
     // If the default constructor for this class was used,
diff --git a/subprojects/ncsid/src/net_config.cpp b/subprojects/ncsid/src/net_config.cpp
index 5b5ae93..e9b390b 100644
--- a/subprojects/ncsid/src/net_config.cpp
+++ b/subprojects/ncsid/src/net_config.cpp
@@ -50,9 +50,9 @@
 
 int parse_mac(const std::string& mac_addr, mac_addr_t* mac)
 {
-    int ret =
-        sscanf(mac_addr.c_str(), MAC_FORMAT, mac->octet, mac->octet + 1,
-               mac->octet + 2, mac->octet + 3, mac->octet + 4, mac->octet + 5);
+    int ret = sscanf(mac_addr.c_str(), MAC_FORMAT, mac->octet, mac->octet + 1,
+                     mac->octet + 2, mac->octet + 3, mac->octet + 4,
+                     mac->octet + 5);
 
     return ret < 6 ? -1 : 0;
 }
diff --git a/subprojects/ncsid/src/net_iface.h b/subprojects/ncsid/src/net_iface.h
index d7c2b4c..d44f23c 100644
--- a/subprojects/ncsid/src/net_iface.h
+++ b/subprojects/ncsid/src/net_iface.h
@@ -87,8 +87,7 @@
 class IFace : public IFaceBase
 {
   public:
-    explicit IFace(const std::string& name) : IFaceBase(name)
-    {}
+    explicit IFace(const std::string& name) : IFaceBase(name) {}
 
     /** @brief Bind given socket to this interface. Similar to bind
      *     syscall, except that it fills in sll_ifindex field
diff --git a/subprojects/ncsid/src/net_sockio.h b/subprojects/ncsid/src/net_sockio.h
index 551be85..9adb9a8 100644
--- a/subprojects/ncsid/src/net_sockio.h
+++ b/subprojects/ncsid/src/net_sockio.h
@@ -25,8 +25,7 @@
 {
   public:
     SockIO() = default;
-    explicit SockIO(int sockfd) : sockfd_{sockfd}
-    {}
+    explicit SockIO(int sockfd) : sockfd_{sockfd} {}
     virtual ~SockIO();
 
     int get_sockfd() const
diff --git a/subprojects/ncsid/test/ncsi_test.cpp b/subprojects/ncsid/test/ncsi_test.cpp
index 39b8378..b613647 100644
--- a/subprojects/ncsid/test/ncsi_test.cpp
+++ b/subprojects/ncsid/test/ncsi_test.cpp
@@ -172,8 +172,8 @@
     static constexpr int test_num_states = 9;
 
     // Total number of states in all three state machines.
-    static constexpr int total_num_states =
-        l2_num_states + l3l4_num_states + test_num_states;
+    static constexpr int total_num_states = l2_num_states + l3l4_num_states +
+                                            test_num_states;
 };
 
 TEST_F(TestNcsi, TestMACAddrPropagation)
diff --git a/subprojects/ncsid/test/net_iface_mock.h b/subprojects/ncsid/test/net_iface_mock.h
index bcf9209..0ccf5bf 100644
--- a/subprojects/ncsid/test/net_iface_mock.h
+++ b/subprojects/ncsid/test/net_iface_mock.h
@@ -26,10 +26,8 @@
 class IFace : public net::IFaceBase
 {
   public:
-    IFace() : net::IFaceBase("mock0")
-    {}
-    explicit IFace(const std::string& name) : net::IFaceBase(name)
-    {}
+    IFace() : net::IFaceBase("mock0") {}
+    explicit IFace(const std::string& name) : net::IFaceBase(name) {}
     int bind_sock(int sockfd, struct sockaddr_ll* saddr) const override;
 
     mutable std::vector<int> bound_socks;
diff --git a/subprojects/ncsid/test/nic_mock.cpp b/subprojects/ncsid/test/nic_mock.cpp
index 01b154b..c435ffa 100644
--- a/subprojects/ncsid/test/nic_mock.cpp
+++ b/subprojects/ncsid/test/nic_mock.cpp
@@ -72,8 +72,8 @@
         payload_offset += sizeof(ncsi_oem_extension_header_t);
     }
 
-    packet_raw_ =
-        std::vector<uint8_t>(ncsi_buf.data, ncsi_buf.data + ncsi_buf.len);
+    packet_raw_ = std::vector<uint8_t>(ncsi_buf.data,
+                                       ncsi_buf.data + ncsi_buf.len);
     // TODO: Verify payload length.
 
     return true;
@@ -100,8 +100,8 @@
              simple_commands_.end())
     {
         // Simple Response
-        response_size =
-            ncsi_build_simple_ack(request_buf.data, response_buf->data);
+        response_size = ncsi_build_simple_ack(request_buf.data,
+                                              response_buf->data);
     }
     else
     {
@@ -185,8 +185,8 @@
         }
         break;
         case NCSI_OEM_COMMAND_ECHO:
-            response_size =
-                ncsi_build_oem_echo_ack(request_buf.data, response_buf->data);
+            response_size = ncsi_build_oem_echo_ack(request_buf.data,
+                                                    response_buf->data);
             break;
         case NCSI_OEM_COMMAND_GET_FILTER:
         {
@@ -273,13 +273,11 @@
 
 void NIC::set_hostless(bool is_hostless)
 {
-    auto set_flag_op = [](uint8_t lhs, uint8_t rhs) -> auto
-    {
+    auto set_flag_op = [](uint8_t lhs, uint8_t rhs) -> auto {
         return lhs | rhs;
     };
 
-    auto clear_flag_op = [](uint8_t lhs, uint8_t rhs) -> auto
-    {
+    auto clear_flag_op = [](uint8_t lhs, uint8_t rhs) -> auto {
         return lhs & ~rhs;
     };
 
@@ -287,14 +285,14 @@
 
     if (channel_count_ > 0)
     {
-        ch0_filter_.flags =
-            flag_op(ch0_filter_.flags, NCSI_OEM_FILTER_FLAGS_HOSTLESS);
+        ch0_filter_.flags = flag_op(ch0_filter_.flags,
+                                    NCSI_OEM_FILTER_FLAGS_HOSTLESS);
     }
 
     if (channel_count_ > 1)
     {
-        ch1_filter_.flags =
-            flag_op(ch1_filter_.flags, NCSI_OEM_FILTER_FLAGS_HOSTLESS);
+        ch1_filter_.flags = flag_op(ch1_filter_.flags,
+                                    NCSI_OEM_FILTER_FLAGS_HOSTLESS);
     }
 }
 
diff --git a/subprojects/nemora-postd/src/nemora.cpp b/subprojects/nemora-postd/src/nemora.cpp
index 472995a..f958b01 100644
--- a/subprojects/nemora-postd/src/nemora.cpp
+++ b/subprojects/nemora-postd/src/nemora.cpp
@@ -42,9 +42,9 @@
 
 bool Nemora::ParseMac(const std::string& mac_addr, MacAddr* mac)
 {
-    int ret =
-        sscanf(mac_addr.c_str(), MAC_FORMAT, mac->octet, mac->octet + 1,
-               mac->octet + 2, mac->octet + 3, mac->octet + 4, mac->octet + 5);
+    int ret = sscanf(mac_addr.c_str(), MAC_FORMAT, mac->octet, mac->octet + 1,
+                     mac->octet + 2, mac->octet + 3, mac->octet + 4,
+                     mac->octet + 5);
     return (ret == MAC_ADDR_SIZE);
 }