From 8a8348ebebbce2a8428f74a3d9b224f205e43b59 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20D=C3=BCrrenberger?= Date: Tue, 20 Jun 2023 00:04:11 +0200 Subject: [PATCH] Replace C++11 with SFML int types --- src/SFML/Network/IpAddress.cpp | 2 +- src/SFML/Network/Packet.cpp | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/SFML/Network/IpAddress.cpp b/src/SFML/Network/IpAddress.cpp index 50c7e68c5..a36ffe51a 100644 --- a/src/SFML/Network/IpAddress.cpp +++ b/src/SFML/Network/IpAddress.cpp @@ -69,7 +69,7 @@ m_valid (false) //////////////////////////////////////////////////////////// IpAddress::IpAddress(Uint8 byte0, Uint8 byte1, Uint8 byte2, Uint8 byte3) : -m_address(htonl(static_cast((byte0 << 24) | (byte1 << 16) | (byte2 << 8) | byte3))), +m_address(htonl(static_cast((byte0 << 24) | (byte1 << 16) | (byte2 << 8) | byte3))), m_valid (true) { } diff --git a/src/SFML/Network/Packet.cpp b/src/SFML/Network/Packet.cpp index d6b0bdf81..926362822 100644 --- a/src/SFML/Network/Packet.cpp +++ b/src/SFML/Network/Packet.cpp @@ -150,7 +150,7 @@ Packet& Packet::operator >>(Int16& data) if (checkSize(sizeof(data))) { std::memcpy(&data, &m_data[m_readPos], sizeof(data)); - data = static_cast(ntohs(static_cast(data))); + data = static_cast(ntohs(static_cast(data))); m_readPos += sizeof(data); } @@ -178,7 +178,7 @@ Packet& Packet::operator >>(Int32& data) if (checkSize(sizeof(data))) { std::memcpy(&data, &m_data[m_readPos], sizeof(data)); - data = static_cast(ntohl(static_cast(data))); + data = static_cast(ntohl(static_cast(data))); m_readPos += sizeof(data); } @@ -412,7 +412,7 @@ Packet& Packet::operator <<(Uint8 data) //////////////////////////////////////////////////////////// Packet& Packet::operator <<(Int16 data) { - Int16 toWrite = static_cast(htons(static_cast(data))); + Int16 toWrite = static_cast(htons(static_cast(data))); append(&toWrite, sizeof(toWrite)); return *this; } @@ -430,7 +430,7 @@ Packet& Packet::operator <<(Uint16 data) //////////////////////////////////////////////////////////// Packet& Packet::operator <<(Int32 data) { - Int32 toWrite = static_cast(htonl(static_cast(data))); + Int32 toWrite = static_cast(htonl(static_cast(data))); append(&toWrite, sizeof(toWrite)); return *this; }