From: <sv...@op...> - 2024-10-26 18:36:26
|
Author: manx Date: Sat Oct 26 20:36:14 2024 New Revision: 21990 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=21990 Log: Merged revision(s) 21989 from trunk/OpenMPT: [Ref] mpt/io_write/buffer.hpp: Fix formatting which clang-format misses. ........ Modified: branches/OpenMPT-1.31/ (props changed) branches/OpenMPT-1.31/src/mpt/io_write/buffer.hpp Modified: branches/OpenMPT-1.31/src/mpt/io_write/buffer.hpp ============================================================================== --- branches/OpenMPT-1.31/src/mpt/io_write/buffer.hpp Sat Oct 26 20:33:42 2024 (r21989) +++ branches/OpenMPT-1.31/src/mpt/io_write/buffer.hpp Sat Oct 26 20:36:14 2024 (r21990) @@ -46,18 +46,17 @@ inline WriteBuffer(Tfile & f_, mpt::byte_span buffer_) : buffer(buffer_) , f(f_) { + return; } inline ~WriteBuffer() noexcept(false) { - if (!writeError) - { + if (!writeError) { FlushLocal(); } } public: inline Tfile & file() const { - if (IsDirty()) - { + if (IsDirty()) { FlushLocal(); } return f; @@ -84,30 +83,24 @@ } inline bool Write(mpt::const_byte_span data) { bool result = true; - for (std::size_t i = 0; i < data.size(); ++i) - { + for (std::size_t i = 0; i < data.size(); ++i) { buffer[size] = data[i]; size++; - if (IsFull()) - { + if (IsFull()) { FlushLocal(); } } return result; } inline void FlushLocal() { - if (IsClean()) - { + if (IsClean()) { return; } - try - { - if (!mpt::IO::WriteRaw(f, mpt::as_span(buffer.data(), size))) - { + try { + if (!mpt::IO::WriteRaw(f, mpt::as_span(buffer.data(), size))) { writeError = true; } - } catch (const std::exception &) - { + } catch (const std::exception &) { writeError = true; throw; } |