#5448 Remove warnings about uninitialized values in cvf::Vec2/Vec3.

This commit is contained in:
Kristian Bendiksen 2020-03-27 07:16:54 +01:00 committed by Magne Sjaastad
parent 7d20e0da0f
commit 568a135d82
4 changed files with 25 additions and 2 deletions

View File

@ -53,7 +53,7 @@ template<typename S>
class Vector2
{
public:
Vector2() {}
Vector2();
Vector2(S x, S y);
Vector2(const Vector2& other);

View File

@ -57,6 +57,17 @@ template<typename S> Vector2<S> const Vector2<S>::X_AXIS(1, 0);
template<typename S> Vector2<S> const Vector2<S>::Y_AXIS(0, 1);
template<typename S> Vector2<S> const Vector2<S>::ZERO(0, 0);
//--------------------------------------------------------------------------------------------------
/// Default constructor.
//--------------------------------------------------------------------------------------------------
template<typename S>
Vector2<S>::Vector2()
{
m_v[0] = 0;
m_v[1] = 0;
}
//--------------------------------------------------------------------------------------------------
/// Set the vector to <x,y>
//--------------------------------------------------------------------------------------------------

View File

@ -59,7 +59,7 @@ template<typename S>
class Vector3
{
public:
Vector3() {}
Vector3();
Vector3(S x, S y, S z);
Vector3(const Vector3& other);

View File

@ -58,6 +58,18 @@ template<typename S> Vector3<S> const Vector3<S>::Y_AXIS(0,1,0);
template<typename S> Vector3<S> const Vector3<S>::Z_AXIS(0,0,1);
template<typename S> Vector3<S> const Vector3<S>::ZERO(0,0,0);
//--------------------------------------------------------------------------------------------------
/// Default constructor.
//--------------------------------------------------------------------------------------------------
template<typename S>
Vector3<S>::Vector3()
{
m_v[0] = 0;
m_v[1] = 0;
m_v[2] = 0;
}
//--------------------------------------------------------------------------------------------------
/// Set the vector to <x,y,z>
//--------------------------------------------------------------------------------------------------