diff options
author | Charles Pigott <charlespigott@googlemail.com> | 2021-01-08 10:16:18 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-08 11:16:18 +0100 |
commit | 9b800a96ed32720ff60b74e498a0e0a6351004f9 (patch) | |
tree | 3f287d339e15c4902ee415556475fd9b2918d33c /src/news_gui.cpp | |
parent | c1fddb9a6ae5c3af6865461a7295788a341011a2 (diff) | |
download | openttd-9b800a96ed32720ff60b74e498a0e0a6351004f9.tar.xz |
Codechange: Remove min/max functions in favour of STL variants (#8502)
Diffstat (limited to 'src/news_gui.cpp')
-rw-r--r-- | src/news_gui.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/news_gui.cpp b/src/news_gui.cpp index e98f76da9..639c07574 100644 --- a/src/news_gui.cpp +++ b/src/news_gui.cpp @@ -538,7 +538,7 @@ struct NewsWindow : Window { int count = this->timer.CountElapsed(delta_ms); if (count > 0) { /* Scroll up newsmessages from the bottom */ - int newtop = max(this->top - 2 * count, _screen.height - this->height - this->status_height - this->chat_height); + int newtop = std::max(this->top - 2 * count, _screen.height - this->height - this->status_height - this->chat_height); this->SetWindowTop(newtop); } @@ -556,8 +556,8 @@ private: { if (this->top == newtop) return; - int mintop = min(newtop, this->top); - int maxtop = max(newtop, this->top); + int mintop = std::min(newtop, this->top); + int maxtop = std::max(newtop, this->top); if (this->viewport != nullptr) this->viewport->top += newtop - this->top; this->top = newtop; @@ -1148,7 +1148,7 @@ struct MessageHistoryWindow : Window { this->date_width = GetStringBoundingBox(STR_SHORT_DATE).width; size->height = 4 * resize->height + this->top_spacing + this->bottom_spacing; // At least 4 lines are visible. - size->width = max(200u, size->width); // At least 200 pixels wide. + size->width = std::max(200u, size->width); // At least 200 pixels wide. } } |