summaryrefslogtreecommitdiff
path: root/src/station_gui.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/station_gui.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/station_gui.cpp')
-rw-r--r--src/station_gui.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/station_gui.cpp b/src/station_gui.cpp
index c4f778e1a..94f6d6341 100644
--- a/src/station_gui.cpp
+++ b/src/station_gui.cpp
@@ -198,13 +198,12 @@ static void BuildStationsList(plstations_d* sl, PlayerID owner, byte facilities,
{
uint n = 0;
uint i, j;
- const Station** station_sort;
const Station *st;
if (!(sl->flags & SL_REBUILD)) return;
/* Create array for sorting */
- MallocT(&station_sort, GetMaxStationIndex() + 1);
+ const Station** station_sort = MallocT<const Station*>(GetMaxStationIndex() + 1);
if (station_sort == NULL) error("Could not allocate memory for the station-sorting-list");
DEBUG(misc, 3, "Building station list for player %d", owner);
@@ -231,7 +230,7 @@ static void BuildStationsList(plstations_d* sl, PlayerID owner, byte facilities,
}
free((void*)sl->sort_list);
- MallocT(&sl->sort_list, n);
+ sl->sort_list = MallocT<const Station*>(n);
if (n != 0 && sl->sort_list == NULL) error("Could not allocate memory for the station-sorting-list");
sl->list_length = n;