summaryrefslogtreecommitdiff
path: root/src/group_gui.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/group_gui.cpp')
-rw-r--r--src/group_gui.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/group_gui.cpp b/src/group_gui.cpp
index 8ef6a2a1b..2ab2a5b51 100644
--- a/src/group_gui.cpp
+++ b/src/group_gui.cpp
@@ -205,14 +205,14 @@ private:
this->tiny_step_height = this->column_size[VGC_FOLD].height;
this->column_size[VGC_NAME] = maxdim(GetStringBoundingBox(STR_GROUP_DEFAULT_TRAINS + this->vli.vtype), GetStringBoundingBox(STR_GROUP_ALL_TRAINS + this->vli.vtype));
- this->column_size[VGC_NAME].width = max(170u, this->column_size[VGC_NAME].width);
- this->tiny_step_height = max(this->tiny_step_height, this->column_size[VGC_NAME].height);
+ this->column_size[VGC_NAME].width = std::max(170u, this->column_size[VGC_NAME].width);
+ this->tiny_step_height = std::max(this->tiny_step_height, this->column_size[VGC_NAME].height);
this->column_size[VGC_PROTECT] = GetSpriteSize(SPR_GROUP_REPLACE_PROTECT);
- this->tiny_step_height = max(this->tiny_step_height, this->column_size[VGC_PROTECT].height);
+ this->tiny_step_height = std::max(this->tiny_step_height, this->column_size[VGC_PROTECT].height);
this->column_size[VGC_AUTOREPLACE] = GetSpriteSize(SPR_GROUP_REPLACE_ACTIVE);
- this->tiny_step_height = max(this->tiny_step_height, this->column_size[VGC_AUTOREPLACE].height);
+ this->tiny_step_height = std::max(this->tiny_step_height, this->column_size[VGC_AUTOREPLACE].height);
this->column_size[VGC_PROFIT].width = 0;
this->column_size[VGC_PROFIT].height = 0;
@@ -221,13 +221,13 @@ private:
Dimension d = GetSpriteSize(profit_sprites[i]);
this->column_size[VGC_PROFIT] = maxdim(this->column_size[VGC_PROFIT], d);
}
- this->tiny_step_height = max(this->tiny_step_height, this->column_size[VGC_PROFIT].height);
+ this->tiny_step_height = std::max(this->tiny_step_height, this->column_size[VGC_PROFIT].height);
int num_vehicle = GetGroupNumVehicle(this->vli.company, ALL_GROUP, this->vli.vtype);
SetDParamMaxValue(0, num_vehicle, 3, FS_SMALL);
SetDParamMaxValue(1, num_vehicle, 3, FS_SMALL);
this->column_size[VGC_NUMBER] = GetStringBoundingBox(STR_GROUP_COUNT_WITH_SUBGROUP);
- this->tiny_step_height = max(this->tiny_step_height, this->column_size[VGC_NUMBER].height);
+ this->tiny_step_height = std::max(this->tiny_step_height, this->column_size[VGC_NUMBER].height);
this->tiny_step_height += WD_MATRIX_TOP;
@@ -390,9 +390,9 @@ public:
/* ... minus the buttons at the bottom ... */
uint max_icon_height = GetSpriteSize(this->GetWidget<NWidgetCore>(WID_GL_CREATE_GROUP)->widget_data).height;
- max_icon_height = max(max_icon_height, GetSpriteSize(this->GetWidget<NWidgetCore>(WID_GL_RENAME_GROUP)->widget_data).height);
- max_icon_height = max(max_icon_height, GetSpriteSize(this->GetWidget<NWidgetCore>(WID_GL_DELETE_GROUP)->widget_data).height);
- max_icon_height = max(max_icon_height, GetSpriteSize(this->GetWidget<NWidgetCore>(WID_GL_REPLACE_PROTECTION)->widget_data).height);
+ max_icon_height = std::max(max_icon_height, GetSpriteSize(this->GetWidget<NWidgetCore>(WID_GL_RENAME_GROUP)->widget_data).height);
+ max_icon_height = std::max(max_icon_height, GetSpriteSize(this->GetWidget<NWidgetCore>(WID_GL_DELETE_GROUP)->widget_data).height);
+ max_icon_height = std::max(max_icon_height, GetSpriteSize(this->GetWidget<NWidgetCore>(WID_GL_REPLACE_PROTECTION)->widget_data).height);
/* ... minus the height of the group info ... */
max_icon_height += (FONT_HEIGHT_NORMAL * 3) + WD_FRAMERECT_TOP + WD_FRAMERECT_BOTTOM;
@@ -601,7 +601,7 @@ public:
case WID_GL_LIST_GROUP: {
int y1 = r.top + WD_FRAMERECT_TOP;
- int max = min(this->group_sb->GetPosition() + this->group_sb->GetCapacity(), (uint)this->groups.size());
+ int max = std::min<size_t>(this->group_sb->GetPosition() + this->group_sb->GetCapacity(), this->groups.size());
for (int i = this->group_sb->GetPosition(); i < max; ++i) {
const Group *g = this->groups[i];
@@ -625,7 +625,7 @@ public:
if (this->vli.index != ALL_GROUP && this->grouping == GB_NONE) {
/* Mark vehicles which are in sub-groups (only if we are not using shared order coalescing) */
int y = r.top;
- uint max = min(this->vscroll->GetPosition() + this->vscroll->GetCapacity(), static_cast<uint>(this->vehgroups.size()));
+ uint max = static_cast<uint>(std::min<size_t>(this->vscroll->GetPosition() + this->vscroll->GetCapacity(), this->vehgroups.size()));
for (uint i = this->vscroll->GetPosition(); i < max; ++i) {
const Vehicle *v = this->vehgroups[i].GetSingleVehicle();
if (v->group_id != this->vli.index) {