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

@@ -386,16 +386,16 @@ void MemPixStuff();
void MemSect(int sect) {}
#endif
HINSTANCE g_hInst = NULL;
HWND g_hWnd = NULL;
HINSTANCE g_hInst = nullptr;
HWND g_hWnd = nullptr;
D3D_DRIVER_TYPE g_driverType = D3D_DRIVER_TYPE_NULL;
D3D_FEATURE_LEVEL g_featureLevel = D3D_FEATURE_LEVEL_11_0;
ID3D11Device* g_pd3dDevice = NULL;
ID3D11DeviceContext* g_pImmediateContext = NULL;
IDXGISwapChain* g_pSwapChain = NULL;
ID3D11RenderTargetView* g_pRenderTargetView = NULL;
ID3D11DepthStencilView* g_pDepthStencilView = NULL;
ID3D11Texture2D* g_pDepthStencilBuffer = NULL;
ID3D11Device* g_pd3dDevice = nullptr;
ID3D11DeviceContext* g_pImmediateContext = nullptr;
IDXGISwapChain* g_pSwapChain = nullptr;
ID3D11RenderTargetView* g_pRenderTargetView = nullptr;
ID3D11DepthStencilView* g_pDepthStencilView = nullptr;
ID3D11Texture2D* g_pDepthStencilBuffer = nullptr;
//
// FUNCTION: WndProc(HWND, UINT, WPARAM, LPARAM)
@@ -457,7 +457,7 @@ ATOM MyRegisterClass(HINSTANCE hInstance) {
wcex.cbWndExtra = 0;
wcex.hInstance = hInstance;
wcex.hIcon = LoadIcon(hInstance, "Minecraft");
wcex.hCursor = LoadCursor(NULL, IDC_ARROW);
wcex.hCursor = LoadCursor(nullptr, IDC_ARROW);
wcex.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1);
wcex.lpszMenuName = "Minecraft";
wcex.lpszClassName = "MinecraftClass";
@@ -487,7 +487,7 @@ BOOL InitInstance(HINSTANCE hInstance, int nCmdShow) {
CW_USEDEFAULT, 0,
wr.right - wr.left, // width of the window
wr.bottom - wr.top, // height of the window
NULL, NULL, hInstance, NULL);
nullptr, nullptr, hInstance, nullptr);
if (!g_hWnd) {
return FALSE;
@@ -591,7 +591,7 @@ HRESULT InitDevice() {
driverTypeIndex++) {
g_driverType = driverTypes[driverTypeIndex];
hr = D3D11CreateDeviceAndSwapChain(
NULL, g_driverType, NULL, createDeviceFlags, featureLevels,
nullptr, g_driverType, nullptr, createDeviceFlags, featureLevels,
numFeatureLevels, D3D11_SDK_VERSION, &sd, &g_pSwapChain,
&g_pd3dDevice, &g_featureLevel, &g_pImmediateContext);
if (HRESULT_SUCCEEDED(hr)) break;
@@ -599,7 +599,7 @@ HRESULT InitDevice() {
if (FAILED(hr)) return hr;
// Create a render target view
ID3D11Texture2D* pBackBuffer = NULL;
ID3D11Texture2D* pBackBuffer = nullptr;
hr = g_pSwapChain->GetBuffer(0, __uuidof(ID3D11Texture2D),
(LPVOID*)&pBackBuffer);
if (FAILED(hr)) return hr;
@@ -619,7 +619,7 @@ HRESULT InitDevice() {
descDepth.CPUAccessFlags = 0;
descDepth.MiscFlags = 0;
hr =
g_pd3dDevice->CreateTexture2D(&descDepth, NULL, &g_pDepthStencilBuffer);
g_pd3dDevice->CreateTexture2D(&descDepth, nullptr, &g_pDepthStencilBuffer);
D3D11_DEPTH_STENCIL_VIEW_DESC descDSView;
descDSView.Format = DXGI_FORMAT_D24_UNORM_S8_UINT;
@@ -629,7 +629,7 @@ HRESULT InitDevice() {
hr = g_pd3dDevice->CreateDepthStencilView(
g_pDepthStencilBuffer, &descDSView, &g_pDepthStencilView);
hr = g_pd3dDevice->CreateRenderTargetView(pBackBuffer, NULL,
hr = g_pd3dDevice->CreateRenderTargetView(pBackBuffer, nullptr,
&g_pRenderTargetView);
pBackBuffer->Release();
if (FAILED(hr)) return hr;
@@ -793,7 +793,7 @@ int APIENTRY _tWinMain(_In_ HINSTANCE hInstance,
// Sleep(10000);
MSG msg = {0};
while (WM_QUIT != msg.message) {
if (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) {
if (PeekMessage(&msg, nullptr, 0, 0, PM_REMOVE)) {
TranslateMessage(&msg);
DispatchMessage(&msg);
continue;
@@ -847,7 +847,7 @@ int APIENTRY _tWinMain(_In_ HINSTANCE hInstance,
ui.IsPauseMenuDisplayed(ProfileManager.GetPrimaryPad()));
} else {
MemSect(28);
pMinecraft->soundEngine->tick(NULL, 0.0f);
pMinecraft->soundEngine->tick(nullptr, 0.0f);
MemSect(0);
pMinecraft->textures->tick(true, false);
if (app.GetReallyChangingSessionType()) {