From 3c54344825cf38a9aa02842a43b42c7bf45015ec Mon Sep 17 00:00:00 2001 From: Rubidium Date: Mon, 2 Jan 2023 22:51:21 +0100 Subject: [PATCH] Fix: comparison of narrow type with wide type in loop condition Technically this can't be triggered with the currently returned values though. --- src/saveload/station_sl.cpp | 2 +- src/saveload/town_sl.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/saveload/station_sl.cpp b/src/saveload/station_sl.cpp index b5f4cbcd13..7a0b57d67d 100644 --- a/src/saveload/station_sl.cpp +++ b/src/saveload/station_sl.cpp @@ -392,7 +392,7 @@ public: } size_t num_cargo = this->GetNumCargo(); - for (CargoID i = 0; i < num_cargo; i++) { + for (size_t i = 0; i < num_cargo; i++) { GoodsEntry *ge = &st->goods[i]; SlObject(ge, this->GetLoadDescription()); if (IsSavegameVersionBefore(SLV_183)) { diff --git a/src/saveload/town_sl.cpp b/src/saveload/town_sl.cpp index 7b91259171..2ba0b9963e 100644 --- a/src/saveload/town_sl.cpp +++ b/src/saveload/town_sl.cpp @@ -148,7 +148,7 @@ public: void Load(Town *t) const override { size_t num_cargo = this->GetNumCargo(); - for (CargoID i = 0; i < num_cargo; i++) { + for (size_t i = 0; i < num_cargo; i++) { SlObject(&t->supplied[i], this->GetLoadDescription()); } }