refactor: replace NULL with nullptr across C++ codebase

Excludes vendored C libs (zlib, Miles, DirectXMath, boost, Iggy).
This commit is contained in:
MatthewBeshay
2026-03-30 16:25:52 +11:00
parent a330ecdcbb
commit dfb0e3b03e
752 changed files with 5396 additions and 5396 deletions

View File

@@ -38,7 +38,7 @@ PendingConnection::PendingConnection(MinecraftServer* server, Socket* socket,
PendingConnection::~PendingConnection() { delete connection; }
void PendingConnection::tick() {
if (acceptedLogin != NULL) {
if (acceptedLogin != nullptr) {
this->handleAcceptedLogin(acceptedLogin);
acceptedLogin = nullptr;
}
@@ -104,7 +104,7 @@ void PendingConnection::sendPreLoginResponse() {
// PADDY - this is failing when a local player with chat restrictions
// joins an online game
if (player != NULL &&
if (player != nullptr &&
player->connection->m_offlineXUID != INVALID_XUID &&
player->connection->m_onlineXUID != INVALID_XUID) {
if (player->connection->m_friendsOnlyUGC) {
@@ -114,7 +114,7 @@ void PendingConnection::sendPreLoginResponse() {
// the client
ugcXuids[ugcXuidCount] = player->connection->m_onlineXUID;
if (player->connection->getNetworkPlayer() != NULL &&
if (player->connection->getNetworkPlayer() != nullptr &&
player->connection->getNetworkPlayer()->IsHost())
hostIndex = ugcXuidCount;
@@ -178,10 +178,10 @@ void PendingConnection::handleAcceptedLogin(
std::shared_ptr<ServerPlayer> playerEntity =
server->getPlayers()->getPlayerForLogin(this, name, playerXuid,
packet->m_onlineXuid);
if (playerEntity != NULL) {
if (playerEntity != nullptr) {
server->getPlayers()->placeNewPlayer(connection, playerEntity, packet);
connection = NULL; // We've moved responsibility for this over to the
// new PlayerConnection, NULL so we don't delete our
connection = nullptr; // We've moved responsibility for this over to the
// new PlayerConnection, nullptr so we don't delete our
// reference to it here in our dtor
}
done = true;