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: I6bbb587615b9d6f158900201ca04a647cb3a8f96
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
diff --git a/src/dl.cpp b/src/dl.cpp
index 659389c..050f25c 100644
--- a/src/dl.cpp
+++ b/src/dl.cpp
@@ -8,8 +8,7 @@
Dl::Dl(const char* file, DlOpenFlags flags) :
handle(open(file, static_cast<int>(flags)))
-{
-}
+{}
struct link_map* Dl::linkMap()
{
diff --git a/src/exception.cpp b/src/exception.cpp
index c969295..cd79ebc 100644
--- a/src/exception.cpp
+++ b/src/exception.cpp
@@ -24,26 +24,22 @@
WouldBlock::WouldBlock(const char* what) :
std::system_error(std::make_error_code(std::errc::operation_would_block),
what)
-{
-}
+{}
WouldBlock::WouldBlock(const std::string& what) :
std::system_error(std::make_error_code(std::errc::operation_would_block),
what)
-{
-}
+{}
Eof::Eof(const char* what) :
std::system_error(std::make_error_code(std::errc::no_message_available),
what)
-{
-}
+{}
Eof::Eof(const std::string& what) :
std::system_error(std::make_error_code(std::errc::no_message_available),
what)
-{
-}
+{}
} // namespace exception
} // namespace stdplus
diff --git a/src/fd/atomic.cpp b/src/fd/atomic.cpp
index df200e6..ce9dff2 100644
--- a/src/fd/atomic.cpp
+++ b/src/fd/atomic.cpp
@@ -1,10 +1,12 @@
-#include <cstdlib>
-#include <filesystem>
#include <fmt/format.h>
+#include <sys/stat.h>
+
#include <stdplus/fd/atomic.hpp>
#include <stdplus/fd/managed.hpp>
#include <stdplus/util/cexec.hpp>
-#include <sys/stat.h>
+
+#include <cstdlib>
+#include <filesystem>
#include <system_error>
#include <utility>
@@ -16,8 +18,8 @@
static std::string makeTmpName(const std::filesystem::path& filename)
{
auto name = filename.filename();
- auto path =
- filename.parent_path() / fmt::format(".{}.XXXXXX", name.native());
+ auto path = filename.parent_path() /
+ fmt::format(".{}.XXXXXX", name.native());
return path.native();
}
@@ -38,8 +40,7 @@
mode(mode),
tmpname(!tmpl.empty() ? std::string(tmpl) : makeTmpName(filename)),
fd(mktemp(tmpname))
-{
-}
+{}
AtomicWriter::AtomicWriter(AtomicWriter&& other) :
filename(std::move(other.filename)), mode(other.mode),
diff --git a/src/fd/create.cpp b/src/fd/create.cpp
index 2240a98..bfef66f 100644
--- a/src/fd/create.cpp
+++ b/src/fd/create.cpp
@@ -1,8 +1,9 @@
#include <fcntl.h>
#include <fmt/format.h>
+#include <sys/socket.h>
+
#include <stdplus/fd/create.hpp>
#include <stdplus/util/cexec.hpp>
-#include <sys/socket.h>
namespace stdplus
{
diff --git a/src/fd/dupable.cpp b/src/fd/dupable.cpp
index ce2cff1..d096d04 100644
--- a/src/fd/dupable.cpp
+++ b/src/fd/dupable.cpp
@@ -1,7 +1,9 @@
#include <fcntl.h>
+
#include <stdplus/fd/dupable.hpp>
#include <stdplus/fd/ops.hpp>
#include <stdplus/util/cexec.hpp>
+
#include <utility>
namespace stdplus
@@ -18,13 +20,9 @@
} // namespace detail
-DupableFd::DupableFd() noexcept : handle(std::nullopt)
-{
-}
+DupableFd::DupableFd() noexcept : handle(std::nullopt) {}
-DupableFd::DupableFd(const int& fd) : handle(fd)
-{
-}
+DupableFd::DupableFd(const int& fd) : handle(fd) {}
DupableFd::DupableFd(int&& fd) : handle(std::move(fd))
{
diff --git a/src/fd/fmt.cpp b/src/fd/fmt.cpp
index 94d3bc1..1907ded 100644
--- a/src/fd/fmt.cpp
+++ b/src/fd/fmt.cpp
@@ -6,9 +6,7 @@
namespace fd
{
-FormatBuffer::FormatBuffer(Fd& fd, size_t max) : fd(fd), max(max)
-{
-}
+FormatBuffer::FormatBuffer(Fd& fd, size_t max) : fd(fd), max(max) {}
FormatBuffer::~FormatBuffer() noexcept(false)
{
diff --git a/src/fd/impl.cpp b/src/fd/impl.cpp
index 34b365f..1272fc8 100644
--- a/src/fd/impl.cpp
+++ b/src/fd/impl.cpp
@@ -1,13 +1,15 @@
#include <fcntl.h>
#include <fmt/format.h>
-#include <stdplus/exception.hpp>
-#include <stdplus/fd/impl.hpp>
-#include <stdplus/util/cexec.hpp>
-#include <string_view>
#include <sys/ioctl.h>
#include <sys/socket.h>
#include <unistd.h>
+#include <stdplus/exception.hpp>
+#include <stdplus/fd/impl.hpp>
+#include <stdplus/util/cexec.hpp>
+
+#include <string_view>
+
namespace stdplus
{
namespace fd
@@ -35,8 +37,8 @@
std::span<std::byte> FdImpl::recv(std::span<std::byte> buf, RecvFlags flags)
{
- ssize_t amt =
- ::recv(get(), buf.data(), buf.size(), static_cast<int>(flags));
+ ssize_t amt = ::recv(get(), buf.data(), buf.size(),
+ static_cast<int>(flags));
if (amt == -1)
{
if (errno == EAGAIN || errno == EWOULDBLOCK)
@@ -69,8 +71,8 @@
std::span<const std::byte> FdImpl::send(std::span<const std::byte> data,
SendFlags flags)
{
- ssize_t amt =
- ::send(get(), data.data(), data.size(), static_cast<int>(flags));
+ ssize_t amt = ::send(get(), data.data(), data.size(),
+ static_cast<int>(flags));
if (amt == -1)
{
if (errno == EAGAIN || errno == EWOULDBLOCK)
diff --git a/src/fd/line.cpp b/src/fd/line.cpp
index db12041..b3ce76a 100644
--- a/src/fd/line.cpp
+++ b/src/fd/line.cpp
@@ -1,16 +1,15 @@
-#include <cstring>
#include <stdplus/exception.hpp>
#include <stdplus/fd/line.hpp>
#include <stdplus/fd/ops.hpp>
+#include <cstring>
+
namespace stdplus
{
namespace fd
{
-LineReader::LineReader(Fd& fd) : fd(fd)
-{
-}
+LineReader::LineReader(Fd& fd) : fd(fd) {}
const std::string* LineReader::readLine()
{
diff --git a/src/fd/managed.cpp b/src/fd/managed.cpp
index 1b19284..cd4ec1c 100644
--- a/src/fd/managed.cpp
+++ b/src/fd/managed.cpp
@@ -1,9 +1,11 @@
#include <fmt/format.h>
+#include <unistd.h>
+
#include <stdplus/fd/dupable.hpp>
#include <stdplus/fd/managed.hpp>
#include <stdplus/fd/ops.hpp>
#include <stdplus/util/cexec.hpp>
-#include <unistd.h>
+
#include <utility>
namespace stdplus
@@ -20,9 +22,7 @@
} // namespace detail
-ManagedFd::ManagedFd() noexcept : handle(std::nullopt)
-{
-}
+ManagedFd::ManagedFd() noexcept : handle(std::nullopt) {}
ManagedFd::ManagedFd(int&& fd) : handle(std::move(fd))
{
@@ -31,12 +31,9 @@
ManagedFd::ManagedFd(DupableFd&& other) noexcept :
handle(static_cast<detail::ManagedFdHandle&&>(other.handle))
-{
-}
+{}
-ManagedFd::ManagedFd(const DupableFd& other) : ManagedFd(DupableFd(other))
-{
-}
+ManagedFd::ManagedFd(const DupableFd& other) : ManagedFd(DupableFd(other)) {}
ManagedFd& ManagedFd::operator=(DupableFd&& other) noexcept
{
diff --git a/src/fd/mmap.cpp b/src/fd/mmap.cpp
index 079815d..1f5c211 100644
--- a/src/fd/mmap.cpp
+++ b/src/fd/mmap.cpp
@@ -9,8 +9,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)
-{
-}
+{}
std::span<std::byte> MMap::get() const
{
diff --git a/src/fd/ops.cpp b/src/fd/ops.cpp
index d47dbb3..e8f3636 100644
--- a/src/fd/ops.cpp
+++ b/src/fd/ops.cpp
@@ -1,6 +1,8 @@
#include <fmt/format.h>
+
#include <stdplus/exception.hpp>
#include <stdplus/fd/ops.hpp>
+
#include <utility>
namespace stdplus
@@ -54,8 +56,8 @@
std::span<Byte> ret;
do
{
- auto r =
- (fd.*fun)(data.subspan(ret.size()), std::forward<Args>(args)...);
+ auto r = (fd.*fun)(data.subspan(ret.size()),
+ std::forward<Args>(args)...);
if (ret.size() != 0 && r.size() == 0)
{
throw exception::WouldBlock(
diff --git a/src/gtest/tmp.cpp b/src/gtest/tmp.cpp
index 07dfb6d..4d06de5 100644
--- a/src/gtest/tmp.cpp
+++ b/src/gtest/tmp.cpp
@@ -1,8 +1,9 @@
#include <fmt/format.h>
-#include <filesystem>
#include <stdplus/gtest/tmp.hpp>
+#include <filesystem>
+
namespace stdplus
{
namespace gtest
diff --git a/src/io_uring.cpp b/src/io_uring.cpp
index 0dec400..0e6a7b4 100644
--- a/src/io_uring.cpp
+++ b/src/io_uring.cpp
@@ -1,5 +1,4 @@
#include <liburing.h>
-
#include <sys/eventfd.h>
#include <stdplus/fd/managed.hpp>
@@ -45,8 +44,7 @@
IoUring::FileHandle::FileHandle(unsigned slot, IoUring& ring) :
slot(slot, &ring)
-{
-}
+{}
void IoUring::FileHandle::drop(unsigned&& slot, IoUring*& ring)
{
diff --git a/src/signal.cpp b/src/signal.cpp
index 525f2c0..3acba26 100644
--- a/src/signal.cpp
+++ b/src/signal.cpp
@@ -1,6 +1,8 @@
#include <signal.h>
+
#include <stdplus/signal.hpp>
#include <stdplus/util/cexec.hpp>
+
#include <system_error>
namespace stdplus