diff options
Diffstat (limited to 'src/server/shared')
| -rw-r--r-- | src/server/shared/Networking/Socket.h | 4 | ||||
| -rw-r--r-- | src/server/shared/Networking/SocketMgr.h | 2 | ||||
| -rw-r--r-- | src/server/shared/Packets/ByteBuffer.h | 3 |
3 files changed, 6 insertions, 3 deletions
diff --git a/src/server/shared/Networking/Socket.h b/src/server/shared/Networking/Socket.h index 6aa7974b1c1..dfff60a380b 100644 --- a/src/server/shared/Networking/Socket.h +++ b/src/server/shared/Networking/Socket.h @@ -116,7 +116,7 @@ public: #ifdef BOOST_ASIO_HAS_IOCP AsyncProcessQueue(guard); #else - (void)guard; + (void)guard; #endif } @@ -148,7 +148,7 @@ protected: return true; _isWritingAsync = true; - + #ifdef BOOST_ASIO_HAS_IOCP MessageBuffer& buffer = _writeQueue.front(); _socket.async_write_some(boost::asio::buffer(buffer.GetReadPointer(), buffer.GetActiveSize()), std::bind(&Socket<T>::WriteHandler, diff --git a/src/server/shared/Networking/SocketMgr.h b/src/server/shared/Networking/SocketMgr.h index 47bd7794a4c..dbe2b8ec902 100644 --- a/src/server/shared/Networking/SocketMgr.h +++ b/src/server/shared/Networking/SocketMgr.h @@ -97,7 +97,7 @@ public: int32 GetNetworkThreadCount() const { return _threadCount; } protected: - SocketMgr() : _threads(nullptr), _threadCount(1) + SocketMgr() : _acceptor(nullptr), _threads(nullptr), _threadCount(1) { } diff --git a/src/server/shared/Packets/ByteBuffer.h b/src/server/shared/Packets/ByteBuffer.h index 046fdc0c8e9..3d44c975c96 100644 --- a/src/server/shared/Packets/ByteBuffer.h +++ b/src/server/shared/Packets/ByteBuffer.h @@ -32,6 +32,7 @@ #include <cstring> #include <time.h> #include <cmath> +#include <type_traits> #include <boost/asio/buffer.hpp> class MessageBuffer; @@ -113,12 +114,14 @@ class ByteBuffer template <typename T> void append(T value) { + static_assert(std::is_fundamental<T>::value, "append(compound)"); EndianConvert(value); append((uint8 *)&value, sizeof(value)); } template <typename T> void put(size_t pos, T value) { + static_assert(std::is_fundamental<T>::value, "append(compound)"); EndianConvert(value); put(pos, (uint8 *)&value, sizeof(value)); } |
