diff options
author | tron <tron@openttd.org> | 2007-01-19 11:47:48 +0000 |
---|---|---|
committer | tron <tron@openttd.org> | 2007-01-19 11:47:48 +0000 |
commit | 81e88a2a7c6bc999a46620906bed02d6b1e02814 (patch) | |
tree | b99fe1407a3f7165356bacf607eb1e59804164a9 /src/viewport.cpp | |
parent | 659adc7c42cbad3220519b08e80f5c7cdcfd088a (diff) | |
download | openttd-81e88a2a7c6bc999a46620906bed02d6b1e02814.tar.xz |
(svn r8276) -Fix
Change the signature of Swap() to be less error prone, i.e. pass the variables to be swapped by reference instead of passing pointers to the variables.
Just do Swap(x, y) instead of Swap(&x, &y). This prevents accidents when the variables are pointers.
Diffstat (limited to 'src/viewport.cpp')
-rw-r--r-- | src/viewport.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/viewport.cpp b/src/viewport.cpp index 5d9b395e9..5be898e4c 100644 --- a/src/viewport.cpp +++ b/src/viewport.cpp @@ -2065,7 +2065,7 @@ static int CalcHeightdiff(HighLightStyle style, uint distance, TileIndex start_t uint h0, h1, ht; // start heigth, end height, and temp variable if (start_tile == end_tile) return 0; - if (swap) SwapT(&start_tile, &end_tile); + if (swap) Swap(start_tile, end_tile); switch (style & HT_DRAG_MASK) { case HT_RECT: { @@ -2125,7 +2125,7 @@ static int CalcHeightdiff(HighLightStyle style, uint distance, TileIndex start_t } break; } - if (swap) SwapT(&h0, &h1); + if (swap) Swap(h0, h1); /* Minimap shows height in intervals of 50 meters, let's do the same */ return (int)(h1 - h0) * 50; } |