Const correctness of ZoneStackBase::Block::data()

The C-style cast was discarding const and casting to `(uint8_t *)` at
the same time, causing a warning. Add const and non-const versions of
the method.
This commit is contained in:
Tzvetan Mikov
2024-08-25 22:36:25 -07:00
committed by GitHub
parent 9b28f627a5
commit 67847228e7

View File

@@ -62,7 +62,9 @@ public:
ASMJIT_INLINE_NODEBUG void setEnd(T* end) noexcept { _end = (void*)end; }
template<typename T>
ASMJIT_INLINE_NODEBUG T* data() const noexcept { return (T*)((uint8_t*)(this) + sizeof(Block)); }
ASMJIT_INLINE_NODEBUG const T* data() const noexcept { return (const T*)((const uint8_t*)(this) + sizeof(Block)); }
template<typename T>
ASMJIT_INLINE_NODEBUG T* data() noexcept { return (T*)((uint8_t*)(this) + sizeof(Block)); }
template<typename T>
ASMJIT_INLINE_NODEBUG bool canPrepend() const noexcept { return _start > data<void>(); }