1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 13:37:45 +00:00

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.
This commit is contained in:
Andreas Kling 2021-02-23 20:42:32 +01:00
parent b33a6a443e
commit 5d180d1f99
725 changed files with 3448 additions and 3448 deletions

View file

@ -45,7 +45,7 @@ Cmap::Subtable::Platform Cmap::Subtable::platform_id() const
case 4:
return Platform::Custom;
default:
ASSERT_NOT_REACHED();
VERIFY_NOT_REACHED();
}
}
@ -71,7 +71,7 @@ Cmap::Subtable::Format Cmap::Subtable::format() const
case 14:
return Format::UnicodeVariationSequences;
default:
ASSERT_NOT_REACHED();
VERIFY_NOT_REACHED();
}
}
@ -89,7 +89,7 @@ Optional<Cmap::Subtable> Cmap::subtable(u32 index) const
u16 platform_id = be_u16(m_slice.offset_pointer(record_offset));
u16 encoding_id = be_u16(m_slice.offset_pointer(record_offset + (u32)Offsets::EncodingRecord_EncodingID));
u32 subtable_offset = be_u32(m_slice.offset_pointer(record_offset + (u32)Offsets::EncodingRecord_Offset));
ASSERT(subtable_offset < m_slice.size());
VERIFY(subtable_offset < m_slice.size());
auto subtable_slice = ReadonlyBytes(m_slice.offset_pointer(subtable_offset), m_slice.size() - subtable_offset);
return Subtable(subtable_slice, platform_id, encoding_id);
}
@ -128,7 +128,7 @@ u32 Cmap::Subtable::glyph_id_for_codepoint_table_4(u32 codepoint) const
return (codepoint + delta) & 0xffff;
}
u32 glyph_offset = (u32)Table4Offsets::GlyphOffsetConstBase + segcount_x2 * 3 + offset + range + (codepoint - start_codepoint) * 2;
ASSERT(glyph_offset + 2 <= m_slice.size());
VERIFY(glyph_offset + 2 <= m_slice.size());
return (be_u16(m_slice.offset_pointer(glyph_offset)) + delta) & 0xffff;
}
return 0;
@ -137,7 +137,7 @@ u32 Cmap::Subtable::glyph_id_for_codepoint_table_4(u32 codepoint) const
u32 Cmap::Subtable::glyph_id_for_codepoint_table_12(u32 codepoint) const
{
u32 num_groups = be_u32(m_slice.offset_pointer((u32)Table12Offsets::NumGroups));
ASSERT(m_slice.size() >= (u32)Table12Sizes::Header + (u32)Table12Sizes::Record * num_groups);
VERIFY(m_slice.size() >= (u32)Table12Sizes::Header + (u32)Table12Sizes::Record * num_groups);
for (u32 offset = 0; offset < num_groups * (u32)Table12Sizes::Record; offset += (u32)Table12Sizes::Record) {
u32 start_codepoint = be_u32(m_slice.offset_pointer((u32)Table12Offsets::Record_StartCode + offset));
if (codepoint < start_codepoint) {