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 /Userland/Libraries/LibWeb/SVG/SVGPathElement.cpp | |
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 'Userland/Libraries/LibWeb/SVG/SVGPathElement.cpp')
-rw-r--r-- | Userland/Libraries/LibWeb/SVG/SVGPathElement.cpp | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/Userland/Libraries/LibWeb/SVG/SVGPathElement.cpp b/Userland/Libraries/LibWeb/SVG/SVGPathElement.cpp index f812d42dfc..07773c0f72 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGPathElement.cpp +++ b/Userland/Libraries/LibWeb/SVG/SVGPathElement.cpp @@ -38,7 +38,7 @@ namespace Web::SVG { static void print_instruction(const PathInstruction& instruction) { - ASSERT(PATH_DEBUG); + VERIFY(PATH_DEBUG); auto& data = instruction.data; @@ -115,7 +115,7 @@ Vector<PathInstruction> PathDataParser::parse() while (!done()) parse_drawto(); if (!m_instructions.is_empty() && m_instructions[0].type != PathInstructionType::Move) - ASSERT_NOT_REACHED(); + VERIFY_NOT_REACHED(); return m_instructions; } @@ -348,7 +348,7 @@ void PathDataParser::parse_whitespace(bool must_match_once) matched = true; } - ASSERT(!must_match_once || matched); + VERIFY(!must_match_once || matched); } void PathDataParser::parse_comma_whitespace() @@ -379,7 +379,7 @@ float PathDataParser::parse_fractional_constant() while (!done() && isdigit(ch())) builder.append(consume()); } else { - ASSERT(builder.length() > 0); + VERIFY(builder.length() > 0); } if (floating_point) @@ -398,7 +398,7 @@ float PathDataParser::parse_number() float PathDataParser::parse_flag() { if (!match('0') && !match('1')) - ASSERT_NOT_REACHED(); + VERIFY_NOT_REACHED(); return consume() - '0'; } @@ -475,7 +475,7 @@ Gfx::Path& SVGPathElement::get_path() if (absolute) { path.move_to(point); } else { - ASSERT(!path.segments().is_empty()); + VERIFY(!path.segments().is_empty()); path.move_to(point + path.segments().last().point()); } break; @@ -488,13 +488,13 @@ Gfx::Path& SVGPathElement::get_path() if (absolute) { path.line_to(point); } else { - ASSERT(!path.segments().is_empty()); + VERIFY(!path.segments().is_empty()); path.line_to(point + path.segments().last().point()); } break; } case PathInstructionType::HorizontalLine: { - ASSERT(!path.segments().is_empty()); + VERIFY(!path.segments().is_empty()); auto last_point = path.segments().last().point(); if (absolute) { path.line_to(Gfx::FloatPoint { data[0], last_point.y() }); @@ -504,7 +504,7 @@ Gfx::Path& SVGPathElement::get_path() break; } case PathInstructionType::VerticalLine: { - ASSERT(!path.segments().is_empty()); + VERIFY(!path.segments().is_empty()); auto last_point = path.segments().last().point(); if (absolute) { path.line_to(Gfx::FloatPoint { last_point.x(), data[0] }); @@ -610,7 +610,7 @@ Gfx::Path& SVGPathElement::get_path() path.quadratic_bezier_curve_to(through, point); m_previous_control_point = through; } else { - ASSERT(!path.segments().is_empty()); + VERIFY(!path.segments().is_empty()); auto last_point = path.segments().last().point(); auto control_point = through + last_point; path.quadratic_bezier_curve_to(control_point, point + last_point); @@ -621,7 +621,7 @@ Gfx::Path& SVGPathElement::get_path() case PathInstructionType::SmoothQuadraticBezierCurve: { clear_last_control_point = false; - ASSERT(!path.segments().is_empty()); + VERIFY(!path.segments().is_empty()); auto last_point = path.segments().last().point(); if (m_previous_control_point.is_null()) { @@ -650,7 +650,7 @@ Gfx::Path& SVGPathElement::get_path() // with these path instructions, let's just skip them continue; case PathInstructionType::Invalid: - ASSERT_NOT_REACHED(); + VERIFY_NOT_REACHED(); } if (clear_last_control_point) { |