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
commit33be1ecfb1a9056b027d50d7b558cff87c5b744d (patch)
treed644a3831ca0947198b191fa3e4e8973d3a9786e /src/heightmap.cpp
parent91ff74641060445dc1647bbf05baeb03b45c3099 (diff)
downloadopenttd-33be1ecfb1a9056b027d50d7b558cff87c5b744d.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);