diff --git a/luna/include/luna/Bitmap.h b/luna/include/luna/Bitmap.h index 3260853d..463c88e5 100644 --- a/luna/include/luna/Bitmap.h +++ b/luna/include/luna/Bitmap.h @@ -11,25 +11,25 @@ class Bitmap void* move(void* new_location, usize new_location_size_in_bytes); void set(usize index, bool value); - bool get(usize index); + bool get(usize index) const; // size() returns size in bits! If you want the size in bytes, call size_in_bytes(). - usize size() + usize size() const { return m_size_in_bytes * 8; } - usize size_in_bytes() + usize size_in_bytes() const { return m_size_in_bytes; } - void* location() + void* location() const { return (void*)m_location; } - bool initialized() + bool initialized() const { return m_location; } diff --git a/luna/src/Bitmap.cpp b/luna/src/Bitmap.cpp index e130d191..f7b91156 100644 --- a/luna/src/Bitmap.cpp +++ b/luna/src/Bitmap.cpp @@ -42,7 +42,7 @@ void Bitmap::set(usize index, bool value) if (value) { m_location[byte_index] |= bit_mask; } } -bool Bitmap::get(usize index) +bool Bitmap::get(usize index) const { expect(initialized(), "Bitmap was never initialized"); expect(index < size(), "Bitmap access out of range");