summaryrefslogtreecommitdiff
path: root/src/train_gui.cpp
diff options
context:
space:
mode:
authorcelestar <celestar@openttd.org>2007-01-11 11:05:01 +0000
committercelestar <celestar@openttd.org>2007-01-11 11:05:01 +0000
commit2ac0410767683fb0e6315433f9805712cb85f5bd (patch)
treef9cb6bcd0d0b855706d1e00e0a4ffd2757c7e039 /src/train_gui.cpp
parent7996c9e560f61cddba0a3ad48b95c81d9030ef99 (diff)
downloadopenttd-2ac0410767683fb0e6315433f9805712cb85f5bd.tar.xz
(svn r8055) -Codechange: Replace the different max, dmax, maxu whatever macros by a simple template function max(), that requires two arguments of the same type. While I'm at it change a variable called "max" to "maxval" in a function that calls max().
Diffstat (limited to 'src/train_gui.cpp')
-rw-r--r--src/train_gui.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/train_gui.cpp b/src/train_gui.cpp
index 7a5176c80..42a9e8361 100644
--- a/src/train_gui.cpp
+++ b/src/train_gui.cpp
@@ -166,8 +166,8 @@ static int CDECL TrainEnginePowerVsRunningCostSorter(const void *a, const void *
* Because of this, the return value have to be reversed as well and we return b - a instead of a - b.
* Another thing is that both power and running costs should be doubled for multiheaded engines.
* Since it would be multipling with 2 in both numerator and denumerator, it will even themselves out and we skip checking for multiheaded. */
- int va = (rvi_a->running_cost_base * _price.running_rail[rvi_a->running_cost_class]) / max(1, rvi_a->power);
- int vb = (rvi_b->running_cost_base * _price.running_rail[rvi_b->running_cost_class]) / max(1, rvi_b->power);
+ int va = (rvi_a->running_cost_base * _price.running_rail[rvi_a->running_cost_class]) / max((uint16)1, rvi_a->power);
+ int vb = (rvi_b->running_cost_base * _price.running_rail[rvi_b->running_cost_class]) / max((uint16)1, rvi_b->power);
int r = vb - va;
return _internal_sort_order ? -r : r;