summaryrefslogtreecommitdiff
path: root/src/network/core/packet.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2007-01-10 18:56:51 +0000
committerrubidium <rubidium@openttd.org>2007-01-10 18:56:51 +0000
commitf35ed4bbc2b05f1b83476b60948d64375f77f1b4 (patch)
tree1a1c59c13ddb1d152052f3a3a0bcffe4fb531173 /src/network/core/packet.cpp
parenta332d10fd938f345fff18e5f4a662a58f692f734 (diff)
downloadopenttd-f35ed4bbc2b05f1b83476b60948d64375f77f1b4.tar.xz
(svn r8038) -Merge: the cpp branch. Effort of KUDr, Celestar, glx, Smoovius, stillunknown and pv2b.
Diffstat (limited to 'src/network/core/packet.cpp')
-rw-r--r--src/network/core/packet.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/network/core/packet.cpp b/src/network/core/packet.cpp
index d75d78c7e..38d00d8c0 100644
--- a/src/network/core/packet.cpp
+++ b/src/network/core/packet.cpp
@@ -5,6 +5,8 @@
#include "../../stdafx.h"
#include "../../macros.h"
#include "../../string.h"
+#include "../../helpers.hpp"
+#include "../network_data.h"
#include "packet.h"
@@ -24,7 +26,8 @@ extern void NORETURN CDECL error(const char *str, ...);
*/
Packet *NetworkSend_Init(const PacketType type)
{
- Packet *packet = malloc(sizeof(Packet));
+ Packet *packet;
+ MallocT(&packet, 1);
/* An error is inplace here, because it simply means we ran out of memory. */
if (packet == NULL) error("Failed to allocate Packet");
@@ -109,7 +112,7 @@ void NetworkSend_string(Packet *packet, const char* data)
*/
-extern uint CloseConnection(NetworkClientState *cs);
+extern NetworkRecvStatus CloseConnection(NetworkClientState *cs);
/** Is it safe to read from the packet, i.e. didn't we run over the buffer ? */
static inline bool CanReadFromPacket(NetworkClientState *cs, const Packet *packet, const uint bytes_to_read)