Skip to content

Commit dc0cd0a

Browse files
committed
fix: correct incorrect nullptr conversions and syntax errors
1 parent bd5674e commit dc0cd0a

File tree

214 files changed

+329
-333
lines changed

Some content is hidden

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

214 files changed

+329
-333
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/GameEngineDevice/Source/W3DDevice/GameClient/W3DTreeBuffer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1794,7 +1794,7 @@ void W3DTreeBuffer::drawTrees(CameraClass * camera, RefRenderObjListIterator *pD
17941794
}
17951795

17961796
DX8Wrapper::Set_Vertex_Shader(DX8_FVF_XYZNDUV1);
1797-
DX8Wrapper::Set_Pixel_Shader(nullptr);
1797+
DX8Wrapper::Set_Pixel_Shader(0);
17981798
DX8Wrapper::Invalidate_Cached_Render_States(); //code above mucks around with W3D states so make sure we reset
17991799

18001800
}

Core/GameEngineDevice/Source/W3DDevice/GameClient/Water/W3DWater.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ static ShaderClass blendStagesShader(SC_DETAIL_BLEND);
165165

166166
WaterRenderObjClass *TheWaterRenderObj=nullptr; ///<global water rendering object
167167

168-
#define SAFE_RELEASE(p) { if(p) { (p)->Release(); (p)=NULL; } }
168+
#define SAFE_RELEASE(p) { if(p) { (p)->Release(); (p)=nullptr; } }
169169

170170
void doSkyBoxSet(Bool startDraw)
171171
{
@@ -340,8 +340,8 @@ WaterRenderObjClass::WaterRenderObjClass(void)
340340
m_indexBufferD3D=nullptr;
341341
m_vertexBufferD3DOffset=0;
342342

343-
m_dwWavePixelShader=nullptr;
344-
m_dwWaveVertexShader=nullptr;
343+
m_dwWavePixelShader=0;
344+
m_dwWaveVertexShader=0;
345345
m_meshData=nullptr;
346346
m_meshDataSize = 0;
347347
m_meshInMotion = FALSE;
@@ -2426,7 +2426,7 @@ void WaterRenderObjClass::renderWaterMesh(void)
24262426

24272427
// m_pDev->SetRenderState(D3DRS_FILLMODE,D3DFILL_SOLID);
24282428

2429-
if (m_trapezoidWaterPixelShader) DX8Wrapper::_Get_D3D_Device8()->SetPixelShader(nullptr);
2429+
if (m_trapezoidWaterPixelShader) DX8Wrapper::_Get_D3D_Device8()->SetPixelShader(0);
24302430

24312431
m_vertexBufferD3DOffset += mx*my; //advance past vertices already in buffer
24322432

@@ -2902,7 +2902,7 @@ void WaterRenderObjClass::drawRiverWater(PolygonTrigger *pTrig)
29022902
DX8Wrapper::_Get_D3D_Device8()->SetRenderState(D3DRS_FILLMODE,D3DFILL_SOLID);
29032903
}
29042904

2905-
if (m_riverWaterPixelShader) DX8Wrapper::_Get_D3D_Device8()->SetPixelShader(nullptr);
2905+
if (m_riverWaterPixelShader) DX8Wrapper::_Get_D3D_Device8()->SetPixelShader(0);
29062906

29072907
//restore blend mode to what W3D expects.
29082908
if (TheWaterTransparency->m_additiveBlend)
@@ -3299,7 +3299,7 @@ void WaterRenderObjClass::drawTrapezoidWater(Vector3 points[4])
32993299
DX8Wrapper::_Get_D3D_Device8()->SetRenderState(D3DRS_FILLMODE,D3DFILL_SOLID);
33003300
}
33013301

3302-
if (m_riverWaterPixelShader) DX8Wrapper::_Get_D3D_Device8()->SetPixelShader(nullptr);
3302+
if (m_riverWaterPixelShader) DX8Wrapper::_Get_D3D_Device8()->SetPixelShader(0);
33033303
//Restore alpha blend to default values since we may have changed them to feather edges.
33043304
if (!TheWaterTransparency->m_additiveBlend)
33053305
{ DX8Wrapper::Set_DX8_Render_State(D3DRS_SRCBLEND, D3DBLEND_SRCALPHA );

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.

0 commit comments

Comments
 (0)