diff options
author | Andreas Kling <kling@serenityos.org> | 2021-02-23 20:42:32 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-02-23 20:56:54 +0100 |
commit | 5d180d1f996ead27f9c5cb3db7f91e293de34d9d (patch) | |
tree | e881854dac5d749518562970d6194a0ef65736ec /AK/ByteBuffer.h | |
parent | b33a6a443e700cd80325d312f21c985b0687bb97 (diff) | |
download | serenity-5d180d1f996ead27f9c5cb3db7f91e293de34d9d.zip |
Everywhere: Rename ASSERT => VERIFY
(...and ASSERT_NOT_REACHED => VERIFY_NOT_REACHED)
Since all of these checks are done in release builds as well,
let's rename them to VERIFY to prevent confusion, as everyone is
used to assertions being compiled out in release.
We can introduce a new ASSERT macro that is specifically for debug
checks, but I'm doing this wholesale conversion first since we've
accumulated thousands of these already, and it's not immediately
obvious which ones are suitable for ASSERT.
Diffstat (limited to 'AK/ByteBuffer.h')
-rw-r--r-- | AK/ByteBuffer.h | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/AK/ByteBuffer.h b/AK/ByteBuffer.h index feabaeaa4c..65ba418f4a 100644 --- a/AK/ByteBuffer.h +++ b/AK/ByteBuffer.h @@ -54,12 +54,12 @@ public: u8& operator[](size_t i) { - ASSERT(i < m_size); + VERIFY(i < m_size); return m_data[i]; } const u8& operator[](size_t i) const { - ASSERT(i < m_size); + VERIFY(i < m_size); return m_data[i]; } bool is_empty() const { return !m_size; } @@ -83,7 +83,7 @@ public: // NOTE: trim() does not reallocate. void trim(size_t size) { - ASSERT(size <= m_size); + VERIFY(size <= m_size); m_size = size; } @@ -145,12 +145,12 @@ public: u8& operator[](size_t i) { - ASSERT(m_impl); + VERIFY(m_impl); return (*m_impl)[i]; } u8 operator[](size_t i) const { - ASSERT(m_impl); + VERIFY(m_impl); return (*m_impl)[i]; } bool is_empty() const { return !m_impl || m_impl->is_empty(); } @@ -215,7 +215,7 @@ public: return {}; // I cannot hand you a slice I don't have - ASSERT(offset + size <= this->size()); + VERIFY(offset + size <= this->size()); return copy(offset_pointer(offset), size); } @@ -232,7 +232,7 @@ public: { if (data_size == 0) return; - ASSERT(data != nullptr); + VERIFY(data != nullptr); int old_size = size(); grow(size() + data_size); __builtin_memcpy(this->data() + old_size, data, data_size); @@ -246,7 +246,7 @@ public: void overwrite(size_t offset, const void* data, size_t data_size) { // make sure we're not told to write past the end - ASSERT(offset + data_size <= size()); + VERIFY(offset + data_size <= size()); __builtin_memcpy(this->data() + offset, data, data_size); } @@ -285,7 +285,7 @@ inline ByteBufferImpl::ByteBufferImpl(const void* data, size_t size) inline void ByteBufferImpl::grow(size_t size) { - ASSERT(size > m_size); + VERIFY(size > m_size); if (size == 0) { if (m_data) kfree(m_data); |