[ox/fs] Cleanup unnecessary reinterpret_casts

This commit is contained in:
Gary Talent 2022-02-10 02:02:44 -06:00
parent 0d368b3c02
commit 959f75d2db

View File

@ -173,16 +173,14 @@ class OX_PACKED NodeBuffer {
template<typename size_t, typename Item>
NodeBuffer<size_t, Item>::NodeBuffer(size_t size) noexcept {
m_header.size = size;
auto data = reinterpret_cast<uint8_t*>(this) + sizeof(*this);
ox_memset(data, 0, size - sizeof(*this));
ox_memset(this + 1, 0, size - sizeof(*this));
oxTrace("ox::NodeBuffer::constructor") << m_header.firstItem;
}
template<typename size_t, typename Item>
NodeBuffer<size_t, Item>::NodeBuffer(const NodeBuffer &other, size_t size) noexcept {
oxTracef("ox::ptrarith::NodeBuffer::copy", "other.m_header.firstItem: {}", other.m_header.firstItem.get());
auto data = reinterpret_cast<uint8_t*>(this) + sizeof(*this);
ox_memset(data, 0, size - sizeof(*this));
ox_memset(this + 1, 0, size - sizeof(*this));
ox_memcpy(this, &other, size);
}