summaryrefslogtreecommitdiff
path: root/src/heightmap.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/heightmap.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/heightmap.cpp')
-rw-r--r--src/heightmap.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/heightmap.cpp b/src/heightmap.cpp
index 85e5d34a3..adedc06b4 100644
--- a/src/heightmap.cpp
+++ b/src/heightmap.cpp
@@ -136,7 +136,7 @@ static bool ReadHeightmapPNG(char *filename, uint *x, uint *y, byte **map)
}
if (map != NULL) {
- MallocT(/* NO & */map, info_ptr->width * info_ptr->height);
+ *map = MallocT<byte>(info_ptr->width * info_ptr->height);
if (*map == NULL) {
ShowErrorMessage(STR_PNGMAP_ERR_MISC, STR_PNGMAP_ERROR, 0, 0);
@@ -249,7 +249,7 @@ static bool ReadHeightmapBMP(char *filename, uint *x, uint *y, byte **map)
return false;
}
- MallocT(/* NO & */map, info.width * info.height);
+ *map = MallocT<byte>(info.width * info.height);
if (*map == NULL) {
ShowErrorMessage(STR_PNGMAP_ERR_MISC, STR_BMPMAP_ERROR, 0, 0);
fclose(f);