Skip to content

Commit 8967678

Browse files
committed
fix: change nullptr to appropriate values for non-pointer return types
1 parent 5449091 commit 8967678

File tree

7 files changed

+11
-11
lines changed

7 files changed

+11
-11
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ Bool RAMFile::open( File *file )
164164
//USE_PERF_TIMER(RAMFile)
165165
if ( file == nullptr )
166166
{
167-
return nullptr;
167+
return FALSE;
168168
}
169169

170170
const Int access = file->getAccess();

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ Bool W3DVideoBuffer::allocate( UnsignedInt width, UnsignedInt height )
129129

130130
if ( w3dFormat == WW3D_FORMAT_UNKNOWN )
131131
{
132-
return nullptr;
132+
return FALSE;
133133
}
134134

135135
m_texture = MSGNEW("TextureClass") TextureClass ( m_textureWidth, m_textureHeight, w3dFormat, MIP_LEVELS_1 );

Core/Tools/Autorun/WSYS_RAMFile.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ Bool RAMFile::open( File *file )
155155
{
156156
if ( file == nullptr )
157157
{
158-
return nullptr;
158+
return FALSE;
159159
}
160160

161161
Int access = file->getAccess();

Generals/Code/GameEngine/Source/GameLogic/AI/AIPathfind.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7518,7 +7518,7 @@ Bool Pathfinder::pathDestination( Object *obj, const LocomotorSet& locomotorSet
75187518
PathfindLayerEnum layer, const Coord3D *groupDest)
75197519
{
75207520
//CRCDEBUG_LOG(("Pathfinder::pathDestination()"));
7521-
if (m_isMapReady == false) return nullptr;
7521+
if (m_isMapReady == false) return false;
75227522

75237523
if (!obj) return false;
75247524

@@ -7812,7 +7812,7 @@ Int Pathfinder::checkPathCost(Object *obj, const LocomotorSet& locomotorSet, con
78127812
const Coord3D *rawTo)
78137813
{
78147814
//CRCDEBUG_LOG(("Pathfinder::checkPathCost()"));
7815-
if (m_isMapReady == false) return nullptr;
7815+
if (m_isMapReady == false) return 0;
78167816
enum {MAX_COST = 0x7fff0000};
78177817
if (!obj) return MAX_COST;
78187818

Generals/Code/GameEngine/Source/GameLogic/Map/TerrainLogic.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1814,7 +1814,7 @@ Bool TerrainLogic::objectInteractsWithBridgeLayer(Object *obj, Int layer, Bool c
18141814
//-------------------------------------------------------------------------------------------------
18151815
Bool TerrainLogic::objectInteractsWithBridgeEnd(Object *obj, Int layer) const
18161816
{
1817-
if (layer == LAYER_GROUND) return nullptr;
1817+
if (layer == LAYER_GROUND) return false;
18181818
Bridge *pBridge = getFirstBridge();
18191819

18201820
while (pBridge ) {

GeneralsMD/Code/GameEngine/Source/GameLogic/AI/AIPathfind.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7916,7 +7916,7 @@ Bool Pathfinder::pathDestination( Object *obj, const LocomotorSet& locomotorSet
79167916
PathfindLayerEnum layer, const Coord3D *groupDest)
79177917
{
79187918
//CRCDEBUG_LOG(("Pathfinder::pathDestination()"));
7919-
if (m_isMapReady == false) return nullptr;
7919+
if (m_isMapReady == false) return false;
79207920

79217921
if (!obj) return false;
79227922

@@ -8210,7 +8210,7 @@ Int Pathfinder::checkPathCost(Object *obj, const LocomotorSet& locomotorSet, con
82108210
const Coord3D *rawTo)
82118211
{
82128212
//CRCDEBUG_LOG(("Pathfinder::checkPathCost()"));
8213-
if (m_isMapReady == false) return nullptr;
8213+
if (m_isMapReady == false) return 0;
82148214
enum {MAX_COST = 0x7fff0000};
82158215
if (!obj) return MAX_COST;
82168216

@@ -8467,7 +8467,7 @@ Path *Pathfinder::findClosestPath( Object *obj, const LocomotorSet& locomotorSet
84678467
return nullptr;
84688468
}
84698469

8470-
if (m_isMapReady == false) return nullptr;
8470+
if (m_isMapReady == false) return false;
84718471

84728472
m_isTunneling = false;
84738473

@@ -10809,7 +10809,7 @@ Path *Pathfinder::findSafePath( const Object *obj, const LocomotorSet& locomotor
1080910809
const Coord3D *from, const Coord3D* repulsorPos1, const Coord3D* repulsorPos2, Real repulsorRadius)
1081010810
{
1081110811
//CRCDEBUG_LOG(("Pathfinder::findSafePath()"));
10812-
if (m_isMapReady == false) return nullptr; // Should always be ok.
10812+
if (m_isMapReady == false) return false; // Should always be ok.
1081310813
#if defined(RTS_DEBUG)
1081410814
// Int startTimeMS = ::GetTickCount();
1081510815
#endif

GeneralsMD/Code/GameEngine/Source/GameLogic/Map/TerrainLogic.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1814,7 +1814,7 @@ Bool TerrainLogic::objectInteractsWithBridgeLayer(Object *obj, Int layer, Bool c
18141814
//-------------------------------------------------------------------------------------------------
18151815
Bool TerrainLogic::objectInteractsWithBridgeEnd(Object *obj, Int layer) const
18161816
{
1817-
if (layer == LAYER_GROUND) return nullptr;
1817+
if (layer == LAYER_GROUND) return false;
18181818
Bridge *pBridge = getFirstBridge();
18191819

18201820
while (pBridge ) {

0 commit comments

Comments
 (0)