1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-24 03:25:06 +00:00

AK: Make Vector use size_t for its size and capacity

This commit is contained in:
Andreas Kling 2020-02-25 14:49:47 +01:00
parent 9c6f7d3e7d
commit ceec1a7d38
94 changed files with 323 additions and 317 deletions

View file

@ -403,7 +403,7 @@ void Menu::event(Core::Event& event)
--m_hovered_item_index;
} while (hovered_item()->type() == MenuItem::Separator);
ASSERT(m_hovered_item_index >= 0 && m_hovered_item_index <= m_items.size() - 1);
ASSERT(m_hovered_item_index >= 0 && m_hovered_item_index <= static_cast<int>(m_items.size()) - 1);
if (is_scrollable() && m_hovered_item_index < m_scroll_offset)
--m_scroll_offset;
@ -415,17 +415,17 @@ void Menu::event(Core::Event& event)
if (key == Key_Down) {
ASSERT(m_items.at(0).type() != MenuItem::Separator);
if (is_scrollable() && m_hovered_item_index == m_items.size() - 1)
if (is_scrollable() && m_hovered_item_index == static_cast<int>(m_items.size()) - 1)
return;
do {
if (m_hovered_item_index == m_items.size() - 1)
if (m_hovered_item_index == static_cast<int>(m_items.size()) - 1)
m_hovered_item_index = 0;
else
++m_hovered_item_index;
} while (hovered_item()->type() == MenuItem::Separator);
ASSERT(m_hovered_item_index >= 0 && m_hovered_item_index <= m_items.size() - 1);
ASSERT(m_hovered_item_index >= 0 && m_hovered_item_index <= static_cast<int>(m_items.size()) - 1);
if (is_scrollable() && m_hovered_item_index >= (m_scroll_offset + visible_item_count()))
++m_scroll_offset;