summaryrefslogtreecommitdiff
path: root/src/newgrf_spritegroup.cpp
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/newgrf_spritegroup.cpp
parentc1fddb9a6ae5c3af6865461a7295788a341011a2 (diff)
downloadopenttd-9b800a96ed32720ff60b74e498a0e0a6351004f9.tar.xz
Codechange: Remove min/max functions in favour of STL variants (#8502)
Diffstat (limited to 'src/newgrf_spritegroup.cpp')
-rw-r--r--src/newgrf_spritegroup.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/newgrf_spritegroup.cpp b/src/newgrf_spritegroup.cpp
index 824ba0439..871108ec4 100644
--- a/src/newgrf_spritegroup.cpp
+++ b/src/newgrf_spritegroup.cpp
@@ -8,7 +8,6 @@
/** @file newgrf_spritegroup.cpp Handling of primarily NewGRF action 2. */
#include "stdafx.h"
-#include <algorithm>
#include "debug.h"
#include "newgrf_spritegroup.h"
#include "newgrf_profiling.h"
@@ -173,10 +172,10 @@ static U EvalAdjustT(const DeterministicSpriteGroupAdjust *adjust, ScopeResolver
switch (adjust->operation) {
case DSGA_OP_ADD: return last_value + value;
case DSGA_OP_SUB: return last_value - value;
- case DSGA_OP_SMIN: return min((S)last_value, (S)value);
- case DSGA_OP_SMAX: return max((S)last_value, (S)value);
- case DSGA_OP_UMIN: return min((U)last_value, (U)value);
- case DSGA_OP_UMAX: return max((U)last_value, (U)value);
+ case DSGA_OP_SMIN: return std::min<S>(last_value, value);
+ case DSGA_OP_SMAX: return std::max<S>(last_value, value);
+ case DSGA_OP_UMIN: return std::min<U>(last_value, value);
+ case DSGA_OP_UMAX: return std::max<U>(last_value, value);
case DSGA_OP_SDIV: return value == 0 ? (S)last_value : (S)last_value / (S)value;
case DSGA_OP_SMOD: return value == 0 ? (S)last_value : (S)last_value % (S)value;
case DSGA_OP_UDIV: return value == 0 ? (U)last_value : (U)last_value / (U)value;