Skip to content

Commit 2cb7eaa

Browse files
committed
fix(warn): Fix C4458, variable hiding class member.
1 parent 66a5429 commit 2cb7eaa

File tree

13 files changed

+85
-84
lines changed

13 files changed

+85
-84
lines changed

Code/Commando/AutoStart.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -296,9 +296,9 @@ void AutoRestartClass::Think(void)
296296
}
297297
LogonAction = (WOLLogonAction) -1;
298298
WOLLogonMgr::Set_Quiet_Mode(true);
299-
RefPtr<WWOnline::Session> WOLSession = WWOnline::Session::GetInstance(true);
300-
if (WOLSession.IsValid()) {
301-
Observer<WWOnline::ServerError>::NotifyMe(*WOLSession);
299+
RefPtr<WWOnline::Session> wol_session = WWOnline::Session::GetInstance(true);
300+
if (wol_session.IsValid()) {
301+
Observer<WWOnline::ServerError>::NotifyMe(*wol_session);
302302
WOLLogonMgr::Logon(this);
303303
RestartState = STATE_LOGIN;
304304
} else {

Code/Commando/wolgmode.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1274,7 +1274,6 @@ void WolGameModeClass::Ban_Player(const wchar_t* name, unsigned int ip)
12741274
fwrite(pn.Peek_Buffer(), 1, pn.Get_Length(), kick_list);
12751275
fclose(kick_list);
12761276
}
1277-
DynamicVectorClass<unsigned int> KickIPList;
12781277
}
12791278
}
12801279
}

Code/Scripts/Mission02.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3399,8 +3399,8 @@ DECLARE_SCRIPT (M02_Nod_Soldier, "Area_Number:int,Area_Officer:int,Pre_Placed:in
33993399

34003400
// Set the unit's home point, save the value.
34013401

3402-
Vector3 my_home_point = Commands->Get_Position(obj);
3403-
Commands->Set_Innate_Soldier_Home_Location(obj, my_home_point, 20.0f);
3402+
Vector3 this_home_point = Commands->Get_Position(obj);
3403+
Commands->Set_Innate_Soldier_Home_Location(obj, this_home_point, 20.0f);
34043404

34053405
// Turn hibernation off for a moment.
34063406

@@ -3422,7 +3422,7 @@ DECLARE_SCRIPT (M02_Nod_Soldier, "Area_Number:int,Area_Officer:int,Pre_Placed:in
34223422

34233423
Commands->Grant_Key (obj, 1, true);
34243424

3425-
GameObject *starobj = Commands->Get_A_Star (my_home_point);
3425+
GameObject *starobj = Commands->Get_A_Star (this_home_point);
34263426

34273427
if (starobj)
34283428
{

Code/Scripts/Mission06.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4938,7 +4938,7 @@ DECLARE_SCRIPT(M06_Flyover_Controller, "") // 100018
49384938
{
49394939
last = param;
49404940

4941-
static constexpr const char *flyovers[11] =
4941+
static constexpr const char *flyover_files[11] =
49424942
{
49434943
"M06_XG_VehicleDrop0.txt",
49444944
"M06_XG_VehicleDrop1.txt",
@@ -4973,7 +4973,7 @@ DECLARE_SCRIPT(M06_Flyover_Controller, "") // 100018
49734973
{
49744974
GameObject *controller = Commands->Create_Object("Invisible_Object", Vector3(-44.177f, 30.547f, 1.605f));
49754975
Commands->Set_Facing(controller, 0.000f);
4976-
Commands->Attach_Script(controller, "Test_Cinematic", flyovers[random]);
4976+
Commands->Attach_Script(controller, "Test_Cinematic", flyover_files[random]);
49774977
}
49784978
break;
49794979
case 4:
@@ -4984,7 +4984,7 @@ DECLARE_SCRIPT(M06_Flyover_Controller, "") // 100018
49844984
case 9:
49854985
{
49864986
GameObject *controller = Commands->Create_Object("Invisible_Object", Vector3(0,0,0));
4987-
Commands->Attach_Script(controller, "Test_Cinematic", flyovers[random]);
4987+
Commands->Attach_Script(controller, "Test_Cinematic", flyover_files[random]);
49884988
}
49894989
break;
49904990
}

Code/Scripts/MissionDemo.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -734,8 +734,8 @@ DECLARE_SCRIPT (MDD_Nod_Soldier, "Area_Number:int,Area_Officer:int,Pre_Placed:in
734734

735735
// Set the unit's home point, save the value.
736736

737-
Vector3 my_home_point = Commands->Get_Position(obj);
738-
Commands->Set_Innate_Soldier_Home_Location(obj, my_home_point, 20.0f);
737+
Vector3 this_home_point = Commands->Get_Position(obj);
738+
Commands->Set_Innate_Soldier_Home_Location(obj, this_home_point, 20.0f);
739739

740740
// Turn hibernation off for a moment.
741741

Code/Scripts/MissionX0.cpp

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2134,27 +2134,27 @@ DECLARE_SCRIPT ( MX0_A03_HUMVEE, "" ) // moves humvee
21342134
{
21352135
// Commands->Debug_Message( "***** DAK ***** finding Object Buggie.\n" );
21362136
Current_Target = Target_Id[target];
2137-
GameObject *target = Commands->Find_Object( Current_Target );
2137+
GameObject *current_target = Commands->Find_Object( Current_Target );
21382138

2139-
if ( target )
2139+
if ( current_target )
21402140
{
21412141
ActionParamsStruct params;
21422142
params.Set_Basic(this, INNATE_PRIORITY_ENEMY_SEEN, 1);
2143-
params.Set_Attack(target, 60.0f, 0.25f, true);
2143+
params.Set_Attack(current_target, 60.0f, 0.25f, true);
21442144
Commands->Action_Attack(obj, params);
21452145
}
21462146
}
21472147
if ( action_id == 1 ) // humvee done with target. attack next target
21482148
{
21492149
target = target + 1;
21502150
Current_Target = Target_Id[target];
2151-
GameObject *target = Commands->Find_Object( Current_Target );
2151+
GameObject *current_target = Commands->Find_Object( Current_Target );
21522152

2153-
if ( target )
2153+
if ( current_target )
21542154
{
21552155
ActionParamsStruct params;
21562156
params.Set_Basic(this, INNATE_PRIORITY_ENEMY_SEEN, 1);
2157-
params.Set_Attack(target, 60.0f, 0.25f, true);
2157+
params.Set_Attack(current_target, 60.0f, 0.25f, true);
21582158
Commands->Action_Attack(obj, params);
21592159
}
21602160
else // no targets. attack whatever you can see.
@@ -2177,9 +2177,9 @@ DECLARE_SCRIPT ( MX0_A03_HUMVEE, "" ) // moves humvee
21772177

21782178
if ( type == 2 ) // resume fire on buggy. halt after 3 - 6 seconds.
21792179
{
2180-
GameObject *target = Commands->Find_Object( Current_Target );
2180+
GameObject *current_target = Commands->Find_Object( Current_Target );
21812181

2182-
if ( target )
2182+
if ( current_target )
21832183
{
21842184
ActionParamsStruct params;
21852185
params.Set_Basic(this, INNATE_PRIORITY_ENEMY_SEEN, 1);
@@ -2254,12 +2254,12 @@ DECLARE_SCRIPT ( MX0_A03_TANK, "" ) // moves tank
22542254
if ( type == 0 ) // attack Target_Id[target]
22552255
{
22562256
Current_Target = Target_Id[target];
2257-
GameObject *target = Commands->Find_Object ( Current_Target );
2258-
if ( target )
2257+
GameObject *current_target = Commands->Find_Object ( Current_Target );
2258+
if ( current_target )
22592259
{
22602260
ActionParamsStruct params;
22612261
params.Set_Basic(this, INNATE_PRIORITY_ENEMY_SEEN, 0);
2262-
params.Set_Attack( target, 60.0f, 0.25f, true);
2262+
params.Set_Attack( current_target, 60.0f, 0.25f, true);
22632263
Commands->Action_Attack(obj, params);
22642264
}
22652265
}

Code/Scripts/Test_DME.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -602,10 +602,10 @@ DECLARE_SCRIPT (DME_Test_Worker_Wander, "Work_Area=3:int")
602602

603603

604604
Vector3 pos = Commands->Get_Position(obj); //specifies drop location and plays droping anim.
605-
float facing = Commands->Get_Facing(obj);
605+
float obj_facing = Commands->Get_Facing(obj);
606606
Commands->Set_Animation( obj, "H_A_J12C", false, NULL, 0.0f, -1.0f, false );
607-
float a = cos(DEG_TO_RADF(facing)) * 1.5;
608-
float b = sin(DEG_TO_RADF(facing)) * 1.5;
607+
float a = cos(DEG_TO_RADF(obj_facing)) * 1.5;
608+
float b = sin(DEG_TO_RADF(obj_facing)) * 1.5;
609609
Vector3 powerup_loc = pos + Vector3(a, b, 0.5f);
610610

611611
switch (reward_type) //random reward type.

Code/Scripts/mission08.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5114,8 +5114,8 @@ DECLARE_SCRIPT(M08_Facility_Scientist_Inactive, "Point1_ID=0:int, Point2_ID=0:in
51145114

51155115
void Killed (GameObject * obj, GameObject * killer) override
51165116
{
5117-
int controller_id = Get_Int_Parameter("Controller_ID");
5118-
Commands->Send_Custom_Event(obj, Commands->Find_Object(controller_id), M08_SCIENTIST_KILLED, 1, 0.0f);
5117+
int controller_id_param = Get_Int_Parameter("Controller_ID");
5118+
Commands->Send_Custom_Event(obj, Commands->Find_Object(controller_id_param), M08_SCIENTIST_KILLED, 1, 0.0f);
51195119
}
51205120

51215121
};

Code/Tools/W3DView/W3DViewDoc.cpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -726,24 +726,24 @@ CW3DViewDoc::DisplayObject
726726
// Reset the animation for this object
727727
pCModel->Set_Animation ();
728728

729-
RenderObjClass *m_pCRenderObj;
729+
RenderObjClass *render_obj;
730730

731-
m_pCRenderObj = pCModel;
732-
m_pCRenderObj->Add_Ref ();
733-
m_pCRenderObj->Set_Transform (Matrix3D (1));
731+
render_obj = pCModel;
732+
render_obj->Add_Ref ();
733+
render_obj->Set_Transform (Matrix3D (1));
734734

735735
// Add this object to the scene
736-
if (m_pCRenderObj->Class_ID () == RenderObjClass::CLASSID_BITMAP2D) {
737-
m_pC2DScene->Add_Render_Object (m_pCRenderObj);
736+
if (render_obj->Class_ID () == RenderObjClass::CLASSID_BITMAP2D) {
737+
m_pC2DScene->Add_Render_Object (render_obj);
738738
} else {
739739
m_pCScene->Clear_Lineup();
740-
m_pCScene->Add_Render_Object (m_pCRenderObj);
740+
m_pCScene->Add_Render_Object (render_obj);
741741
}
742742

743743
// Reset the current lod to be the lowest possible LOD...
744744
if ((m_pCScene->Are_LODs_Switching ()) &&
745-
(m_pCRenderObj->Class_ID () == RenderObjClass::CLASSID_HLOD)) {
746-
((HLodClass *)m_pCRenderObj)->Set_LOD_Level (0);
745+
(render_obj->Class_ID () == RenderObjClass::CLASSID_HLOD)) {
746+
((HLodClass *)render_obj)->Set_LOD_Level (0);
747747
}
748748

749749
CGraphicView *pCGraphicView = GetGraphicView ();
@@ -754,7 +754,7 @@ CW3DViewDoc::DisplayObject
754754
if ((use_global_reset_flag && m_bAutoCameraReset) ||
755755
((use_global_reset_flag == false) && allow_reset) ||
756756
m_bOneTimeReset) {
757-
pCGraphicView->Reset_Camera_To_Display_Object (*m_pCRenderObj);
757+
pCGraphicView->Reset_Camera_To_Display_Object (*render_obj);
758758
m_bOneTimeReset = false;
759759
}
760760
}

Code/ww3d2/dx8renderer.cpp

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1445,7 +1445,7 @@ unsigned DX8TextureCategoryClass::Add_Mesh(
14451445
unsigned vertex_offset,
14461446
unsigned index_offset,
14471447
IndexBufferClass* index_buffer,
1448-
unsigned pass)
1448+
unsigned texpass)
14491449
{
14501450
int poly_count=split_table.Get_Polygon_Count();
14511451

@@ -1459,10 +1459,10 @@ unsigned DX8TextureCategoryClass::Add_Mesh(
14591459
for (int i=0;i<poly_count;++i) {
14601460
bool all_textures_same = true;
14611461
for (unsigned int stage = 0; stage < MeshMatDescClass::MAX_TEX_STAGES; stage++) {
1462-
all_textures_same = all_textures_same && (split_table.Peek_Texture(i, pass, stage) == textures[stage]);
1462+
all_textures_same = all_textures_same && (split_table.Peek_Texture(i, texpass, stage) == textures[stage]);
14631463
}
1464-
VertexMaterialClass* mat=split_table.Peek_Material(i,pass);
1465-
ShaderClass shd=split_table.Peek_Shader(i,pass);
1464+
VertexMaterialClass* mat=split_table.Peek_Material(i,texpass);
1465+
ShaderClass shd=split_table.Peek_Shader(i,texpass);
14661466

14671467
if (all_textures_same && Equal_Material(mat,material) && shd==shader) {
14681468
polygons++;
@@ -1483,18 +1483,18 @@ unsigned DX8TextureCategoryClass::Add_Mesh(
14831483
stripify=false;
14841484
}
14851485
#endif
1486-
const TriIndex* src_indices=(const TriIndex*)split_table.Get_Polygon_Array(pass);//mmc->Get_Polygon_Array();
1486+
const TriIndex* src_indices=(const TriIndex*)split_table.Get_Polygon_Array(texpass);//mmc->Get_Polygon_Array();
14871487

14881488
if (stripify) {
14891489
int* triangles=new int[index_count];
14901490
int triangle_index_count=0;
14911491
for (int i=0;i<poly_count;++i) {
14921492
bool all_textures_same = true;
14931493
for (unsigned int stage = 0; stage < MeshMatDescClass::MAX_TEX_STAGES; stage++) {
1494-
all_textures_same = all_textures_same && (split_table.Peek_Texture(i, pass, stage) == textures[stage]);
1494+
all_textures_same = all_textures_same && (split_table.Peek_Texture(i, texpass, stage) == textures[stage]);
14951495
}
1496-
VertexMaterialClass* mat=split_table.Peek_Material(i,pass);
1497-
ShaderClass shd=split_table.Peek_Shader(i,pass);
1496+
VertexMaterialClass* mat=split_table.Peek_Material(i,texpass);
1497+
ShaderClass shd=split_table.Peek_Shader(i,texpass);
14981498

14991499
if (all_textures_same && Equal_Material(mat,material) && shd==shader) {
15001500
triangles[triangle_index_count++]=src_indices[i][0]+vertex_offset;
@@ -1574,10 +1574,10 @@ unsigned DX8TextureCategoryClass::Add_Mesh(
15741574
for (int i=0;i<poly_count;++i) {
15751575
bool all_textures_same = true;
15761576
for (unsigned int stage = 0; stage < MeshMatDescClass::MAX_TEX_STAGES; stage++) {
1577-
all_textures_same = all_textures_same && (split_table.Peek_Texture(i, pass, stage) == textures[stage]);
1577+
all_textures_same = all_textures_same && (split_table.Peek_Texture(i, texpass, stage) == textures[stage]);
15781578
}
1579-
VertexMaterialClass* mat=split_table.Peek_Material(i,pass);
1580-
ShaderClass shd=split_table.Peek_Shader(i,pass);
1579+
VertexMaterialClass* mat=split_table.Peek_Material(i,texpass);
1580+
ShaderClass shd=split_table.Peek_Shader(i,texpass);
15811581

15821582
if (all_textures_same && Equal_Material(mat,material) && shd==shader) {
15831583
unsigned short idx;

0 commit comments

Comments
 (0)