mirror of
https://github.com/asmjit/asmjit.git
synced 2025-12-17 04:24:37 +03:00
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:
@@ -62,7 +62,9 @@ public:
|
|||||||
ASMJIT_INLINE_NODEBUG void setEnd(T* end) noexcept { _end = (void*)end; }
|
ASMJIT_INLINE_NODEBUG void setEnd(T* end) noexcept { _end = (void*)end; }
|
||||||
|
|
||||||
template<typename T>
|
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>
|
template<typename T>
|
||||||
ASMJIT_INLINE_NODEBUG bool canPrepend() const noexcept { return _start > data<void>(); }
|
ASMJIT_INLINE_NODEBUG bool canPrepend() const noexcept { return _start > data<void>(); }
|
||||||
|
|||||||
Reference in New Issue
Block a user