Codechange: Remove min/max functions in favour of STL variants (#8502)

This commit is contained in:
Charles Pigott
2021-01-08 10:16:18 +00:00
committed by GitHub
parent c1fddb9a6a
commit 9b800a96ed
181 changed files with 900 additions and 954 deletions

View File

@@ -369,7 +369,7 @@ protected:
* somewhat gradually. But never lower than the maximum speed. */
int tempmax = max_speed;
if (this->cur_speed > max_speed) {
tempmax = max(this->cur_speed - (this->cur_speed / 10) - 1, max_speed);
tempmax = std::max(this->cur_speed - (this->cur_speed / 10) - 1, max_speed);
}
/* Enforce a maximum and minimum speed. Normally we would use something like
@@ -377,7 +377,7 @@ protected:
* threshold for some reason. That makes acceleration fail and assertions
* happen in Clamp. So make it explicit that min_speed overrules the maximum
* speed by explicit ordering of min and max. */
this->cur_speed = spd = max(min(this->cur_speed + ((int)spd >> 8), tempmax), min_speed);
this->cur_speed = spd = std::max(std::min(this->cur_speed + ((int)spd >> 8), tempmax), min_speed);
int scaled_spd = this->GetAdvanceSpeed(spd);