Skip to content

Commit 3f53db9

Browse files
committed
fix: correct incorrect nullptr conversions and syntax errors
1 parent 8b4aae9 commit 3f53db9

File tree

225 files changed

+357
-349
lines changed

Some content is hidden

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

225 files changed

+357
-349
lines changed

Core/GameEngine/Source/Common/Audio/simpleplayer.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -267,11 +267,11 @@ HRESULT CSimplePlayer::Play( LPCWSTR pszUrl, DWORD dwSecDuration, HANDLE hComple
267267

268268
#ifdef SUPPORT_DRM
269269

270-
hr = WMCreateReader( , WMT_RIGHT_PLAYBACK, &m_pReader );
270+
hr = WMCreateReader( nullptr, WMT_RIGHT_PLAYBACK, &m_pReader );
271271

272272
#else
273273

274-
hr = WMCreateReader( , 0, &m_pReader );
274+
hr = WMCreateReader( nullptr, 0, &m_pReader );
275275

276276
#endif
277277

@@ -429,7 +429,7 @@ HRESULT CSimplePlayer::Play( LPCWSTR pszUrl, DWORD dwSecDuration, HANDLE hComple
429429

430430
DWORD cbBuffer = 0;
431431

432-
hr = pProps->GetMediaType( , &cbBuffer );
432+
hr = pProps->GetMediaType( nullptr, &cbBuffer );
433433
if ( FAILED( hr ) )
434434
{
435435
pProps->Release( );

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3118,7 +3118,7 @@ void MemoryPoolFactory::debugMemoryReport(Int flags, Int startCheckpoint, Int en
31183118
fprintf( fp, "Begin Pool Info Report\n" );
31193119
fprintf( fp, "------------------------------------------\n" );
31203120
}
3121-
MemoryPool::debugPoolInfoReport( , fp );
3121+
MemoryPool::debugPoolInfoReport( nullptr, fp );
31223122
for (MemoryPool *pool = m_firstPoolInFactory; pool; pool = pool->getNextPoolInList())
31233123
{
31243124
MemoryPool::debugPoolInfoReport( pool, fp );
@@ -3210,7 +3210,7 @@ void MemoryPoolFactory::debugMemoryReport(Int flags, Int startCheckpoint, Int en
32103210
DEBUG_LOG(("Options: Between checkpoints %d and %d, report on (%s)",startCheckpoint,endCheckpoint,buf));
32113211
DEBUG_LOG(("------------------------------------------"));
32123212

3213-
BlockCheckpointInfo::doBlockCheckpointReport( , "", 0, 0, 0 );
3213+
BlockCheckpointInfo::doBlockCheckpointReport( nullptr, "", 0, 0, 0 );
32143214
for (MemoryPool *pool = m_firstPoolInFactory; pool; pool = pool->getNextPoolInList())
32153215
{
32163216
pool->debugCheckpointReport(flags, startCheckpoint, endCheckpoint, pool->getPoolName());

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/Include/Lib/BaseTypeCore.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,8 @@
9090

9191
#ifndef NULL
9292
//#define NULL ((void *)0)
93-
#define NULL 0 // C++ doesn't like casting void *'s into other pointers
93+
//#define NULL 0 // C++ doesn't like casting void *'s into other pointers
94+
// NULL is now deprecated - use nullptr instead
9495
#endif
9596

9697
// MSVC math.h defines overloaded functions with this name...

Core/Libraries/Source/WWVegas/WW3D2/rddesc.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,9 @@ class RenderDeviceDescClass
6262

6363
public:
6464

65-
RenderDeviceDescClass(void) : DeviceName(nullptr), DeviceVendor(nullptr), DevicePlatform(nullptr),
66-
DriverName(nullptr), DriverVendor(nullptr), DriverVersion(nullptr),
67-
HardwareName(nullptr), HardwareVendor(nullptr), HardwareChipset(NULL)
65+
RenderDeviceDescClass(void) : DeviceName(static_cast<const TCHAR*>(nullptr)), DeviceVendor(static_cast<const TCHAR*>(nullptr)), DevicePlatform(static_cast<const TCHAR*>(nullptr)),
66+
DriverName(static_cast<const TCHAR*>(nullptr)), DriverVendor(static_cast<const TCHAR*>(nullptr)), DriverVersion(static_cast<const TCHAR*>(nullptr)),
67+
HardwareName(static_cast<const TCHAR*>(nullptr)), HardwareVendor(static_cast<const TCHAR*>(nullptr)), HardwareChipset(static_cast<const TCHAR*>(nullptr))
6868
{
6969
}
7070

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/HASHLIST.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,8 @@
5252
#include <memory.h>
5353

5454
#ifndef NULL
55-
#define NULL (0L)
55+
//#define NULL (0L)
56+
// NULL is now deprecated - use nullptr instead
5657
#endif
5758

5859
#define A_LARGE_PRIME_NUMBER 257

0 commit comments

Comments
 (0)