Skip to content

Commit 07cd34d

Browse files
committed
Remove return redundant logic.
Remove all the redundant return logic I could find in the project. This should help resolve refactor #1778.
1 parent 15d0fbe commit 07cd34d

File tree

10 files changed

+11
-58
lines changed

10 files changed

+11
-58
lines changed

Core/Libraries/Source/WWVegas/WWDownload/FTP.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1813,7 +1813,6 @@ void Cftp::GetDownloadFilename(const char *localname, char *downloadname)
18131813
name.replace(" ","_");
18141814
sprintf(downloadname,"download\\%s_%d.tmp",name.get(),m_iFileSize);
18151815
*/
1816-
return;
18171816
}
18181817

18191818

Core/Tools/WW3D/max2w3d/GameMtl.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1081,7 +1081,6 @@ void GameMtl::SetReference(int i, RefTargetHandle rtarg)
10811081
int stage = offset % 2;
10821082
Texture[pass][stage] = (Texmap *)rtarg;
10831083
}
1084-
return;
10851084
}
10861085
}
10871086

Core/Tools/WW3D/max2w3d/MeshDeform.cpp

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,6 @@ MeshDeformClass::ModifyObject
152152
tri_obj->UpdateValidity (GEOM_CHAN_NUM, Interval (time, time + 1));
153153
tri_obj->UpdateValidity (SELECT_CHAN_NUM, Interval (time, time + 1));
154154
tri_obj->UpdateValidity (SUBSEL_TYPE_CHAN_NUM, Interval (time, time + 1));
155-
return ;
156155
}
157156

158157

@@ -257,7 +256,6 @@ MeshDeformClass::BeginEditParams
257256
// Restore the selection level.
258257
///
259258
max_interface->SetSubObjectLevel (1);
260-
return ;
261259
}
262260

263261

@@ -299,7 +297,6 @@ MeshDeformClass::EndEditParams
299297
// Release our hold on the max interface pointer
300298
m_MaxInterface = NULL;
301299
m_pPanel = NULL;
302-
return ;
303300
}
304301

305302

@@ -339,7 +336,6 @@ MeshDeformClass::ActivateSubobjSel
339336
** display attributes, and subselection type channels have changed
340337
*/
341338
NotifyDependents(FOREVER, VERTCOLOR_CHANNEL|SELECT_CHANNEL|DISP_ATTRIB_CHANNEL|SUBSEL_TYPE_CHANNEL, REFMSG_CHANGE);
342-
return ;
343339
}
344340

345341

@@ -453,7 +449,6 @@ MeshDeformClass::SelectSubComponent
453449
m_pPanel->Update_Vertex_Color ();
454450
NotifyDependents (FOREVER, PART_SELECT, REFMSG_CHANGE);
455451
m_bSetDirty = true;
456-
return ;
457452
}
458453

459454

@@ -472,7 +467,6 @@ MeshDeformClass::GetSubObjectTMs
472467
)
473468
{
474469
int test = 0;
475-
return ;
476470
}
477471

478472

@@ -509,7 +503,6 @@ MeshDeformClass::GetSubObjectCenters
509503

510504
// Pass the 'selection' center onto MAX
511505
callback->Center (box.Center (), 0);
512-
return ;
513506
}
514507

515508

@@ -544,7 +537,6 @@ MeshDeformClass::ClearSelection (int selLevel)
544537
*/
545538
NotifyDependents (FOREVER, PART_SELECT, REFMSG_CHANGE);
546539
m_bSetDirty = true;
547-
return ;
548540
}
549541

550542
static Point3 last_delta;
@@ -618,7 +610,6 @@ MeshDeformClass::Move
618610
}
619611

620612
m_OperationName = "Move";
621-
return ;
622613
}
623614

624615

@@ -692,7 +683,6 @@ MeshDeformClass::Scale
692683
}
693684

694685
m_OperationName = "Scale";
695-
return ;
696686
}
697687

698688

@@ -772,7 +762,6 @@ MeshDeformClass::Rotate
772762
}
773763

774764
m_OperationName = "Rotate";
775-
return ;
776765
}
777766

778767

@@ -826,7 +815,6 @@ MeshDeformClass::TransformStart (TimeValue time_val)
826815
// Repaint the view
827816
nodes.DisposeTemporary ();
828817
NotifyDependents (FOREVER, PART_GEOM, REFMSG_CHANGE);
829-
return ;
830818
}
831819

832820

@@ -844,7 +832,6 @@ MeshDeformClass::TransformFinish (TimeValue time_val)
844832

845833
// Accept the undo operation
846834
theHold.Accept (m_OperationName);
847-
return ;
848835
}
849836

850837

@@ -862,7 +849,6 @@ MeshDeformClass::TransformCancel (TimeValue time_val)
862849

863850
// Cancel the undo operation
864851
theHold.Cancel ();
865-
return ;
866852
}
867853

868854

@@ -882,8 +868,6 @@ MeshDeformClass::Set_Deform_State (float state)
882868
m_pPanel->Update_Vertex_Color ();
883869
}
884870
}
885-
886-
return ;
887871
}
888872

889873

@@ -961,7 +945,6 @@ MeshDeformClass::Set_Vertex_Color (const Point3 &color, bool button_up)
961945
}
962946

963947
m_VertColorChanging = !button_up;
964-
return ;
965948
}
966949

967950

@@ -1030,8 +1013,6 @@ MeshDeformClass::Get_Vertex_Color (Point3 &color)
10301013

10311014
nodes.DisposeTemporary ();
10321015
}
1033-
1034-
return ;
10351016
}
10361017

10371018

@@ -1057,8 +1038,6 @@ MeshDeformClass::Update_UI (MeshDeformModData *mod_data)
10571038
m_pPanel->Set_Current_Set (m_CurrentSet);
10581039
m_pPanel->Set_Current_State (m_DeformState);
10591040
}
1060-
1061-
return ;
10621041
}
10631042

10641043

@@ -1092,8 +1071,6 @@ MeshDeformClass::Auto_Apply (bool auto_apply)
10921071
// Cleanup
10931072
nodes.DisposeTemporary ();
10941073
}
1095-
1096-
return ;
10971074
}
10981075

10991076

@@ -1137,8 +1114,6 @@ MeshDeformClass::Set_Max_Deform_Sets (int max)
11371114
NotifyDependents (FOREVER, PART_SELECT, REFMSG_CHANGE);
11381115
m_MaxInterface->RedrawViews (m_MaxInterface->GetTime ());
11391116
}
1140-
1141-
return ;
11421117
}
11431118

11441119

@@ -1173,8 +1148,6 @@ MeshDeformClass::Update_Set_Count (void)
11731148
// Cleanup
11741149
nodes.DisposeTemporary ();
11751150
}
1176-
1177-
return ;
11781151
}
11791152

11801153

@@ -1231,8 +1204,6 @@ MeshDeformClass::Set_Current_Set
12311204
// Update the current 'vertex color' on the UI panel
12321205
m_pPanel->Update_Vertex_Color ();
12331206
}
1234-
1235-
return ;
12361207
}
12371208

12381209

@@ -1268,8 +1239,6 @@ MeshDeformClass::Update_Current_Set (void)
12681239
nodes.DisposeTemporary ();
12691240
m_bSetDirty = false;
12701241
}
1271-
1272-
return ;
12731242
}
12741243

12751244

@@ -1332,7 +1301,6 @@ void SkinModifierClass::SelectAll(int selLevel)
13321301

13331302
case OBJECT_SEL_LEVEL:
13341303
assert(0);
1335-
return;
13361304

13371305
case VERTEX_SEL_LEVEL:
13381306
#if 0 // undo/redo
@@ -1386,7 +1354,6 @@ void SkinModifierClass::InvertSelection(int selLevel)
13861354

13871355
case OBJECT_SEL_LEVEL:
13881356
assert(0);
1389-
return;
13901357

13911358
case VERTEX_SEL_LEVEL:
13921359
#if 0 // undo/redo

Core/Tools/WW3D/max2w3d/skin.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1138,7 +1138,6 @@ void SkinModifierClass::ClearSelection(int selLevel)
11381138
#if 0
11391139
case OBJECT_SEL_LEVEL:
11401140
assert(0);
1141-
return;
11421141
#endif
11431142

11441143
case VERTEX_SEL_LEVEL:
@@ -1194,7 +1193,6 @@ void SkinModifierClass::SelectAll(int selLevel)
11941193

11951194
case OBJECT_SEL_LEVEL:
11961195
assert(0);
1197-
return;
11981196

11991197
case VERTEX_SEL_LEVEL:
12001198
#if 0 // undo/redo
@@ -1248,7 +1246,6 @@ void SkinModifierClass::InvertSelection(int selLevel)
12481246

12491247
case OBJECT_SEL_LEVEL:
12501248
assert(0);
1251-
return;
12521249

12531250
case VERTEX_SEL_LEVEL:
12541251
#if 0 // undo/redo

Core/Tools/WW3D/max2w3d/util.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,6 @@ void Split_Node_Name(const char * name,char * set_base,char * set_exten,int * se
180180

181181
// no extension, just copy the base name
182182
if (set_base != NULL) strncpy(set_base,buf,MAX_NODE_NAME_LEN);
183-
return;
184183
}
185184
}
186185

Core/Tools/WW3D/max2w3d/vxl.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -524,7 +524,6 @@ void VoxelClass::raw_set_vis(
524524
if (k>=(int)ZDim) return;
525525

526526
VisData[i + j*XDim + k*XDim*YDim] = val;
527-
return;
528527
}
529528

530529

Core/Tools/WW3D/max2w3d/w3dmtl.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,6 @@ void W3dMapClass::Set_Anim_Info(const W3dTextureInfoStruct * info)
116116
if (AnimInfo) {
117117
delete AnimInfo;
118118
AnimInfo = NULL;
119-
return;
120119
}
121120
} else {
122121
if (AnimInfo == NULL) {

Core/Tools/WW3D/pluglib/WWmatrix3.cpp

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -355,25 +355,22 @@ void Matrix3::Re_Orthogonalize(void)
355355
if (len < WWMATH_EPSILON) {
356356
Make_Identity();
357357
return;
358-
} else {
359-
x /= len;
360358
}
359+
x /= len;
361360

362361
len = y.Length();
363362
if (len < WWMATH_EPSILON) {
364363
Make_Identity();
365364
return;
366-
} else {
367-
y /= len;
368365
}
366+
y /= len;
369367

370368
len = z.Length();
371369
if (len < WWMATH_EPSILON) {
372370
Make_Identity();
373371
return;
374-
} else {
375-
z /= len;
376372
}
373+
z /= len;
377374

378375
Row[0][0] = x.X;
379376
Row[0][1] = x.Y;

Core/Tools/WW3D/pluglib/matrix3d.cpp

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -782,25 +782,22 @@ void Matrix3D::Re_Orthogonalize(void)
782782
if (len < WWMATH_EPSILON) {
783783
Make_Identity();
784784
return;
785-
} else {
786-
x *= 1.0f/len;
787785
}
786+
x *= 1.0f/len;
788787

789788
len = y.Length();
790789
if (len < WWMATH_EPSILON) {
791790
Make_Identity();
792791
return;
793-
} else {
794-
y *= 1.0f/len;
795792
}
793+
y *= 1.0f/len;
796794

797795
len = z.Length();
798796
if (len < WWMATH_EPSILON) {
799797
Make_Identity();
800798
return;
801-
} else {
802-
z *= 1.0f/len;
803799
}
800+
z *= 1.0f/len;
804801

805802
Row[0][0] = x.X;
806803
Row[0][1] = x.Y;

Core/Tools/WW3D/pluglib/w3dquat.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -116,12 +116,12 @@ void Quaternion::Normalize()
116116

117117
if (0.0f == mag) {
118118
return;
119-
} else {
120-
X /= mag;
121-
Y /= mag;
122-
Z /= mag;
123-
W /= mag;
124119
}
120+
121+
X /= mag;
122+
Y /= mag;
123+
Z /= mag;
124+
W /= mag;
125125
}
126126

127127
/***********************************************************************************************

0 commit comments

Comments
 (0)