summaryrefslogtreecommitdiff
path: root/src/aystar.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/aystar.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/aystar.cpp')
-rw-r--r--src/aystar.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/aystar.cpp b/src/aystar.cpp
index 36260d4f3..8c7e60851 100644
--- a/src/aystar.cpp
+++ b/src/aystar.cpp
@@ -36,8 +36,7 @@ static PathNode* AyStarMain_ClosedList_IsInList(AyStar *aystar, const AyStarNode
static void AyStarMain_ClosedList_Add(AyStar *aystar, const PathNode *node)
{
// Add a node to the ClosedList
- PathNode *new_node;
- MallocT(&new_node, 1);
+ PathNode *new_node = MallocT<PathNode>(1);
*new_node = *node;
Hash_Set(&aystar->ClosedListHash, node->node.tile, node->node.direction, new_node);
}
@@ -68,8 +67,7 @@ static OpenListNode *AyStarMain_OpenList_Pop(AyStar *aystar)
static void AyStarMain_OpenList_Add(AyStar *aystar, PathNode *parent, const AyStarNode *node, int f, int g)
{
// Add a new Node to the OpenList
- OpenListNode *new_node;
- MallocT(&new_node, 1);
+ OpenListNode *new_node = MallocT<OpenListNode>(1);
new_node->g = g;
new_node->path.parent = parent;
new_node->path.node = *node;