Skip to content

Commit

Permalink
Reduce the amount of warnings
Browse files Browse the repository at this point in the history
* Inlined pure virtual functions don't make sense.
* Use '= delete' to prohibit operators instead of runtime errors.
* Fix mistakes in return values.
  • Loading branch information
Zegeri authored and eagleivg committed Nov 6, 2018
1 parent 6e9c8ff commit bfb7a0b
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 13 deletions.
8 changes: 4 additions & 4 deletions src/Include/xrRender/Kinematics.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class IKinematics
virtual CInifile* LL_UserData() = 0;
virtual accel* LL_Bones() = 0;

virtual ICF CBoneInstance& LL_GetBoneInstance(u16 bone_id) = 0;
virtual CBoneInstance& LL_GetBoneInstance(u16 bone_id) = 0;

virtual CBoneData& LL_GetData(u16 bone_id) = 0;

Expand All @@ -61,10 +61,10 @@ class IKinematics
virtual u16 LL_BoneCount() const = 0;
virtual u16 LL_VisibleBoneCount() = 0;

virtual ICF Fmatrix& LL_GetTransform(u16 bone_id) = 0;
virtual ICF const Fmatrix& LL_GetTransform(u16 bone_id) const = 0;
virtual Fmatrix& LL_GetTransform(u16 bone_id) = 0;
virtual const Fmatrix& LL_GetTransform(u16 bone_id) const = 0;

virtual ICF Fmatrix& LL_GetTransform_R(u16 bone_id) = 0;
virtual Fmatrix& LL_GetTransform_R(u16 bone_id) = 0;
virtual Fobb& LL_GetBox(u16 bone_id) = 0;
virtual const Fbox& GetBox() const = 0;
virtual void LL_GetBindTransform(xr_vector<Fmatrix>& matrices) = 0;
Expand Down
4 changes: 1 addition & 3 deletions src/xrGame/CharacterPhysicsSupport.h
Original file line number Diff line number Diff line change
Expand Up @@ -153,9 +153,7 @@ class CCharacterPhysicsSupport : public CPHSkeleton, public CPHDestroyable
virtual void on_child_shell_activate(CPhysicsShellHolder* obj);
/////////////////////////////////////////////////////////////////
CCharacterPhysicsSupport& operator=(CCharacterPhysicsSupport& /**asup/**/)
{
R_ASSERT2(false, "Can not assign it");
}
= delete;
CCharacterPhysicsSupport(EType atype, CEntityAlive* aentity);
virtual ~CCharacterPhysicsSupport();

Expand Down
4 changes: 2 additions & 2 deletions src/xrGame/WeaponKnife.h
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ class CWeaponKnife : public CWeapon
bool operator()(spartial_base_t::value_type const& left) const;

private:
victim_filter& operator=(victim_filter const& copy){};
victim_filter& operator=(victim_filter const& copy) = delete;

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

private:
best_victim_selector& operator=(best_victim_selector const& copy){};
best_victim_selector& operator=(best_victim_selector const& copy) = delete;

Fvector m_start_pos;
float m_min_dist;
Expand Down
2 changes: 1 addition & 1 deletion src/xrGame/ik/limb.h
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ class Limb
int SetGoalPos(const float g[3], const Matrix E, int limits_on);
int SetGoal(const Matrix G, int limits_on);
float Length() const { return solver.Length(); }
int SetAimGoal(const float goal[3], const float axis[3], float flex_angle)
void SetAimGoal(const float goal[3], const float axis[3], float flex_angle)
{
solver.SetAimGoal(goal, axis, flex_angle);
}
Expand Down
1 change: 1 addition & 0 deletions src/xrGame/invincible_fury.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ struct fury_killer
{
m_killer_name = copy.m_killer_name;
m_after_time = copy.m_after_time;
return *this;
}

bool operator()(shared_str const& killer, shared_str const& victim, kills_store::kill const& kill)
Expand Down
2 changes: 1 addition & 1 deletion src/xrPhysics/MathUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@ struct SInertVal
SInertVal(float inert) : inertion(inert) { R_ASSERT(inert > 0.f && inert < 1.f); }
IC void new_val(float new_val) { val = inertion * val + (1 - inertion) * new_val; }
private:
SInertVal& operator=(SInertVal& v) { R_ASSERT(false); }
SInertVal& operator=(SInertVal& v) = delete;
};

IC float DET(const Fmatrix& a)
Expand Down
6 changes: 5 additions & 1 deletion src/xrPhysics/PHMoveStorage.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,11 @@ class CPHPositionsPairs
return *this;
}

CPHPositionsPairs& operator=(const CPHPositionsPairs& right) { geom = right.geom; }
CPHPositionsPairs& operator=(const CPHPositionsPairs& right)
{
geom = right.geom;
return *this;
}
bool operator==(const CPHPositionsPairs& right) const { return geom == right.geom; }
bool operator!=(const CPHPositionsPairs& right) const { return geom != right.geom; }
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class primitive##Tri
\
{ \
dcTriListCollider& m_tri_list; \
primitive##Tri& operator=(primitive##Tri& nx_nado) { ; } \
primitive##Tri& operator=(primitive##Tri& nx_nado) = delete; \
\
public: \
explicit primitive##Tri(dcTriListCollider& tri_list) : m_tri_list(tri_list){}; \
Expand Down

0 comments on commit bfb7a0b

Please sign in to comment.