diff options
author | Rubidium <rubidium@openttd.org> | 2021-05-10 23:43:52 +0200 |
---|---|---|
committer | rubidium42 <rubidium42@users.noreply.github.com> | 2021-05-15 10:16:10 +0200 |
commit | bb9121dbd4690405b54e7e6ed6e711ead16435ac (patch) | |
tree | efb930ab320c6be74d4ca8e4d5d674e3d1e7812d /src/depot_gui.cpp | |
parent | 031e91de6e06e6b0d12603d78170f92f5def1d00 (diff) | |
download | openttd-bb9121dbd4690405b54e7e6ed6e711ead16435ac.tar.xz |
Fix: comparison of narrow type to wide type in loop (potential for infinite loops)
Diffstat (limited to 'src/depot_gui.cpp')
-rw-r--r-- | src/depot_gui.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/depot_gui.cpp b/src/depot_gui.cpp index 8c018b73d..0756eae2c 100644 --- a/src/depot_gui.cpp +++ b/src/depot_gui.cpp @@ -395,11 +395,11 @@ struct DepotWindow : Window { uint16 rows_in_display = wid->current_y / wid->resize_y; - uint16 num = this->vscroll->GetPosition() * this->num_columns; + uint num = this->vscroll->GetPosition() * this->num_columns; uint maxval = static_cast<uint>(std::min<size_t>(this->vehicle_list.size(), num + (rows_in_display * this->num_columns))); int y; for (y = r.top + 1; num < maxval; y += this->resize.step_height) { // Draw the rows - for (byte i = 0; i < this->num_columns && num < maxval; i++, num++) { + for (uint i = 0; i < this->num_columns && num < maxval; i++, num++) { /* Draw all vehicles in the current row */ const Vehicle *v = this->vehicle_list[num]; if (this->num_columns == 1) { |