1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 19:47:34 +00:00

AK+Everywhere: Change int to size_t in JsonObject and JsonArray

This commit is contained in:
Max Wipfli 2021-06-28 11:57:37 +02:00 committed by Andreas Kling
parent 66526cbbaf
commit f45273649f
9 changed files with 14 additions and 14 deletions

View file

@ -58,7 +58,7 @@ void CommonLocationsProvider::load_from_json(const String& json_path)
s_common_locations.clear();
auto contents = json.value().as_array();
for (auto i = 0; i < contents.size(); ++i) {
for (size_t i = 0; i < contents.size(); ++i) {
auto entry_value = contents.at(i);
if (!entry_value.is_object())
continue;

View file

@ -59,7 +59,7 @@ bool JsonArrayModel::set(int row, Vector<JsonValue>&& values)
{
VERIFY(values.size() == m_fields.size());
if (row >= m_array.size())
if ((size_t)row >= m_array.size())
return false;
JsonObject obj;
@ -76,12 +76,12 @@ bool JsonArrayModel::set(int row, Vector<JsonValue>&& values)
bool JsonArrayModel::remove(int row)
{
if (row >= m_array.size())
if ((size_t)row >= m_array.size())
return false;
JsonArray new_array;
for (int i = 0; i < m_array.size(); ++i)
if (i != row)
for (size_t i = 0; i < m_array.size(); ++i)
if (i != (size_t)row)
new_array.append(m_array.at(i));
m_array = new_array;

View file

@ -74,7 +74,7 @@ Vector<u32> CharacterMapFile::read_map(const JsonObject& json, const String& nam
buffer.resize(CHAR_MAP_SIZE);
auto map_arr = json.get(name).as_array();
for (int i = 0; i < map_arr.size(); i++) {
for (size_t i = 0; i < map_arr.size(); i++) {
auto key_value = map_arr.at(i).as_string();
if (key_value.length() == 0) {
buffer[i] = 0;