From acc10c7ee2b6c50080b2534ec1e50da9edc477cb Mon Sep 17 00:00:00 2001 From: Lioncash Date: Tue, 1 May 2018 21:25:20 -0400 Subject: [PATCH] vector_math: Ensure members are always initialized Ensures that values are always in a well-defined state. --- src/common/vector_math.h | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/common/vector_math.h b/src/common/vector_math.h index 3f15ac1f4f..cca43bd4c8 100644 --- a/src/common/vector_math.h +++ b/src/common/vector_math.h @@ -52,8 +52,8 @@ static inline Vec4 MakeVec(const T& x, const T& y, const T& z, const T& w); template class Vec2 { public: - T x; - T y; + T x{}; + T y{}; Vec2() = default; Vec2(const T& _x, const T& _y) : x(_x), y(_y) {} @@ -192,9 +192,9 @@ inline float Vec2::Normalize() { template class Vec3 { public: - T x; - T y; - T z; + T x{}; + T y{}; + T z{}; Vec3() = default; Vec3(const T& _x, const T& _y, const T& _z) : x(_x), y(_y), z(_z) {} @@ -392,10 +392,10 @@ typedef Vec3 Vec3f; template class Vec4 { public: - T x; - T y; - T z; - T w; + T x{}; + T y{}; + T z{}; + T w{}; Vec4() = default; Vec4(const T& _x, const T& _y, const T& _z, const T& _w) : x(_x), y(_y), z(_z), w(_w) {}