This commit is contained in:
parent
125a235dd1
commit
5ca7e2f226
@ -433,14 +433,14 @@ Error FileStoreTemplate<size_t>::resize() {
|
|||||||
template<typename size_t>
|
template<typename size_t>
|
||||||
Error FileStoreTemplate<size_t>::resize(std::size_t size, void *newBuff) {
|
Error FileStoreTemplate<size_t>::resize(std::size_t size, void *newBuff) {
|
||||||
if (m_buffer->size() > size) {
|
if (m_buffer->size() > size) {
|
||||||
return ox::Error(1);
|
return ox::Error{1, "new buffer is too small for existing data"};
|
||||||
}
|
}
|
||||||
m_buffSize = static_cast<size_t>(size);
|
m_buffSize = static_cast<size_t>(size);
|
||||||
if (newBuff) {
|
if (newBuff) {
|
||||||
m_buffer = reinterpret_cast<Buffer*>(newBuff);
|
m_buffer = static_cast<Buffer*>(newBuff);
|
||||||
OX_RETURN_ERROR(m_buffer->setSize(static_cast<size_t>(size)));
|
OX_RETURN_ERROR(m_buffer->setSize(static_cast<size_t>(size)));
|
||||||
}
|
}
|
||||||
return ox::Error(0);
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename size_t>
|
template<typename size_t>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user