summaryrefslogtreecommitdiff
path: root/src/tgp.cpp
diff options
context:
space:
mode:
authorKUDr <KUDr@openttd.org>2007-01-11 17:29:39 +0000
committerKUDr <KUDr@openttd.org>2007-01-11 17:29:39 +0000
commit28e969924b9033f5132fe2ba223e2bcadd39a7ec (patch)
treed644a3831ca0947198b191fa3e4e8973d3a9786e /src/tgp.cpp
parent5675956443d4e58713a0abd8cedb4eaaaccf22d4 (diff)
downloadopenttd-28e969924b9033f5132fe2ba223e2bcadd39a7ec.tar.xz
(svn r8066) - Codechange: MallocT(), CallocT(), ReallocT() now return the pointer to allocated memory instead of modifying the pointer given as parameter
Diffstat (limited to 'src/tgp.cpp')
-rw-r--r--src/tgp.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/tgp.cpp b/src/tgp.cpp
index 491562cd3..88630b957 100644
--- a/src/tgp.cpp
+++ b/src/tgp.cpp
@@ -239,7 +239,7 @@ static inline bool AllocHeightMap(void)
/* Allocate memory block for height map row pointers */
_height_map.total_size = (_height_map.size_x + 1) * (_height_map.size_y + 1);
_height_map.dim_x = _height_map.size_x + 1;
- CallocT(&_height_map.h, _height_map.total_size);
+ _height_map.h = CallocT<height_t>(_height_map.total_size);
if (_height_map.h == NULL) return false;
/* Iterate through height map initialize values */
@@ -467,12 +467,12 @@ static void HeightMapAdjustWaterLevel(amplitude_t water_percent, height_t h_max_
height_t h_min, h_max, h_avg, h_water_level;
int water_tiles, desired_water_tiles;
height_t *h;
- int *hist_buf, *hist;
+ int *hist;
HeightMapGetMinMaxAvg(&h_min, &h_max, &h_avg);
/* Allocate histogram buffer and clear its cells */
- CallocT(&hist_buf, h_max - h_min + 1);
+ int *hist_buf = CallocT<int>(h_max - h_min + 1);
/* Fill histogram */
hist = HeightMapMakeHistogram(h_min, h_max, hist_buf);