summaryrefslogtreecommitdiff
path: root/src/network/network_data.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/network/network_data.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/network/network_data.cpp')
-rw-r--r--src/network/network_data.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/network/network_data.cpp b/src/network/network_data.cpp
index 89011f18d..4b0166c9a 100644
--- a/src/network/network_data.cpp
+++ b/src/network/network_data.cpp
@@ -14,8 +14,7 @@
// Add a command to the local command queue
void NetworkAddCommandQueue(NetworkClientState *cs, CommandPacket *cp)
{
- CommandPacket* new_cp;
- MallocT(&new_cp, 1);
+ CommandPacket* new_cp = MallocT<CommandPacket>(1);
*new_cp = *cp;
@@ -31,8 +30,7 @@ void NetworkAddCommandQueue(NetworkClientState *cs, CommandPacket *cp)
// Prepare a DoCommand to be send over the network
void NetworkSend_Command(TileIndex tile, uint32 p1, uint32 p2, uint32 cmd, CommandCallback *callback)
{
- CommandPacket *c;
- MallocT(&c, 1);
+ CommandPacket *c = MallocT<CommandPacket>(1);
byte temp_callback;
c->player = _local_player;