Fix: conversion to smaller type warnings

This commit is contained in:
Rubidium
2023-05-03 06:05:07 +02:00
committed by rubidium42
parent 97b77f0251
commit 4a5a9f57c4
6 changed files with 21 additions and 16 deletions

View File

@@ -432,7 +432,7 @@ public:
case WID_STL_LIST: {
bool rtl = _current_text_dir == TD_RTL;
int max = std::min<size_t>(this->vscroll->GetPosition() + this->vscroll->GetCapacity(), this->stations.size());
size_t max = std::min<size_t>(this->vscroll->GetPosition() + this->vscroll->GetCapacity(), this->stations.size());
Rect tr = r.Shrink(WidgetDimensions::scaled.framerect);
uint line_height = this->GetWidget<NWidgetBase>(widget)->resize_y;
/* Spacing between station name and first rating graph. */
@@ -440,7 +440,7 @@ public:
/* Spacing between additional rating graphs. */
int rating_spacing = WidgetDimensions::scaled.hsep_normal;
for (int i = this->vscroll->GetPosition(); i < max; ++i) { // do until max number of stations of owner
for (size_t i = this->vscroll->GetPosition(); i < max; ++i) { // do until max number of stations of owner
const Station *st = this->stations[i];
assert(st->xy != INVALID_TILE);