diff --git a/libluna/include/luna/Buffer.h b/libluna/include/luna/Buffer.h index 6d6f89c0..554de586 100644 --- a/libluna/include/luna/Buffer.h +++ b/libluna/include/luna/Buffer.h @@ -19,7 +19,7 @@ class Buffer Result slice(usize offset, usize size); - Result append_data(u8* data, usize size); + Result append_data(const u8* data, usize size); u8* data() { diff --git a/libluna/include/luna/Result.h b/libluna/include/luna/Result.h index 265453bc..98765412 100644 --- a/libluna/include/luna/Result.h +++ b/libluna/include/luna/Result.h @@ -122,7 +122,7 @@ template class Result return m_value.try_move_value(ref); } - bool try_move_value_or_error(T& ref, int& err) const + bool try_move_value_or_error(T& ref, int& err) { bool ok = m_value.try_move_value(ref); if (!ok) err = m_error; diff --git a/libluna/src/Buffer.cpp b/libluna/src/Buffer.cpp index 6c385db5..b08bf35b 100644 --- a/libluna/src/Buffer.cpp +++ b/libluna/src/Buffer.cpp @@ -46,7 +46,7 @@ Result Buffer::slice(usize offset, usize size) return m_data + offset; } -Result Buffer::append_data(u8* data, usize size) +Result Buffer::append_data(const u8* data, usize size) { memcpy(TRY(slice_at_end(size)), data, size);