From 9b800a96ed32720ff60b74e498a0e0a6351004f9 Mon Sep 17 00:00:00 2001 From: Charles Pigott Date: Fri, 8 Jan 2021 10:16:18 +0000 Subject: Codechange: Remove min/max functions in favour of STL variants (#8502) --- src/widget_type.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/widget_type.h') 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))); } /** -- cgit v1.2.3-54-g00ecf