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: I61c7e22e726dbab6c7f3da43270adbdb9b4927fb
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
diff --git a/src/pci_handler.cpp b/src/pci_handler.cpp
index 368b403..0936032 100644
--- a/src/pci_handler.cpp
+++ b/src/pci_handler.cpp
@@ -18,8 +18,7 @@
PciDataHandler::PciDataHandler(uint32_t regionAddress, size_t regionSize,
std::unique_ptr<stdplus::fd::Fd> fd) :
- regionSize(regionSize),
- fd(std::move(fd)),
+ regionSize(regionSize), fd(std::move(fd)),
mmap(stdplus::fd::MMap(
*this->fd, regionSize, stdplus::fd::ProtFlags{PROT_READ | PROT_WRITE},
stdplus::fd::MMapFlags{stdplus::fd::MMapAccess::Shared}, regionAddress))
@@ -38,8 +37,8 @@
}
// Read up to regionSize in case the offset + length overflowed
- uint32_t finalLength = (offset + length < regionSize) ? length
- : regionSize - offset;
+ uint32_t finalLength =
+ (offset + length < regionSize) ? length : regionSize - offset;
std::vector<uint8_t> results(finalLength);
std::memcpy(results.data(), mmap.get().data() + offset, finalLength);
@@ -60,8 +59,8 @@
}
// Write up to regionSize in case the offset + length overflowed
- uint16_t finalLength = (offset + length < regionSize) ? length
- : regionSize - offset;
+ uint16_t finalLength =
+ (offset + length < regionSize) ? length : regionSize - offset;
std::memcpy(mmap.get().data() + offset, bytes.data(), finalLength);
return finalLength;
}