From f7a8d5079bcb782bf5a0e094c15e18b92e50d8d3 Mon Sep 17 00:00:00 2001 From: Sam Hocevar Date: Wed, 30 Jul 2014 13:01:37 +0000 Subject: [PATCH] math: disable a few unused operators (for integer quaternions, for instance). --- src/lol/math/matrix.h | 12 +++--------- src/lol/math/transform.h | 10 ---------- src/math/vector.cpp | 11 ----------- 3 files changed, 3 insertions(+), 30 deletions(-) diff --git a/src/lol/math/matrix.h b/src/lol/math/matrix.h index 74573a58..13cf9c97 100644 --- a/src/lol/math/matrix.h +++ b/src/lol/math/matrix.h @@ -125,10 +125,8 @@ private: #endif }; -static_assert(sizeof(i8mat2) == 4, "sizeof(i8mat2) == 4"); -static_assert(sizeof(i16mat2) == 8, "sizeof(i16mat2) == 8"); static_assert(sizeof(imat2) == 16, "sizeof(imat2) == 16"); -static_assert(sizeof(i64mat2) == 32, "sizeof(i64mat2) == 32"); +static_assert(sizeof(umat2) == 16, "sizeof(umat2) == 16"); #if LOL_FEATURE_CXX11_UNRESTRICTED_UNIONS static_assert(sizeof(f16mat2) == 8, "sizeof(f16mat2) == 8"); @@ -250,10 +248,8 @@ private: #endif }; -static_assert(sizeof(i8mat3) == 9, "sizeof(i8mat3) == 9"); -static_assert(sizeof(i16mat3) == 18, "sizeof(i16mat3) == 18"); static_assert(sizeof(imat3) == 36, "sizeof(imat3) == 36"); -static_assert(sizeof(i64mat3) == 72, "sizeof(i64mat3) == 72"); +static_assert(sizeof(umat3) == 36, "sizeof(umat3) == 36"); #if LOL_FEATURE_CXX11_UNRESTRICTED_UNIONS static_assert(sizeof(f16mat3) == 18, "sizeof(f16mat3) == 18"); @@ -422,10 +418,8 @@ private: #endif }; -static_assert(sizeof(i8mat4) == 16, "sizeof(i8mat4) == 16"); -static_assert(sizeof(i16mat4) == 32, "sizeof(i16mat4) == 32"); static_assert(sizeof(imat4) == 64, "sizeof(imat4) == 64"); -static_assert(sizeof(i64mat4) == 128, "sizeof(i64mat4) == 128"); +static_assert(sizeof(umat4) == 64, "sizeof(umat4) == 64"); #if LOL_FEATURE_CXX11_UNRESTRICTED_UNIONS static_assert(sizeof(f16mat4) == 32, "sizeof(f16mat4) == 32"); diff --git a/src/lol/math/transform.h b/src/lol/math/transform.h index 33689fb2..eed61f9c 100644 --- a/src/lol/math/transform.h +++ b/src/lol/math/transform.h @@ -67,11 +67,6 @@ struct cmplx_t : public linear_ops::base T x, y; }; -static_assert(sizeof(i8cmplx) == 2, "sizeof(i8cmplx) == 2"); -static_assert(sizeof(i16cmplx) == 4, "sizeof(i16cmplx) == 4"); -static_assert(sizeof(icmplx) == 8, "sizeof(icmplx) == 8"); -static_assert(sizeof(i64cmplx) == 16, "sizeof(i64cmplx) == 16"); - static_assert(sizeof(f16cmplx) == 4, "sizeof(f16cmplx) == 4"); static_assert(sizeof(cmplx) == 8, "sizeof(cmplx) == 8"); static_assert(sizeof(dcmplx) == 16, "sizeof(dcmplx) == 16"); @@ -221,11 +216,6 @@ struct quat_t : public linear_ops::base T w, x, y, z; }; -static_assert(sizeof(i8quat) == 4, "sizeof(i8quat) == 4"); -static_assert(sizeof(i16quat) == 8, "sizeof(i16quat) == 8"); -static_assert(sizeof(iquat) == 16, "sizeof(iquat) == 16"); -static_assert(sizeof(i64quat) == 32, "sizeof(i64quat) == 32"); - static_assert(sizeof(f16quat) == 8, "sizeof(f16quat) == 8"); static_assert(sizeof(quat) == 16, "sizeof(quat) == 16"); static_assert(sizeof(dquat) == 32, "sizeof(dquat) == 32"); diff --git a/src/math/vector.cpp b/src/math/vector.cpp index 46ca69e8..3a31d95f 100644 --- a/src/math/vector.cpp +++ b/src/math/vector.cpp @@ -99,11 +99,6 @@ template<> std::ostream &operator<<(std::ostream &stream, ivec2 const &v) return stream << "(" << v.x << ", " << v.y << ")"; } -template<> std::ostream &operator<<(std::ostream &stream, icmplx const &v) -{ - return stream << "(" << v.x << ", " << v.y << ")"; -} - template<> std::ostream &operator<<(std::ostream &stream, ivec3 const &v) { return stream << "(" << v.x << ", " << v.y << ", " << v.z << ")"; @@ -115,12 +110,6 @@ template<> std::ostream &operator<<(std::ostream &stream, ivec4 const &v) << v.z << ", " << v.w << ")"; } -template<> std::ostream &operator<<(std::ostream &stream, iquat const &v) -{ - return stream << "(" << v.x << ", " << v.y << ", " - << v.z << ", " << v.w << ")"; -} - template<> std::ostream &operator<<(std::ostream &stream, vec2 const &v) { return stream << "(" << v.x << ", " << v.y << ")";