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: I4635e7b93b66ada3ab5390a21cf465919059fbc1
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
diff --git a/src/fd/atomic.cpp b/src/fd/atomic.cpp
index 5299789..6b7530c 100644
--- a/src/fd/atomic.cpp
+++ b/src/fd/atomic.cpp
@@ -37,8 +37,7 @@
AtomicWriter::AtomicWriter(const std::filesystem::path& filename, int mode,
std::string_view tmpl) :
- filename(filename),
- mode(mode),
+ filename(filename), mode(mode),
tmpname(!tmpl.empty() ? std::string(tmpl) : makeTmpName(filename)),
fd(mktemp(tmpname))
{}
diff --git a/src/fd/impl.cpp b/src/fd/impl.cpp
index c2d5623..3147e64 100644
--- a/src/fd/impl.cpp
+++ b/src/fd/impl.cpp
@@ -46,9 +46,8 @@
::recv(get(), buf.data(), buf.size(), static_cast<int>(flags)));
}
-std::tuple<std::span<std::byte>, std::span<std::byte>>
- FdImpl::recvfrom(std::span<std::byte> buf, RecvFlags flags,
- std::span<std::byte> sockaddr)
+std::tuple<std::span<std::byte>, std::span<std::byte>> FdImpl::recvfrom(
+ std::span<std::byte> buf, RecvFlags flags, std::span<std::byte> sockaddr)
{
socklen_t sockaddrsize = sockaddr.size();
auto ret =
@@ -67,14 +66,14 @@
std::span<const std::byte> FdImpl::send(std::span<const std::byte> data,
SendFlags flags)
{
- return fret(
- data, "send",
- ::send(get(), data.data(), data.size(), static_cast<int>(flags)));
+ return fret(data, "send",
+ ::send(get(), data.data(), data.size(),
+ static_cast<int>(flags)));
}
-std::span<const std::byte> FdImpl::sendto(std::span<const std::byte> data,
- SendFlags flags,
- std::span<const std::byte> sockaddr)
+std::span<const std::byte>
+ FdImpl::sendto(std::span<const std::byte> data, SendFlags flags,
+ std::span<const std::byte> sockaddr)
{
return fret(
data, "sendto",
diff --git a/src/fd/mmap.cpp b/src/fd/mmap.cpp
index 1f5c211..7026aa6 100644
--- a/src/fd/mmap.cpp
+++ b/src/fd/mmap.cpp
@@ -7,8 +7,7 @@
{
MMap::MMap(Fd& fd, std::span<std::byte> window, ProtFlags prot, MMapFlags flags,
- off_t offset) :
- mapping(fd.mmap(window, prot, flags, offset), fd)
+ off_t offset) : mapping(fd.mmap(window, prot, flags, offset), fd)
{}
std::span<std::byte> MMap::get() const
diff --git a/src/fd/ops.cpp b/src/fd/ops.cpp
index ca549f7..c069a5a 100644
--- a/src/fd/ops.cpp
+++ b/src/fd/ops.cpp
@@ -20,8 +20,8 @@
{
while (total < data.size())
{
- auto r = (fd.*fun)(data.subspan(total),
- std::forward<Args>(args)...);
+ auto r =
+ (fd.*fun)(data.subspan(total), std::forward<Args>(args)...);
if (r.size() == 0)
{
throw exception::WouldBlock(
@@ -76,17 +76,17 @@
}
template <typename Fun, typename Byte, typename... Args>
-static std::span<Byte> opAligned(const char* name, Fun&& fun, Fd& fd,
- size_t align, std::span<Byte> data,
- Args&&... args)
+static std::span<Byte>
+ opAligned(const char* name, Fun&& fun, Fd& fd, size_t align,
+ std::span<Byte> data, Args&&... args)
{
std::size_t total = 0;
try
{
do
{
- auto r = (fd.*fun)(data.subspan(total),
- std::forward<Args>(args)...);
+ auto r =
+ (fd.*fun)(data.subspan(total), std::forward<Args>(args)...);
if (total != 0 && r.size() == 0)
{
throw exception::Incomplete(
@@ -124,9 +124,8 @@
return opAligned("writeAligned", &Fd::write, fd, align, data);
}
-std::span<const std::byte> sendAligned(Fd& fd, size_t align,
- std::span<const std::byte> data,
- SendFlags flags)
+std::span<const std::byte> sendAligned(
+ Fd& fd, size_t align, std::span<const std::byte> data, SendFlags flags)
{
return opAligned("sendAligned", &Fd::send, fd, align, data, flags);
}