Skip to content

Commit 8d3ea8e

Browse files
committed
Fix incorrect NULL to nullptr conversions for non-pointer types
1 parent 4b3a721 commit 8d3ea8e

File tree

64 files changed

+121
-121
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+121
-121
lines changed

Core/GameEngine/Source/Common/System/MiniDumper.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ void MiniDumper::shutdownMiniDumper()
5454
{
5555
TheMiniDumper->ShutDown();
5656
TheMiniDumper->~MiniDumper();
57-
::HeapFree(::GetProcessHeap(), nullptr, TheMiniDumper);
57+
::HeapFree(::GetProcessHeap(), 0, TheMiniDumper);
5858
TheMiniDumper = nullptr;
5959
}
6060
}

Core/GameEngine/Source/Common/System/StreamingArchiveFile.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ Bool StreamingArchiveFile::open( const Char *filename, Int access, size_t buffer
145145
return FALSE;
146146
}
147147

148-
return (open( file ) != nullptr);
148+
return open( file );
149149
}
150150

151151
//============================================================================

Core/GameEngineDevice/Source/VideoDevice/Bink/BinkVideoPlayer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -423,7 +423,7 @@ Int BinkVideoStream::frameCount( void )
423423

424424
void BinkVideoStream::frameGoto( Int index )
425425
{
426-
BinkGoto(m_handle, index, nullptr );
426+
BinkGoto(m_handle, index, 0 );
427427
}
428428

429429
//============================================================================

Core/GameEngineDevice/Source/W3DDevice/GameClient/W3DShaderManager.cpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ Int ScreenBWFilter::init(void)
278278
Int res;
279279
HRESULT hr;
280280

281-
m_dwBWPixelShader = nullptr;
281+
m_dwBWPixelShader = 0;
282282
m_curFadeFrame = 0;
283283

284284
if (!W3DShaderManager::canRenderToTexture()) {
@@ -478,7 +478,7 @@ Int ScreenBWFilter::shutdown(void)
478478
if (m_dwBWPixelShader)
479479
DX8Wrapper::_Get_D3D_Device8()->DeletePixelShader(m_dwBWPixelShader);
480480

481-
m_dwBWPixelShader=nullptr;
481+
m_dwBWPixelShader=0;
482482

483483
return TRUE;
484484
}
@@ -1940,9 +1940,9 @@ Int TerrainShaderPixelShader::shutdown(void)
19401940
if (m_dwBaseNoise2PixelShader)
19411941
DX8Wrapper::_Get_D3D_Device8()->DeletePixelShader(m_dwBaseNoise2PixelShader);
19421942

1943-
m_dwBasePixelShader=nullptr;
1944-
m_dwBaseNoise1PixelShader=nullptr;
1945-
m_dwBaseNoise2PixelShader=nullptr;
1943+
m_dwBasePixelShader=0;
1944+
m_dwBaseNoise1PixelShader=0;
1945+
m_dwBaseNoise2PixelShader=0;
19461946

19471947
return TRUE;
19481948
}
@@ -2236,7 +2236,7 @@ Int RoadShaderPixelShader::shutdown(void)
22362236
if (m_dwBaseNoise2PixelShader)
22372237
DX8Wrapper::_Get_D3D_Device8()->DeletePixelShader(m_dwBaseNoise2PixelShader);
22382238

2239-
m_dwBaseNoise2PixelShader=nullptr;
2239+
m_dwBaseNoise2PixelShader=0;
22402240

22412241
return TRUE;
22422242
}
@@ -3476,10 +3476,10 @@ Int FlatTerrainShaderPixelShader::shutdown(void)
34763476
if (m_dwBaseNoise2PixelShader)
34773477
DX8Wrapper::_Get_D3D_Device8()->DeletePixelShader(m_dwBaseNoise2PixelShader);
34783478

3479-
m_dwBasePixelShader=nullptr;
3480-
m_dwBase0PixelShader=nullptr;
3481-
m_dwBaseNoise1PixelShader=nullptr;
3482-
m_dwBaseNoise2PixelShader=nullptr;
3479+
m_dwBasePixelShader=0;
3480+
m_dwBase0PixelShader=0;
3481+
m_dwBaseNoise1PixelShader=0;
3482+
m_dwBaseNoise2PixelShader=0;
34833483

34843484
return TRUE;
34853485
}

Core/Libraries/Source/WWVegas/WWAudio/WWAudio.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1237,7 +1237,7 @@ WWAudioClass::Remove_From_Playlist (AudibleSoundClass *sound_obj)
12371237
//
12381238
if (sound_obj->Get_Loop_Count () != INFINITE_LOOPS) {
12391239
for (index = 0; index < m_EOSCallbackList.Count (); index ++) {
1240-
uint32 user_data = nullptr;
1240+
uint32 user_data = 0;
12411241
LPFNEOSCALLBACK callback = m_EOSCallbackList.Get_Callback (index, &user_data);
12421242
if (callback != nullptr) {
12431243
(*callback) (sound_obj, user_data);

Core/Libraries/Source/WWVegas/WWLib/Except.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -719,7 +719,7 @@ void Dump_Exception_Info(EXCEPTION_POINTERS *e_info)
719719

720720
if (symload) {
721721
if (_SymUnloadModule != nullptr) {
722-
_SymUnloadModule(GetCurrentProcess(), nullptr);
722+
_SymUnloadModule(GetCurrentProcess(), 0);
723723
}
724724
}
725725

@@ -1263,7 +1263,7 @@ int Stack_Walk(unsigned long *return_addresses, int num_addresses, CONTEXT *cont
12631263
** Walk the stack by the requested number of return address iterations.
12641264
*/
12651265
for (int i = 0; i < num_addresses + 1; i++) {
1266-
if (_StackWalk(IMAGE_FILE_MACHINE_I386, GetCurrentProcess(), GetCurrentThread(), &stack_frame, nullptr, NULL, _SymFunctionTableAccess, _SymGetModuleBase, nullptr)) {
1266+
if (_StackWalk(IMAGE_FILE_MACHINE_I386, GetCurrentProcess(), GetCurrentThread(), &stack_frame, nullptr, nullptr, _SymFunctionTableAccess, _SymGetModuleBase, nullptr)) {
12671267

12681268
/*
12691269
** First result will always be the return address we were called from.

Core/Libraries/Source/WWVegas/WWLib/TARGA.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,7 @@ long Targa::Load(const char* name, char* palette, char* image,bool invert_image)
360360
long error = 0;
361361

362362
/* Open the Targa */
363-
if (Open(name, TGA_READMODE) == nullptr) {
363+
if (Open(name, TGA_READMODE) == 0) {
364364

365365
/* Process ColorMap (palette) */
366366
if (Header.ColorMapType == 1) {
@@ -422,7 +422,7 @@ long Targa::Load(const char* name, char* palette, char* image,bool invert_image)
422422
break;
423423

424424
case TGA_TRUECOLOR_ENCODED:
425-
if ((error = DecodeImage()) == nullptr) {
425+
if ((error = DecodeImage()) == 0) {
426426
if (invert_image) InvertImage();
427427
}
428428
break;
@@ -598,7 +598,7 @@ long Targa::Save(const char* name, long flags, bool addextension)
598598
TGA2Footer footer;
599599

600600
/* Open the Targa for write. */
601-
if (Open(name, TGA_WRITEMODE) == nullptr)
601+
if (Open(name, TGA_WRITEMODE) == 0)
602602
{
603603
Header.IDLength = 0;
604604

Core/Libraries/Source/debug/debug_stack.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ static void InitDbghelp(void)
102102
{
103103
// not all functions found -> clear them all
104104
while (funcptr!=gDbg.funcPtr)
105-
*--funcptr=nullptr;
105+
*--funcptr=0;
106106
}
107107
else
108108
{

Core/Tools/W3DView/DataTreeView.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1105,7 +1105,7 @@ CDataTreeView::OnDeleteItem
11051105
SAFE_DELETE (asset_info);
11061106

11071107
// Reset the data associated with this entry
1108-
GetTreeCtrl ().SetItemData (pNMTreeView->itemOld.hItem, nullptr);
1108+
GetTreeCtrl ().SetItemData (pNMTreeView->itemOld.hItem, 0);
11091109
(*pResult) = 0;
11101110
return ;
11111111
}

Generals/Code/GameEngine/Source/Common/System/encrypt.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ const char *EncryptString(const char *String)
7979
for (Cnt = 0; Cnt < MAX_ENCRYPTED_STRING; Cnt++)
8080
Return_Buffer[Cnt] = Base_String[Temp_Buffer[Cnt] & 0x3F];
8181

82-
Return_Buffer[Cnt] = nullptr;
82+
Return_Buffer[Cnt] = '\0';
8383
return (Return_Buffer);
8484

8585
}

0 commit comments

Comments
 (0)