Skip to content

Commit 2b44d0b

Browse files
committed
refactor: convert return NULL to return nullptr
fix: change nullptr to 0 for unsigned return type in GetLine fix: change nullptr to appropriate values for non-pointer return types fix: change false to nullptr for Path* return types in AIPathfind fix: change nullptr to false for Bool return type in pathDestination fix: correct nullptr to FALSE in Bool isPatchShadowed function
1 parent 09154e0 commit 2b44d0b

File tree

168 files changed

+532
-532
lines changed

Some content is hidden

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

168 files changed

+532
-532
lines changed

Core/GameEngine/Include/Common/AudioEventInfo.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,8 @@ struct AudioEventInfo : public MemoryPoolObject
123123

124124
// DynamicAudioEventInfo interfacing functions
125125
virtual Bool isLevelSpecific() const { return false; } ///< If true, this sound is only defined on the current level and can be deleted when that level ends
126-
virtual DynamicAudioEventInfo * getDynamicAudioEventInfo() { return NULL; } ///< If this object is REALLY a DynamicAudioEventInfo, return a pointer to the derived class
127-
virtual const DynamicAudioEventInfo * getDynamicAudioEventInfo() const { return NULL; } ///< If this object is REALLY a DynamicAudioEventInfo, return a pointer to the derived class
126+
virtual DynamicAudioEventInfo * getDynamicAudioEventInfo() { return nullptr; } ///< If this object is REALLY a DynamicAudioEventInfo, return a pointer to the derived class
127+
virtual const DynamicAudioEventInfo * getDynamicAudioEventInfo() const { return nullptr; } ///< If this object is REALLY a DynamicAudioEventInfo, return a pointer to the derived class
128128

129129
/// Is this a permenant sound? That is, if I start this sound up, will it ever end
130130
/// "on its own" or only if I explicitly kill it?

Core/GameEngine/Include/Common/GameAudio.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,7 @@ class AudioManagerDummy : public AudioManager
395395
virtual AsciiString getMusicTrackName() const { return ""; }
396396
virtual void openDevice() {}
397397
virtual void closeDevice() {}
398-
virtual void* getDevice() { return NULL; }
398+
virtual void* getDevice() { return nullptr; }
399399
virtual void notifyOfAudioCompletion(UnsignedInt audioCompleted, UnsignedInt flags) {}
400400
virtual UnsignedInt getProviderCount(void) const { return 0; };
401401
virtual AsciiString getProviderName(UnsignedInt providerNum) const { return ""; }
@@ -416,7 +416,7 @@ class AudioManagerDummy : public AudioManager
416416
virtual void removePlayingAudio(AsciiString eventName) {}
417417
virtual void removeAllDisabledAudio() {}
418418
virtual Bool has3DSensitiveStreamsPlaying(void) const { return false; }
419-
virtual void* getHandleForBink(void) { return NULL; }
419+
virtual void* getHandleForBink(void) { return nullptr; }
420420
virtual void releaseHandleForBink(void) {}
421421
virtual void friend_forcePlayAudioEventRTS(const AudioEventRTS* eventToPlay) {}
422422
virtual void setPreferredProvider(AsciiString providerNdx) {}

Core/GameEngine/Include/Common/StreamingArchiveFile.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ class StreamingArchiveFile : public RAMFile
9999
virtual Bool openFromArchive(File *archiveFile, const AsciiString& filename, Int offset, Int size); ///< copy file data from the given file at the given offset for the given size.
100100
virtual Bool copyDataToFile(File *localFile) { DEBUG_CRASH(("Are you sure you meant to copyDataToFile on a streaming file?")); return FALSE; }
101101

102-
virtual char* readEntireAndClose() { DEBUG_CRASH(("Are you sure you meant to readEntireAndClose on a streaming file?")); return NULL; }
102+
virtual char* readEntireAndClose() { DEBUG_CRASH(("Are you sure you meant to readEntireAndClose on a streaming file?")); return nullptr; }
103103
virtual File* convertToRAMFile() { DEBUG_CRASH(("Are you sure you meant to readEntireAndClose on a streaming file?")); return this; }
104104
};
105105

Core/GameEngine/Include/GameClient/TerrainVisual.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -285,8 +285,8 @@ class TerrainVisual : public Snapshot,
285285
virtual void updateSeismicSimulations( void ) = 0; /// walk the SeismicSimulationList and, well, do it.
286286
virtual void addSeismicSimulation( const SeismicSimulationNode& sim ) = 0;
287287
#endif
288-
virtual WorldHeightMap* getLogicHeightMap( void ) {return NULL;};
289-
virtual WorldHeightMap* getClientHeightMap( void ) {return NULL;};
288+
virtual WorldHeightMap* getLogicHeightMap( void ) {return nullptr;};
289+
virtual WorldHeightMap* getClientHeightMap( void ) {return nullptr;};
290290
////////////////////////////////////////////////////
291291
////////////////////////////////////////////////////
292292
////////////////////////////////////////////////////

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 NULL;
167+
return FALSE;
168168
}
169169

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

Core/GameEngine/Source/GameClient/MapUtil.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1222,7 +1222,7 @@ Image *getMapPreviewImage( AsciiString mapName )
12221222
/*
12231223
// sanity
12241224
if( mapName.isEmpty() )
1225-
return NULL;
1225+
return nullptr;
12261226
Region2D uv;
12271227
mapPreviewImage = TheMappedImageCollection->findImageByName("MapPreview");
12281228
if(mapPreviewImage)
@@ -1258,15 +1258,15 @@ Image *getMapPreviewImage( AsciiString mapName )
12581258
if (!file.parse(nullptr)) {
12591259
DEBUG_ASSERTCRASH(false,("Unable to read MapPreview info."));
12601260
deleteInstance(mapPreviewImage);
1261-
return NULL;
1261+
return nullptr;
12621262
}
12631263
}
12641264
theInputStream.close();
12651265
}
12661266
else
12671267
{
12681268
deleteInstance(mapPreviewImage);
1269-
return NULL;
1269+
return nullptr;
12701270
}
12711271
12721272

Core/GameEngine/Source/GameNetwork/NetMessageStream.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -109,16 +109,16 @@ Bool AddToNetCommandList(Int playerNum, GameMessage *msg, UnsignedInt timestamp)
109109
static GameMessage * GetCommandMsg(UnsignedInt timestamp, CommandMsg *& CommandHead, CommandMsg *& CommandTail)
110110
{
111111
if (!CommandHead)
112-
return NULL;
112+
return nullptr;
113113
114114
if (CommandHead->GetTimestamp() < timestamp)
115115
{
116116
DEBUG_LOG(("Time is %d, yet message timestamp is %d!", timestamp, CommandHead->GetTimestamp()));
117-
return NULL;
117+
return nullptr;
118118
}
119119
120120
if (CommandHead->GetTimestamp() != timestamp)
121-
return NULL;
121+
return nullptr;
122122
123123
CommandMsg *theMsg = CommandHead;
124124
@@ -143,7 +143,7 @@ static GameMessage * GetCommandMsg(UnsignedInt timestamp, CommandMsg *& CommandH
143143
GameMessage * GetCommandMsg(UnsignedInt timestamp, Int playerNum)
144144
{
145145
if (playerNum < 0 || playerNum >= MAX_SLOTS)
146-
return NULL;
146+
return nullptr;
147147
148148
//DEBUG_LOG(("Adding msg to NetCommandList %d", playerNum));
149149
return GetCommandMsg(timestamp, CommandHead[playerNum], CommandTail[playerNum]);

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -455,7 +455,7 @@ static Real computeTrackSpacing(RenderObjClass *renderObj)
455455
//=============================================================================
456456
//TerrainTracksRenderObjClassSystem::bindTrack
457457
//=============================================================================
458-
/** Grab a track from the free store. If no free tracks exist, return NULL.
458+
/** Grab a track from the free store. If no free tracks exist, return nullptr.
459459
As long as a track is bound to an object (like a tank) it is ready to accept
460460
updates with additional edges. Once it is unbound, it will expire and return
461461
to the free store once all tracks have faded out.

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 NULL;
132+
return FALSE;
133133
}
134134

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

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -482,7 +482,7 @@ Int WaterTracksObj::render(DX8VertexBufferClass *vertexBuffer, Int batchStart)
482482
//=============================================================================
483483
//WaterTracksRenderSystem::bindTrack
484484
//=============================================================================
485-
/** Grab a track from the free store. If no free tracks exist, return NULL.
485+
/** Grab a track from the free store. If no free tracks exist, return nullptr.
486486
As long as a track is bound to an object (like a tank) it is ready to accept
487487
updates with additional edges. Once it is unbound, it will expire and return
488488
to the free store once all tracks have faded out.

0 commit comments

Comments
 (0)