Skip to content

Commit f061e2b

Browse files
committed
refactor: convert return NULL to return nullptr
1 parent cfc97a1 commit f061e2b

File tree

172 files changed

+538
-538
lines changed

Some content is hidden

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

172 files changed

+538
-538
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/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 nullptr;
168168
}
169169

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

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/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 nullptr;
133133
}
134134

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

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ inline VertexMaterialClass * MaterialInfoClass::Get_Vertex_Material(const char *
252252
{
253253
int index = Get_Vertex_Material_Index(name);
254254
if (index == -1) {
255-
return NULL;
255+
return nullptr;
256256
} else {
257257
return Get_Vertex_Material(index);
258258
}
@@ -269,7 +269,7 @@ inline VertexMaterialClass * MaterialInfoClass::Peek_Vertex_Material(const char
269269
{
270270
int index = Get_Vertex_Material_Index(name);
271271
if (index == -1) {
272-
return NULL;
272+
return nullptr;
273273
} else {
274274
return Peek_Vertex_Material(index);
275275
}
@@ -309,7 +309,7 @@ inline TextureClass * MaterialInfoClass::Get_Texture(const char * name)
309309
{
310310
int index = Get_Texture_Index(name);
311311
if (index == -1) {
312-
return NULL;
312+
return nullptr;
313313
} else {
314314
return Get_Texture(index);
315315
}

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ class RenderObjClass : public RefCountClass , public PersistClass, public MultiL
229229
virtual int Class_ID(void) const { return CLASSID_UNKNOWN; }
230230
virtual const char * Get_Name(void) const { return "UNNAMED"; }
231231
virtual void Set_Name(const char * name) { }
232-
virtual const char * Get_Base_Model_Name (void) const { return NULL; }
232+
virtual const char * Get_Base_Model_Name (void) const { return nullptr; }
233233
virtual void Set_Base_Model_Name (const char *name) { }
234234
virtual int Get_Num_Polys(void) const { return 0; }
235235

@@ -287,13 +287,13 @@ class RenderObjClass : public RefCountClass , public PersistClass, public MultiL
287287
virtual void Notify_Removed(SceneClass * scene);
288288

289289
virtual int Get_Num_Sub_Objects(void) const { return 0; }
290-
virtual RenderObjClass * Get_Sub_Object(int index) const { return NULL; }
290+
virtual RenderObjClass * Get_Sub_Object(int index) const { return nullptr; }
291291
virtual int Add_Sub_Object(RenderObjClass * subobj) { return 0; }
292292
virtual int Remove_Sub_Object(RenderObjClass * robj) { return 0; }
293293
virtual RenderObjClass * Get_Sub_Object_By_Name(const char * name, int *index=nullptr) const;
294294

295295
virtual int Get_Num_Sub_Objects_On_Bone(int boneindex) const { return 0; }
296-
virtual RenderObjClass * Get_Sub_Object_On_Bone(int index,int boneindex) const { return NULL; }
296+
virtual RenderObjClass * Get_Sub_Object_On_Bone(int index,int boneindex) const { return nullptr; }
297297
virtual int Get_Sub_Object_Bone_Index(RenderObjClass * subobj) const { return 0; }
298298
virtual int Get_Sub_Object_Bone_Index(int LodIndex, int ModelIndex) const { return 0; }
299299
virtual int Add_Sub_Object_To_Bone(RenderObjClass * subobj,int bone_index) { return 0; }
@@ -330,9 +330,9 @@ class RenderObjClass : public RefCountClass , public PersistClass, public MultiL
330330
float percentage) { }
331331
virtual void Set_Animation( HAnimComboClass * anim_combo) { }
332332

333-
virtual HAnimClass * Peek_Animation( void ) { return NULL; }
333+
virtual HAnimClass * Peek_Animation( void ) { return nullptr; }
334334
virtual int Get_Num_Bones(void) { return 0; }
335-
virtual const char * Get_Bone_Name(int bone_index) { return NULL; }
335+
virtual const char * Get_Bone_Name(int bone_index) { return nullptr; }
336336
virtual int Get_Bone_Index(const char * bonename) { return 0; }
337337
virtual const Matrix3D & Get_Bone_Transform(const char * bonename) { return Get_Transform(); }
338338
virtual const Matrix3D & Get_Bone_Transform(int boneindex) { return Get_Transform(); }
@@ -342,7 +342,7 @@ class RenderObjClass : public RefCountClass , public PersistClass, public MultiL
342342
virtual void Release_Bone(int bindex) { }
343343
virtual bool Is_Bone_Captured(int bindex) const { return false; }
344344
virtual void Control_Bone(int bindex,const Matrix3D & objtm,bool world_space_translation = false) { }
345-
virtual const HTreeClass * Get_HTree(void) const { return NULL; }
345+
virtual const HTreeClass * Get_HTree(void) const { return nullptr; }
346346

347347
///////////////////////////////////////////////////////////////////////////////////////////////////////////////
348348
// Render Object Interface - Collision Detection
@@ -423,7 +423,7 @@ class RenderObjClass : public RefCountClass , public PersistClass, public MultiL
423423
///////////////////////////////////////////////////////////////////////////////////////////////////////////////
424424
// Render Object Interface - Attributes, Options, Properties, etc
425425
///////////////////////////////////////////////////////////////////////////////////////////////////////////////
426-
virtual MaterialInfoClass * Get_Material_Info(void) { return NULL; }
426+
virtual MaterialInfoClass * Get_Material_Info(void) { return nullptr; }
427427
virtual void Set_User_Data(void *value, bool recursive = false) { User_Data = value; };
428428
virtual void * Get_User_Data() { return User_Data; };
429429
virtual int Get_Num_Snap_Points(void) { return 0; }

Core/Libraries/Source/WWVegas/WWAudio/SoundSceneObj.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -104,11 +104,11 @@ class SoundSceneObjClass : public MultiListObjectClass, public PersistClass, pub
104104
//////////////////////////////////////////////////////////////////////
105105
// Conversion methods
106106
//////////////////////////////////////////////////////////////////////
107-
virtual Sound3DClass * As_Sound3DClass (void) { return NULL; }
108-
virtual SoundPseudo3DClass * As_SoundPseudo3DClass (void) { return NULL; }
109-
virtual FilteredSoundClass * As_FilteredSoundClass (void) { return NULL; }
110-
virtual Listener3DClass * As_Listener3DClass (void) { return NULL; }
111-
virtual AudibleSoundClass * As_AudibleSoundClass(void) { return NULL; }
107+
virtual Sound3DClass * As_Sound3DClass (void) { return nullptr; }
108+
virtual SoundPseudo3DClass * As_SoundPseudo3DClass (void) { return nullptr; }
109+
virtual FilteredSoundClass * As_FilteredSoundClass (void) { return nullptr; }
110+
virtual Listener3DClass * As_Listener3DClass (void) { return nullptr; }
111+
virtual AudibleSoundClass * As_AudibleSoundClass(void) { return nullptr; }
112112

113113
//////////////////////////////////////////////////////////////////////
114114
// Identification methods

Core/Libraries/Source/WWVegas/WWAudio/soundhandle.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -70,17 +70,17 @@ class SoundHandleClass
7070
//
7171
// RTTI
7272
//
73-
virtual Sound3DHandleClass * As_Sound3DHandleClass (void) { return NULL; }
74-
virtual Sound2DHandleClass * As_Sound2DHandleClass (void) { return NULL; }
75-
virtual SoundStreamHandleClass * As_SoundStreamHandleClass (void) { return NULL; }
76-
virtual ListenerHandleClass * As_ListenerHandleClass (void) { return NULL; }
73+
virtual Sound3DHandleClass * As_Sound3DHandleClass (void) { return nullptr; }
74+
virtual Sound2DHandleClass * As_Sound2DHandleClass (void) { return nullptr; }
75+
virtual SoundStreamHandleClass * As_SoundStreamHandleClass (void) { return nullptr; }
76+
virtual ListenerHandleClass * As_ListenerHandleClass (void) { return nullptr; }
7777

7878
//
7979
// Handle access
8080
//
81-
virtual H3DSAMPLE Get_H3DSAMPLE (void) { return NULL; }
82-
virtual HSAMPLE Get_HSAMPLE (void) { return NULL; }
83-
virtual HSTREAM Get_HSTREAM (void) { return NULL; }
81+
virtual H3DSAMPLE Get_H3DSAMPLE (void) { return nullptr; }
82+
virtual HSAMPLE Get_HSAMPLE (void) { return nullptr; }
83+
virtual HSTREAM Get_HSTREAM (void) { return nullptr; }
8484

8585
//
8686
// Initialization

0 commit comments

Comments
 (0)