1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 01:17:34 +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

@ -109,7 +109,7 @@ u32 CanonicalCode::read_symbol(InputBitStream& stream) const
for (;;) {
code_bits = code_bits << 1 | stream.read_bits(1);
ASSERT(code_bits < (1 << 16));
VERIFY(code_bits < (1 << 16));
// FIXME: This is very inefficient and could greatly be improved by implementing this
// algorithm: https://www.hanshq.net/zip.html#huffdec
@ -273,7 +273,7 @@ size_t DeflateDecompressor::read(Bytes bytes)
return nread + read(bytes.slice(nread));
}
ASSERT_NOT_REACHED();
VERIFY_NOT_REACHED();
}
bool DeflateDecompressor::read_or_error(Bytes bytes)
@ -338,7 +338,7 @@ u32 DeflateDecompressor::decode_length(u32 symbol)
if (symbol == 285)
return 258;
ASSERT_NOT_REACHED();
VERIFY_NOT_REACHED();
}
u32 DeflateDecompressor::decode_distance(u32 symbol)
@ -353,7 +353,7 @@ u32 DeflateDecompressor::decode_distance(u32 symbol)
return ((symbol % 2 + 2) << extra_bits) + 1 + m_input_stream.read_bits(extra_bits);
}
ASSERT_NOT_REACHED();
VERIFY_NOT_REACHED();
}
void DeflateDecompressor::decode_codes(CanonicalCode& literal_code, Optional<CanonicalCode>& distance_code)
@ -401,7 +401,7 @@ void DeflateDecompressor::decode_codes(CanonicalCode& literal_code, Optional<Can
code_lengths.append(0);
continue;
} else {
ASSERT(symbol == 16);
VERIFY(symbol == 16);
if (code_lengths.is_empty()) {
set_fatal_error();