Codechange: Replace assert_compile macro with static_assert
This commit is contained in:
@@ -54,7 +54,7 @@ static const AdminUpdateFrequency _admin_update_type_frequencies[] = {
|
||||
ADMIN_FREQUENCY_AUTOMATIC, ///< ADMIN_UPDATE_GAMESCRIPT
|
||||
};
|
||||
/** Sanity check. */
|
||||
assert_compile(lengthof(_admin_update_type_frequencies) == ADMIN_UPDATE_END);
|
||||
static_assert(lengthof(_admin_update_type_frequencies) == ADMIN_UPDATE_END);
|
||||
|
||||
/**
|
||||
* Create a new socket for the server side of the admin network.
|
||||
@@ -86,7 +86,7 @@ ServerNetworkAdminSocketHandler::~ServerNetworkAdminSocketHandler()
|
||||
bool accept = !StrEmpty(_settings_client.network.admin_password) && _network_admins_connected < MAX_ADMINS;
|
||||
/* We can't go over the MAX_ADMINS limit here. However, if we accept
|
||||
* the connection, there has to be space in the pool. */
|
||||
assert_compile(NetworkAdminSocketPool::MAX_SIZE == MAX_ADMINS);
|
||||
static_assert(NetworkAdminSocketPool::MAX_SIZE == MAX_ADMINS);
|
||||
assert(!accept || ServerNetworkAdminSocketHandler::CanAllocateItem());
|
||||
return accept;
|
||||
}
|
||||
|
Reference in New Issue
Block a user