From a0081a3072230f1becbc0b1cf33572ab67a68d07 Mon Sep 17 00:00:00 2001 From: Bjørn Lindeijer Date: Sun, 13 Nov 2005 01:32:16 +0000 Subject: Nothing of much significance, mainly checking whether I can commit. --- src/messageout.cpp | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'src/messageout.cpp') diff --git a/src/messageout.cpp b/src/messageout.cpp index a2faf33..95e55a8 100644 --- a/src/messageout.cpp +++ b/src/messageout.cpp @@ -44,13 +44,15 @@ MessageOut::~MessageOut() } } -void MessageOut::expand(size_t bytes) +void +MessageOut::expand(size_t bytes) { mData = (char*)realloc(mData, bytes); mDataSize = bytes; } -void MessageOut::writeByte(char value) +void +MessageOut::writeByte(char value) { expand(mPos + sizeof(char)); mData[mPos] = value; @@ -64,14 +66,16 @@ void MessageOut::writeShort(short value) mPos += sizeof(short); } -void MessageOut::writeLong(long value) +void +MessageOut::writeLong(long value) { expand(mPos + sizeof(long)); SDLNet_Write32(value, &mData[mPos]); mPos += sizeof(long); } -void MessageOut::writeString(const std::string &string, int length) +void +MessageOut::writeString(const std::string &string, int length) { std::string toWrite = string; @@ -103,7 +107,8 @@ void MessageOut::writeString(const std::string &string, int length) } } -const Packet *MessageOut::getPacket() +const Packet* +MessageOut::getPacket() { if (!mPacket) { -- cgit