mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 10:47:35 +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:
parent
b33a6a443e
commit
5d180d1f99
725 changed files with 3448 additions and 3448 deletions
|
@ -55,7 +55,7 @@ static float color_distance_squared(const Gfx::Color& lhs, const Gfx::Color& rhs
|
|||
|
||||
static void flood_fill(Gfx::Bitmap& bitmap, const Gfx::IntPoint& start_position, Color target_color, Color fill_color, int threshold)
|
||||
{
|
||||
ASSERT(bitmap.bpp() == 32);
|
||||
VERIFY(bitmap.bpp() == 32);
|
||||
|
||||
if (target_color == fill_color)
|
||||
return;
|
||||
|
|
|
@ -50,7 +50,7 @@ void EllipseTool::draw_using(GUI::Painter& painter, const Gfx::IntRect& ellipse_
|
|||
painter.draw_ellipse_intersecting(ellipse_intersecting_rect, m_editor->color_for(m_drawing_button), m_thickness);
|
||||
break;
|
||||
default:
|
||||
ASSERT_NOT_REACHED();
|
||||
VERIFY_NOT_REACHED();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -168,7 +168,7 @@ void Image::export_png(const String& file_path)
|
|||
void Image::add_layer(NonnullRefPtr<Layer> layer)
|
||||
{
|
||||
for (auto& existing_layer : m_layers) {
|
||||
ASSERT(&existing_layer != layer.ptr());
|
||||
VERIFY(&existing_layer != layer.ptr());
|
||||
}
|
||||
m_layers.append(move(layer));
|
||||
|
||||
|
@ -206,7 +206,7 @@ size_t Image::index_of(const Layer& layer) const
|
|||
if (&m_layers.at(i) == &layer)
|
||||
return i;
|
||||
}
|
||||
ASSERT_NOT_REACHED();
|
||||
VERIFY_NOT_REACHED();
|
||||
}
|
||||
|
||||
void Image::move_layer_to_back(Layer& layer)
|
||||
|
@ -255,8 +255,8 @@ void Image::move_layer_up(Layer& layer)
|
|||
|
||||
void Image::change_layer_index(size_t old_index, size_t new_index)
|
||||
{
|
||||
ASSERT(old_index < m_layers.size());
|
||||
ASSERT(new_index < m_layers.size());
|
||||
VERIFY(old_index < m_layers.size());
|
||||
VERIFY(new_index < m_layers.size());
|
||||
auto layer = m_layers.take(old_index);
|
||||
m_layers.insert(new_index, move(layer));
|
||||
did_modify_layer_stack();
|
||||
|
@ -290,13 +290,13 @@ void Image::select_layer(Layer* layer)
|
|||
|
||||
void Image::add_client(ImageClient& client)
|
||||
{
|
||||
ASSERT(!m_clients.contains(&client));
|
||||
VERIFY(!m_clients.contains(&client));
|
||||
m_clients.set(&client);
|
||||
}
|
||||
|
||||
void Image::remove_client(ImageClient& client)
|
||||
{
|
||||
ASSERT(m_clients.contains(&client));
|
||||
VERIFY(m_clients.contains(&client));
|
||||
m_clients.remove(&client);
|
||||
}
|
||||
|
||||
|
|
|
@ -341,7 +341,7 @@ Color ImageEditor::color_for(GUI::MouseButton button) const
|
|||
return m_primary_color;
|
||||
if (button == GUI::MouseButton::Right)
|
||||
return m_secondary_color;
|
||||
ASSERT_NOT_REACHED();
|
||||
VERIFY_NOT_REACHED();
|
||||
}
|
||||
|
||||
Color ImageEditor::color_for(const GUI::MouseEvent& event) const
|
||||
|
@ -350,7 +350,7 @@ Color ImageEditor::color_for(const GUI::MouseEvent& event) const
|
|||
return m_primary_color;
|
||||
if (event.buttons() & GUI::MouseButton::Right)
|
||||
return m_secondary_color;
|
||||
ASSERT_NOT_REACHED();
|
||||
VERIFY_NOT_REACHED();
|
||||
}
|
||||
|
||||
void ImageEditor::set_primary_color(Color color)
|
||||
|
|
|
@ -161,7 +161,7 @@ void LayerListWidget::mousemove_event(GUI::MouseEvent& event)
|
|||
|
||||
auto delta = event.position() - m_moving_event_origin;
|
||||
auto& gadget = m_gadgets[m_moving_gadget_index.value()];
|
||||
ASSERT(gadget.is_moving);
|
||||
VERIFY(gadget.is_moving);
|
||||
gadget.movement_delta = delta;
|
||||
relayout_gadgets();
|
||||
}
|
||||
|
@ -221,7 +221,7 @@ static constexpr int vertical_step = gadget_height + gadget_spacing;
|
|||
|
||||
size_t LayerListWidget::hole_index_during_move() const
|
||||
{
|
||||
ASSERT(is_moving_gadget());
|
||||
VERIFY(is_moving_gadget());
|
||||
auto& moving_gadget = m_gadgets[m_moving_gadget_index.value()];
|
||||
int center_y_of_moving_gadget = moving_gadget.rect.translated(0, moving_gadget.movement_delta.y()).center().y();
|
||||
return center_y_of_moving_gadget / vertical_step;
|
||||
|
|
|
@ -56,7 +56,7 @@ void RectangleTool::draw_using(GUI::Painter& painter, const Gfx::IntRect& rect)
|
|||
painter.fill_rect_with_gradient(rect, m_editor->primary_color(), m_editor->secondary_color());
|
||||
break;
|
||||
default:
|
||||
ASSERT_NOT_REACHED();
|
||||
VERIFY_NOT_REACHED();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -66,7 +66,7 @@ void SprayTool::paint_it()
|
|||
|
||||
auto& bitmap = layer->bitmap();
|
||||
GUI::Painter painter(bitmap);
|
||||
ASSERT(bitmap.bpp() == 32);
|
||||
VERIFY(bitmap.bpp() == 32);
|
||||
m_editor->update();
|
||||
const double minimal_radius = 2;
|
||||
const double base_radius = minimal_radius * m_thickness;
|
||||
|
|
|
@ -201,7 +201,7 @@ int main(int argc, char** argv)
|
|||
|
||||
auto& edit_menu = menubar->add_menu("Edit");
|
||||
auto paste_action = GUI::CommonActions::make_paste_action([&](auto&) {
|
||||
ASSERT(image_editor.image());
|
||||
VERIFY(image_editor.image());
|
||||
auto bitmap = GUI::Clipboard::the().bitmap();
|
||||
if (!bitmap)
|
||||
return;
|
||||
|
@ -217,13 +217,13 @@ int main(int argc, char** argv)
|
|||
edit_menu.add_action(paste_action);
|
||||
|
||||
auto undo_action = GUI::CommonActions::make_undo_action([&](auto&) {
|
||||
ASSERT(image_editor.image());
|
||||
VERIFY(image_editor.image());
|
||||
image_editor.undo();
|
||||
});
|
||||
edit_menu.add_action(undo_action);
|
||||
|
||||
auto redo_action = GUI::CommonActions::make_redo_action([&](auto&) {
|
||||
ASSERT(image_editor.image());
|
||||
VERIFY(image_editor.image());
|
||||
image_editor.redo();
|
||||
});
|
||||
edit_menu.add_action(redo_action);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue