summaryrefslogtreecommitdiff
path: root/src/network/core/packet.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/network/core/packet.cpp')
-rw-r--r--src/network/core/packet.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/network/core/packet.cpp b/src/network/core/packet.cpp
index 8cecd9bd2..fda8fdfeb 100644
--- a/src/network/core/packet.cpp
+++ b/src/network/core/packet.cpp
@@ -24,10 +24,10 @@
*/
Packet::Packet(NetworkSocketHandler *cs)
{
- assert(cs != NULL);
+ assert(cs != nullptr);
this->cs = cs;
- this->next = NULL;
+ this->next = nullptr;
this->pos = 0; // We start reading from here
this->size = 0;
this->buffer = MallocT<byte>(SEND_MTU);
@@ -39,8 +39,8 @@ Packet::Packet(NetworkSocketHandler *cs)
*/
Packet::Packet(PacketType type)
{
- this->cs = NULL;
- this->next = NULL;
+ this->cs = nullptr;
+ this->next = nullptr;
/* Skip the size so we can write that in before sending the packet */
this->pos = 0;
@@ -62,7 +62,7 @@ Packet::~Packet()
*/
void Packet::PrepareToSend()
{
- assert(this->cs == NULL && this->next == NULL);
+ assert(this->cs == nullptr && this->next == nullptr);
this->buffer[0] = GB(this->size, 0, 8);
this->buffer[1] = GB(this->size, 8, 8);
@@ -149,7 +149,7 @@ void Packet::Send_uint64(uint64 data)
*/
void Packet::Send_string(const char *data)
{
- assert(data != NULL);
+ assert(data != nullptr);
/* The <= *is* valid due to the fact that we are comparing sizes and not the index. */
assert(this->size + strlen(data) + 1 <= SEND_MTU);
while ((this->buffer[this->size++] = *data++) != '\0') {}
@@ -187,7 +187,7 @@ bool Packet::CanReadFromPacket(uint bytes_to_read)
*/
void Packet::ReadRawPacketSize()
{
- assert(this->cs != NULL && this->next == NULL);
+ assert(this->cs != nullptr && this->next == nullptr);
this->size = (PacketSize)this->buffer[0];
this->size += (PacketSize)this->buffer[1] << 8;
}