summaryrefslogtreecommitdiff
path: root/src/common/vector_math.h
diff options
context:
space:
mode:
authorGravatar Lioncash2018-05-01 21:25:20 -0400
committerGravatar Lioncash2018-05-01 21:25:25 -0400
commitacc10c7ee2b6c50080b2534ec1e50da9edc477cb (patch)
tree5a89af2e4354f6512ac89198456db44cf1732b57 /src/common/vector_math.h
parentMerge pull request #429 from Subv/ioctl_corruption (diff)
downloadyuzu-acc10c7ee2b6c50080b2534ec1e50da9edc477cb.tar.gz
yuzu-acc10c7ee2b6c50080b2534ec1e50da9edc477cb.tar.xz
yuzu-acc10c7ee2b6c50080b2534ec1e50da9edc477cb.zip
vector_math: Ensure members are always initialized
Ensures that values are always in a well-defined state.
Diffstat (limited to 'src/common/vector_math.h')
-rw-r--r--src/common/vector_math.h18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/common/vector_math.h b/src/common/vector_math.h
index 3f15ac1f4..cca43bd4c 100644
--- a/src/common/vector_math.h
+++ b/src/common/vector_math.h
@@ -52,8 +52,8 @@ static inline Vec4<T> MakeVec(const T& x, const T& y, const T& z, const T& w);
52template <typename T> 52template <typename T>
53class Vec2 { 53class Vec2 {
54public: 54public:
55 T x; 55 T x{};
56 T y; 56 T y{};
57 57
58 Vec2() = default; 58 Vec2() = default;
59 Vec2(const T& _x, const T& _y) : x(_x), y(_y) {} 59 Vec2(const T& _x, const T& _y) : x(_x), y(_y) {}
@@ -192,9 +192,9 @@ inline float Vec2<float>::Normalize() {
192template <typename T> 192template <typename T>
193class Vec3 { 193class Vec3 {
194public: 194public:
195 T x; 195 T x{};
196 T y; 196 T y{};
197 T z; 197 T z{};
198 198
199 Vec3() = default; 199 Vec3() = default;
200 Vec3(const T& _x, const T& _y, const T& _z) : x(_x), y(_y), z(_z) {} 200 Vec3(const T& _x, const T& _y, const T& _z) : x(_x), y(_y), z(_z) {}
@@ -392,10 +392,10 @@ typedef Vec3<float> Vec3f;
392template <typename T> 392template <typename T>
393class Vec4 { 393class Vec4 {
394public: 394public:
395 T x; 395 T x{};
396 T y; 396 T y{};
397 T z; 397 T z{};
398 T w; 398 T w{};
399 399
400 Vec4() = default; 400 Vec4() = default;
401 Vec4(const T& _x, const T& _y, const T& _z, const T& _w) : x(_x), y(_y), z(_z), w(_w) {} 401 Vec4(const T& _x, const T& _y, const T& _z, const T& _w) : x(_x), y(_y), z(_z), w(_w) {}