Browse Source

math: disable a few unused operators (for integer quaternions, for instance).

undefined
Sam Hocevar 10 years ago
parent
commit
f7a8d5079b
3 changed files with 3 additions and 30 deletions
  1. +3
    -9
      src/lol/math/matrix.h
  2. +0
    -10
      src/lol/math/transform.h
  3. +0
    -11
      src/math/vector.cpp

+ 3
- 9
src/lol/math/matrix.h View File

@@ -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");


+ 0
- 10
src/lol/math/transform.h View File

@@ -67,11 +67,6 @@ struct cmplx_t : public linear_ops::base<T>
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>
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");


+ 0
- 11
src/math/vector.cpp View File

@@ -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 << ")";


Loading…
Cancel
Save