diff options
author | Charles Pigott <charlespigott@googlemail.com> | 2020-12-27 10:44:22 +0000 |
---|---|---|
committer | Charles Pigott <charlespigott@googlemail.com> | 2020-12-27 10:55:42 +0000 |
commit | 860c270c73048b4930ac8cbebcd60be746eb9782 (patch) | |
tree | a88a8acb208cf426ae8fac05dda202c57b59426a /src/network/network_server.cpp | |
parent | 395a5d9991b500c681ff384f8d3b4e153e687abb (diff) | |
download | openttd-860c270c73048b4930ac8cbebcd60be746eb9782.tar.xz |
Codechange: Replace assert_compile macro with static_assert
Diffstat (limited to 'src/network/network_server.cpp')
-rw-r--r-- | src/network/network_server.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/network/network_server.cpp b/src/network/network_server.cpp index c82c51cfd..1454991a8 100644 --- a/src/network/network_server.cpp +++ b/src/network/network_server.cpp @@ -41,9 +41,9 @@ DECLARE_POSTFIX_INCREMENT(ClientID) static ClientID _network_client_id = CLIENT_ID_FIRST; /** Make very sure the preconditions given in network_type.h are actually followed */ -assert_compile(MAX_CLIENT_SLOTS > MAX_CLIENTS); +static_assert(MAX_CLIENT_SLOTS > MAX_CLIENTS); /** Yes... */ -assert_compile(NetworkClientSocketPool::MAX_SIZE == MAX_CLIENT_SLOTS); +static_assert(NetworkClientSocketPool::MAX_SIZE == MAX_CLIENT_SLOTS); /** The pool with clients. */ NetworkClientSocketPool _networkclientsocket_pool("NetworkClientSocket"); @@ -223,7 +223,7 @@ ServerNetworkGameSocketHandler::ServerNetworkGameSocketHandler(SOCKET s) : Netwo /* The Socket and Info pools need to be the same in size. After all, * each Socket will be associated with at most one Info object. As * such if the Socket was allocated the Info object can as well. */ - assert_compile(NetworkClientSocketPool::MAX_SIZE == NetworkClientInfoPool::MAX_SIZE); + static_assert(NetworkClientSocketPool::MAX_SIZE == NetworkClientInfoPool::MAX_SIZE); } /** @@ -311,7 +311,7 @@ NetworkRecvStatus ServerNetworkGameSocketHandler::CloseConnection(NetworkRecvSta /* We can't go over the MAX_CLIENTS limit here. However, the * pool must have place for all clients and ourself. */ - assert_compile(NetworkClientSocketPool::MAX_SIZE == MAX_CLIENTS + 1); + static_assert(NetworkClientSocketPool::MAX_SIZE == MAX_CLIENTS + 1); assert(!accept || ServerNetworkGameSocketHandler::CanAllocateItem()); return accept; } @@ -1962,7 +1962,7 @@ void NetworkServerShowStatusToConsole() "ready", "active" }; - assert_compile(lengthof(stat_str) == NetworkClientSocket::STATUS_END); + static_assert(lengthof(stat_str) == NetworkClientSocket::STATUS_END); for (NetworkClientSocket *cs : NetworkClientSocket::Iterate()) { NetworkClientInfo *ci = cs->GetInfo(); |