Skip to content

Commit bfb7a0b

Browse files
Zegerieagleivg
authored andcommitted
Reduce the amount of warnings
* Inlined pure virtual functions don't make sense. * Use '= delete' to prohibit operators instead of runtime errors. * Fix mistakes in return values.
1 parent 6e9c8ff commit bfb7a0b

File tree

8 files changed

+16
-13
lines changed

8 files changed

+16
-13
lines changed

src/Include/xrRender/Kinematics.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ class IKinematics
5252
virtual CInifile* LL_UserData() = 0;
5353
virtual accel* LL_Bones() = 0;
5454

55-
virtual ICF CBoneInstance& LL_GetBoneInstance(u16 bone_id) = 0;
55+
virtual CBoneInstance& LL_GetBoneInstance(u16 bone_id) = 0;
5656

5757
virtual CBoneData& LL_GetData(u16 bone_id) = 0;
5858

@@ -61,10 +61,10 @@ class IKinematics
6161
virtual u16 LL_BoneCount() const = 0;
6262
virtual u16 LL_VisibleBoneCount() = 0;
6363

64-
virtual ICF Fmatrix& LL_GetTransform(u16 bone_id) = 0;
65-
virtual ICF const Fmatrix& LL_GetTransform(u16 bone_id) const = 0;
64+
virtual Fmatrix& LL_GetTransform(u16 bone_id) = 0;
65+
virtual const Fmatrix& LL_GetTransform(u16 bone_id) const = 0;
6666

67-
virtual ICF Fmatrix& LL_GetTransform_R(u16 bone_id) = 0;
67+
virtual Fmatrix& LL_GetTransform_R(u16 bone_id) = 0;
6868
virtual Fobb& LL_GetBox(u16 bone_id) = 0;
6969
virtual const Fbox& GetBox() const = 0;
7070
virtual void LL_GetBindTransform(xr_vector<Fmatrix>& matrices) = 0;

src/xrGame/CharacterPhysicsSupport.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -153,9 +153,7 @@ class CCharacterPhysicsSupport : public CPHSkeleton, public CPHDestroyable
153153
virtual void on_child_shell_activate(CPhysicsShellHolder* obj);
154154
/////////////////////////////////////////////////////////////////
155155
CCharacterPhysicsSupport& operator=(CCharacterPhysicsSupport& /**asup/**/)
156-
{
157-
R_ASSERT2(false, "Can not assign it");
158-
}
156+
= delete;
159157
CCharacterPhysicsSupport(EType atype, CEntityAlive* aentity);
160158
virtual ~CCharacterPhysicsSupport();
161159

src/xrGame/WeaponKnife.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ class CWeaponKnife : public CWeapon
138138
bool operator()(spartial_base_t::value_type const& left) const;
139139

140140
private:
141-
victim_filter& operator=(victim_filter const& copy){};
141+
victim_filter& operator=(victim_filter const& copy) = delete;
142142

143143
u16 m_except_id;
144144
CWeaponKnife* m_owner;
@@ -155,7 +155,7 @@ class CWeaponKnife : public CWeapon
155155
void operator()(spartial_base_t::value_type const& left);
156156

157157
private:
158-
best_victim_selector& operator=(best_victim_selector const& copy){};
158+
best_victim_selector& operator=(best_victim_selector const& copy) = delete;
159159

160160
Fvector m_start_pos;
161161
float m_min_dist;

src/xrGame/ik/limb.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ class Limb
112112
int SetGoalPos(const float g[3], const Matrix E, int limits_on);
113113
int SetGoal(const Matrix G, int limits_on);
114114
float Length() const { return solver.Length(); }
115-
int SetAimGoal(const float goal[3], const float axis[3], float flex_angle)
115+
void SetAimGoal(const float goal[3], const float axis[3], float flex_angle)
116116
{
117117
solver.SetAimGoal(goal, axis, flex_angle);
118118
}

src/xrGame/invincible_fury.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ struct fury_killer
2020
{
2121
m_killer_name = copy.m_killer_name;
2222
m_after_time = copy.m_after_time;
23+
return *this;
2324
}
2425

2526
bool operator()(shared_str const& killer, shared_str const& victim, kills_store::kill const& kill)

src/xrPhysics/MathUtils.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,7 @@ struct SInertVal
444444
SInertVal(float inert) : inertion(inert) { R_ASSERT(inert > 0.f && inert < 1.f); }
445445
IC void new_val(float new_val) { val = inertion * val + (1 - inertion) * new_val; }
446446
private:
447-
SInertVal& operator=(SInertVal& v) { R_ASSERT(false); }
447+
SInertVal& operator=(SInertVal& v) = delete;
448448
};
449449

450450
IC float DET(const Fmatrix& a)

src/xrPhysics/PHMoveStorage.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,11 @@ class CPHPositionsPairs
2525
return *this;
2626
}
2727

28-
CPHPositionsPairs& operator=(const CPHPositionsPairs& right) { geom = right.geom; }
28+
CPHPositionsPairs& operator=(const CPHPositionsPairs& right)
29+
{
30+
geom = right.geom;
31+
return *this;
32+
}
2933
bool operator==(const CPHPositionsPairs& right) const { return geom == right.geom; }
3034
bool operator!=(const CPHPositionsPairs& right) const { return geom != right.geom; }
3135
};

src/xrPhysics/tri-colliderknoopc/TriPrimitiveCollideClassDef.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ class primitive##Tri
77
\
88
{ \
99
dcTriListCollider& m_tri_list; \
10-
primitive##Tri& operator=(primitive##Tri& nx_nado) { ; } \
10+
primitive##Tri& operator=(primitive##Tri& nx_nado) = delete; \
1111
\
1212
public: \
1313
explicit primitive##Tri(dcTriListCollider& tri_list) : m_tri_list(tri_list){}; \

0 commit comments

Comments
 (0)