summaryrefslogtreecommitdiff
path: root/src/widget_type.h
diff options
context:
space:
mode:
authorCharles Pigott <charlespigott@googlemail.com>2021-01-08 10:16:18 +0000
committerGitHub <noreply@github.com>2021-01-08 11:16:18 +0100
commit9b800a96ed32720ff60b74e498a0e0a6351004f9 (patch)
tree3f287d339e15c4902ee415556475fd9b2918d33c /src/widget_type.h
parentc1fddb9a6ae5c3af6865461a7295788a341011a2 (diff)
downloadopenttd-9b800a96ed32720ff60b74e498a0e0a6351004f9.tar.xz
Codechange: Remove min/max functions in favour of STL variants (#8502)
Diffstat (limited to 'src/widget_type.h')
-rw-r--r--src/widget_type.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/widget_type.h b/src/widget_type.h
index 3a36d9aad..1b1677039 100644
--- a/src/widget_type.h
+++ b/src/widget_type.h
@@ -687,7 +687,7 @@ public:
assert(capacity <= MAX_UVALUE(uint16));
this->cap = capacity;
- if (this->cap + this->pos > this->count) this->pos = max(0, this->count - this->cap);
+ if (this->cap + this->pos > this->count) this->pos = std::max(0, this->count - this->cap);
}
void SetCapacityFromWidget(Window *w, int widget, int padding = 0);
@@ -717,7 +717,7 @@ public:
case SS_BIG: difference *= this->cap; break;
default: break;
}
- this->SetPosition(Clamp(this->pos + difference, 0, max(this->count - this->cap, 0)));
+ this->SetPosition(Clamp(this->pos + difference, 0, std::max(this->count - this->cap, 0)));
}
/**