Skip to content

Commit 106e4a7

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

File tree

15 files changed

+236
-236
lines changed

15 files changed

+236
-236
lines changed

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/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

Core/Tools/Babylon/TransDB.cpp

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ LANGINFO *GetLangInfo ( int index )
5656
return &langinfo[index];
5757
}
5858

59-
return NULL;
59+
return nullptr;
6060
}
6161

6262
LANGINFO *GetLangInfo ( LangID langid )
@@ -74,7 +74,7 @@ LANGINFO *GetLangInfo ( LangID langid )
7474
item++;
7575
}
7676

77-
return NULL;
77+
return nullptr;
7878
}
7979

8080
const char *GetLangName ( LangID langid )
@@ -104,7 +104,7 @@ LANGINFO *GetLangInfo ( char *language )
104104
item++;
105105
}
106106

107-
return NULL;
107+
return nullptr;
108108
}
109109

110110
TransDB* FirstTransDB ( void )
@@ -116,7 +116,7 @@ TransDB* FirstTransDB ( void )
116116
{
117117
return (TransDB *) first->Item ();
118118
}
119-
return NULL;
119+
return nullptr;
120120
}
121121

122122
TransDB::TransDB ( const char *cname )
@@ -264,7 +264,7 @@ BabylonLabel* TransDB::FirstLabel ( ListSearch& sh )
264264
return (BabylonLabel *) node->Item ();
265265
}
266266

267-
return NULL;
267+
return nullptr;
268268
}
269269

270270
BabylonLabel* TransDB::NextLabel ( ListSearch& sh)
@@ -276,7 +276,7 @@ BabylonLabel* TransDB::NextLabel ( ListSearch& sh)
276276
return (BabylonLabel *) node->Item ();
277277
}
278278

279-
return NULL;
279+
return nullptr;
280280
}
281281

282282
BabylonText* TransDB::FirstObsolete ( ListSearch& sh )
@@ -288,7 +288,7 @@ BabylonText* TransDB::FirstObsolete ( ListSearch& sh )
288288
return (BabylonText *) node->Item ();
289289
}
290290

291-
return NULL;
291+
return nullptr;
292292
}
293293

294294
BabylonText* TransDB::NextObsolete ( ListSearch& sh)
@@ -300,7 +300,7 @@ BabylonText* TransDB::NextObsolete ( ListSearch& sh)
300300
return (BabylonText *) node->Item ();
301301
}
302302

303-
return NULL;
303+
return nullptr;
304304
}
305305

306306
BabylonLabel* TransDB::FindLabel ( OLECHAR *name )
@@ -347,7 +347,7 @@ BabylonText* TransDB::FindSubText ( OLECHAR *pattern, int item )
347347
label = NextLabel ( sh );
348348
}
349349

350-
return NULL;
350+
return nullptr;
351351

352352
}
353353

@@ -538,7 +538,7 @@ TransDB* TransDB::Next ( void )
538538
return (TransDB *) next->Item ();
539539
}
540540

541-
return NULL;
541+
return nullptr;
542542

543543
}
544544

@@ -668,7 +668,7 @@ BabylonText* BabylonLabel::FirstText ( ListSearch& sh )
668668
return (BabylonText *) node->Item ();
669669
}
670670

671-
return NULL;
671+
return nullptr;
672672
}
673673

674674
BabylonText* BabylonLabel::NextText ( ListSearch& sh)
@@ -680,7 +680,7 @@ BabylonText* BabylonLabel::NextText ( ListSearch& sh)
680680
return (BabylonText *) node->Item ();
681681
}
682682

683-
return NULL;
683+
return nullptr;
684684

685685
}
686686

@@ -700,7 +700,7 @@ BabylonText* BabylonLabel::FindText ( OLECHAR *find_text )
700700
txt = NextText ( sh );
701701
}
702702

703-
return NULL;
703+
return nullptr;
704704
}
705705

706706

@@ -1088,7 +1088,7 @@ Translation* BabylonText::FirstTranslation ( ListSearch& sh )
10881088
return (Translation *) node->Item ();
10891089
}
10901090

1091-
return NULL;
1091+
return nullptr;
10921092
}
10931093

10941094
Translation* BabylonText::NextTranslation ( ListSearch& sh)
@@ -1100,7 +1100,7 @@ Translation* BabylonText::NextTranslation ( ListSearch& sh)
11001100
return (Translation *) node->Item ();
11011101
}
11021102

1103-
return NULL;
1103+
return nullptr;
11041104
}
11051105

11061106
Translation* BabylonText::GetTranslation ( LangID langid )

Core/Tools/WW3D/max2w3d/SkinCopy.cpp

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ SkinModifierClass *find_skin_binding (INode *skinned_obj)
236236
// WSM Derived Object for the WWSkin Binding modifier.
237237
IDerivedObject *dobj = skinned_obj->GetWSMDerivedObject();
238238
if (dobj == nullptr)
239-
return NULL; // not bound to a space warp
239+
return nullptr; // not bound to a space warp
240240

241241
// Search for the WWSkin Binding modifier on this derived object.
242242
for (int i = 0; i < dobj->NumModifiers(); i++)
@@ -250,7 +250,7 @@ SkinModifierClass *find_skin_binding (INode *skinned_obj)
250250
}
251251

252252
// Skin modifier not found.
253-
return NULL;
253+
return nullptr;
254254
}
255255

256256

@@ -271,7 +271,7 @@ INode *find_skin_wsm (INode *skinned_obj)
271271
// Find the skin modifier on this object.
272272
SkinModifierClass *skin_mod = find_skin_binding(skinned_obj);
273273
if (skin_mod == nullptr)
274-
return NULL;
274+
return nullptr;
275275

276276
// Using the skin modifer, find the WSM's INode.
277277
INode *wsm = (INode*)( skin_mod->GetReference(SkinModifierClass::NODE_REF) );
@@ -303,12 +303,12 @@ SkinWSMObjectClass *get_skin_wsm_obj (INode *wsm_node)
303303
{
304304
// We need a valid node.
305305
if (!wsm_node)
306-
return NULL;
306+
return nullptr;
307307

308308
// The node must reference an object.
309309
Object *obj = wsm_node->GetObjectRef();
310310
if (!obj)
311-
return NULL;
311+
return nullptr;
312312

313313
// That BASE object must be a SkinWSMObject
314314
while (obj)
@@ -321,7 +321,7 @@ SkinWSMObjectClass *get_skin_wsm_obj (INode *wsm_node)
321321
break;
322322
}
323323
if (obj->ClassID() != SKIN_OBJ_CLASS_ID)
324-
return NULL;
324+
return nullptr;
325325

326326
// Return it.
327327
return (SkinWSMObjectClass*)obj;
@@ -349,7 +349,7 @@ INode *duplicate_wsm (INode *wsm_node, INode *tree)
349349
SkinWSMObjectClass *wsm_obj = get_skin_wsm_obj(wsm_node);
350350

351351
if (!wsm_node || !wsm_obj)
352-
return NULL;
352+
return nullptr;
353353

354354
/*
355355
** Duplicate the WSM.
@@ -358,20 +358,20 @@ INode *duplicate_wsm (INode *wsm_node, INode *tree)
358358
SkinWSMObjectClass *new_wsm_obj =
359359
(SkinWSMObjectClass*)CreateInstance(WSM_OBJECT_CLASS_ID, SKIN_OBJ_CLASS_ID);
360360
if (!new_wsm_obj)
361-
return NULL;
361+
return nullptr;
362362

363363
// Create a new node in the scene that points to the new WSM object.
364364
INode *new_wsm_node = MAXScript_interface->CreateObjectNode(new_wsm_obj);
365365
if (!new_wsm_node)
366-
return NULL;
366+
return nullptr;
367367

368368
// Copy the bones from one to the other.
369369
for (int i = 0; i < wsm_obj->Num_Bones(); i++)
370370
{
371371
INode *src_bone = wsm_obj->Get_Bone(i);
372372
INode *dst_bone = find_equivalent_node(src_bone, tree);
373373
if (!src_bone || !dst_bone)
374-
return NULL;
374+
return nullptr;
375375

376376
new_wsm_obj->Add_Bone(dst_bone);
377377
}
@@ -398,7 +398,7 @@ INode *find_equivalent_node (INode *source, INode *tree, bool name_is_valid)
398398
{
399399
// We need a valid source and tree.
400400
if (!source || !tree)
401-
return NULL;
401+
return nullptr;
402402

403403
// The name of the source object. We'll only evaluate this once as an easy optimization.
404404
static char src_name[W3D_NAME_LEN];
@@ -422,7 +422,7 @@ INode *find_equivalent_node (INode *source, INode *tree, bool name_is_valid)
422422
}
423423

424424
// No equivalent node was found.
425-
return NULL;
425+
return nullptr;
426426
}
427427

428428

@@ -503,13 +503,13 @@ ModContext *find_skin_mod_context (INode *node)
503503
{
504504
// We need a valid node
505505
if (node == nullptr)
506-
return NULL;
506+
return nullptr;
507507

508508
// The node needs to be bound to a space warp (ie. must have
509509
// a WSMDerivedObject).
510510
IDerivedObject *dobj = node->GetWSMDerivedObject();
511511
if (dobj == nullptr)
512-
return NULL;
512+
return nullptr;
513513

514514
// It's bound to a space warp. Find the WWSkin modifier.
515515
for (int i = 0; i < dobj->NumModifiers(); i++)
@@ -523,5 +523,5 @@ ModContext *find_skin_mod_context (INode *node)
523523
}
524524

525525
// We didn't find a WWSkin binding.
526-
return NULL;
526+
return nullptr;
527527
}

0 commit comments

Comments
 (0)