[ox/mc] Make read take const buffers

(synced from 394d13df9b)
This commit is contained in:
2021-04-17 16:37:58 -05:00
parent 6b2b15f47d
commit e5126436da
5 changed files with 9 additions and 8 deletions
+3 -3
View File
@@ -31,11 +31,11 @@ class MetalClawReader {
int m_unionIdx = -1;
std::size_t m_buffIt = 0;
std::size_t m_buffLen = 0;
uint8_t *m_buff = nullptr;
const uint8_t *m_buff = nullptr;
MetalClawReader *m_parent = nullptr;
public:
MetalClawReader(uint8_t *buff, std::size_t buffLen, int unionIdx = -1, MetalClawReader *parent = nullptr) noexcept;
MetalClawReader(const uint8_t *buff, std::size_t buffLen, int unionIdx = -1, MetalClawReader *parent = nullptr) noexcept;
~MetalClawReader() noexcept;
@@ -273,7 +273,7 @@ void MetalClawReader::setTypeInfo(const char*, int fields) {
}
template<typename T>
Error readMC(uint8_t *buff, std::size_t buffLen, T *val) {
Error readMC(const uint8_t *buff, std::size_t buffLen, T *val) {
MetalClawReader reader(buff, buffLen);
return model(&reader, val);
}