Merge branch 'trivial' into bitfield

This commit is contained in:
Christophe Riccio 2014-11-12 23:11:32 +01:00
commit 2df3bf71cc
36 changed files with 112 additions and 265 deletions

View File

@ -44,7 +44,7 @@ namespace detail
{
GLM_FUNC_QUALIFIER int mask(int Bits)
{
return ~((~0) << Bits);
return Bits >= 32 ? 0xffffffff : (static_cast<int>(1) << Bits) - static_cast<int>(1);
}
template <bool EXEC = false>

View File

@ -527,6 +527,10 @@
((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (GLM_COMPILER & GLM_COMPILER_GCC) && (GLM_COMPILER >= GLM_COMPILER_GCC46)) || \
__has_feature(cxx_range_for))
#define GLM_HAS_ASSIGNABLE ( \
(GLM_LANG & GLM_LANG_CXX11_FLAG) || \
((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (GLM_COMPILER & GLM_COMPILER_GCC) && (GLM_COMPILER >= GLM_COMPILER_GCC49)))
// OpenMP
#ifdef _OPENMP
# if GLM_COMPILER & GLM_COMPILER_GCC

View File

@ -66,7 +66,6 @@ namespace glm
//////////////////////////////////////
// Constructors
GLM_FUNC_DECL tmat2x2();
GLM_FUNC_DECL tmat2x2(tmat2x2<T, P> const & m);
template <precision Q>
GLM_FUNC_DECL tmat2x2(tmat2x2<T, Q> const & m);
@ -111,7 +110,6 @@ namespace glm
GLM_FUNC_DECL col_type & operator[](length_t i);
GLM_FUNC_DECL col_type const & operator[](length_t i) const;
GLM_FUNC_DECL tmat2x2<T, P> & operator=(tmat2x2<T, P> const & m);
template <typename U>
GLM_FUNC_DECL tmat2x2<T, P> & operator=(tmat2x2<U, P> const & m);
template <typename U>

View File

@ -89,13 +89,6 @@ namespace detail
# endif
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x2<T, P>::tmat2x2(tmat2x2<T, P> const & m)
{
this->value[0] = m.value[0];
this->value[1] = m.value[1];
}
template <typename T, precision P>
template <precision Q>
GLM_FUNC_QUALIFIER tmat2x2<T, P>::tmat2x2(tmat2x2<T, Q> const & m)
@ -225,15 +218,6 @@ namespace detail
//////////////////////////////////////////////////////////////
// mat2x2 operators
// This function shouldn't required but it seems that VC7.1 have an optimisation bug if this operator wasn't declared
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x2<T, P>& tmat2x2<T, P>::operator=(tmat2x2<T, P> const & m)
{
this->value[0] = m[0];
this->value[1] = m[1];
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat2x2<T, P>& tmat2x2<T, P>::operator=(tmat2x2<U, P> const & m)

View File

@ -61,7 +61,6 @@ namespace glm
public:
// Constructors
GLM_FUNC_DECL tmat2x3();
GLM_FUNC_DECL tmat2x3(tmat2x3<T, P> const & m);
template <precision Q>
GLM_FUNC_DECL tmat2x3(tmat2x3<T, Q> const & m);
@ -104,7 +103,6 @@ namespace glm
GLM_FUNC_DECL col_type & operator[](length_t i);
GLM_FUNC_DECL col_type const & operator[](length_t i) const;
GLM_FUNC_DECL tmat2x3<T, P> & operator= (tmat2x3<T, P> const & m);
template <typename U>
GLM_FUNC_DECL tmat2x3<T, P> & operator= (tmat2x3<U, P> const & m);
template <typename U>

View File

@ -71,13 +71,6 @@ namespace glm
# endif
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x3<T, P>::tmat2x3(tmat2x3<T, P> const & m)
{
this->value[0] = m.value[0];
this->value[1] = m.value[1];
}
template <typename T, precision P>
template <precision Q>
GLM_FUNC_QUALIFIER tmat2x3<T, P>::tmat2x3(tmat2x3<T, Q> const & m)
@ -210,15 +203,7 @@ namespace glm
// Unary updatable operators
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x3<T, P>& tmat2x3<T, P>::operator=(tmat2x3<T, P> const & m)
{
this->value[0] = m[0];
this->value[1] = m[1];
return *this;
}
template <typename T, precision P>
template <typename U>
template <typename U>
GLM_FUNC_QUALIFIER tmat2x3<T, P>& tmat2x3<T, P>::operator=(tmat2x3<U, P> const & m)
{
this->value[0] = m[0];
@ -226,8 +211,8 @@ namespace glm
return *this;
}
template <typename T, precision P>
template <typename U>
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat2x3<T, P> & tmat2x3<T, P>::operator+=(U s)
{
this->value[0] += s;
@ -235,8 +220,8 @@ namespace glm
return *this;
}
template <typename T, precision P>
template <typename U>
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat2x3<T, P>& tmat2x3<T, P>::operator+=(tmat2x3<U, P> const & m)
{
this->value[0] += m[0];
@ -244,8 +229,8 @@ namespace glm
return *this;
}
template <typename T, precision P>
template <typename U>
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat2x3<T, P>& tmat2x3<T, P>::operator-=(U s)
{
this->value[0] -= s;
@ -253,8 +238,8 @@ namespace glm
return *this;
}
template <typename T, precision P>
template <typename U>
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat2x3<T, P>& tmat2x3<T, P>::operator-=(tmat2x3<U, P> const & m)
{
this->value[0] -= m[0];
@ -262,8 +247,8 @@ namespace glm
return *this;
}
template <typename T, precision P>
template <typename U>
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat2x3<T, P>& tmat2x3<T, P>::operator*=(U s)
{
this->value[0] *= s;
@ -272,7 +257,7 @@ namespace glm
}
template <typename T, precision P>
template <typename U>
template <typename U>
GLM_FUNC_QUALIFIER tmat2x3<T, P> & tmat2x3<T, P>::operator/=(U s)
{
this->value[0] /= s;
@ -280,7 +265,7 @@ namespace glm
return *this;
}
template <typename T, precision P>
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x3<T, P> & tmat2x3<T, P>::operator++()
{
++this->value[0];
@ -288,7 +273,7 @@ namespace glm
return *this;
}
template <typename T, precision P>
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x3<T, P> & tmat2x3<T, P>::operator--()
{
--this->value[0];

View File

@ -61,7 +61,6 @@ namespace glm
public:
// Constructors
GLM_FUNC_DECL tmat2x4();
GLM_FUNC_DECL tmat2x4(tmat2x4<T, P> const & m);
template <precision Q>
GLM_FUNC_DECL tmat2x4(tmat2x4<T, Q> const & m);
@ -106,7 +105,6 @@ namespace glm
GLM_FUNC_DECL col_type & operator[](length_t i);
GLM_FUNC_DECL col_type const & operator[](length_t i) const;
GLM_FUNC_DECL tmat2x4<T, P>& operator= (tmat2x4<T, P> const & m);
template <typename U>
GLM_FUNC_DECL tmat2x4<T, P>& operator= (tmat2x4<U, P> const & m);
template <typename U>

View File

@ -71,13 +71,6 @@ namespace glm
# endif
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x4<T, P>::tmat2x4(tmat2x4<T, P> const & m)
{
this->value[0] = m.value[0];
this->value[1] = m.value[1];
}
template <typename T, precision P>
template <precision Q>
GLM_FUNC_QUALIFIER tmat2x4<T, P>::tmat2x4(tmat2x4<T, Q> const & m)
@ -210,14 +203,6 @@ namespace glm
//////////////////////////////////////////////////////////////
// Unary updatable operators
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x4<T, P>& tmat2x4<T, P>::operator=(tmat2x4<T, P> const & m)
{
this->value[0] = m[0];
this->value[1] = m[1];
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat2x4<T, P>& tmat2x4<T, P>::operator=(tmat2x4<U, P> const & m)

View File

@ -61,7 +61,6 @@ namespace glm
public:
// Constructors
GLM_FUNC_DECL tmat3x2();
GLM_FUNC_DECL tmat3x2(tmat3x2<T, P> const & m);
template <precision Q>
GLM_FUNC_DECL tmat3x2(tmat3x2<T, Q> const & m);
@ -110,7 +109,6 @@ namespace glm
GLM_FUNC_DECL col_type & operator[](length_t i);
GLM_FUNC_DECL col_type const & operator[](length_t i) const;
GLM_FUNC_DECL tmat3x2<T, P> & operator= (tmat3x2<T, P> const & m);
template <typename U>
GLM_FUNC_DECL tmat3x2<T, P> & operator= (tmat3x2<U, P> const & m);
template <typename U>

View File

@ -72,14 +72,6 @@ namespace glm
# endif
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x2<T, P>::tmat3x2(tmat3x2<T, P> const & m)
{
this->value[0] = m.value[0];
this->value[1] = m.value[1];
this->value[2] = m.value[2];
}
template <typename T, precision P>
template <precision Q>
GLM_FUNC_QUALIFIER tmat3x2<T, P>::tmat3x2(tmat3x2<T, Q> const & m)
@ -239,15 +231,6 @@ namespace glm
//////////////////////////////////////////////////////////////
// Unary updatable operators
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x2<T, P>& tmat3x2<T, P>::operator=(tmat3x2<T, P> const & m)
{
this->value[0] = m[0];
this->value[1] = m[1];
this->value[2] = m[2];
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat3x2<T, P>& tmat3x2<T, P>::operator=(tmat3x2<U, P> const & m)

View File

@ -65,7 +65,6 @@ namespace glm
public:
// Constructors
GLM_FUNC_DECL tmat3x3();
GLM_FUNC_DECL tmat3x3(tmat3x3<T, P> const & m);
template <precision Q>
GLM_FUNC_DECL tmat3x3(tmat3x3<T, Q> const & m);
@ -114,7 +113,6 @@ namespace glm
GLM_FUNC_DECL col_type & operator[](length_t i);
GLM_FUNC_DECL col_type const & operator[](length_t i) const;
GLM_FUNC_DECL tmat3x3<T, P>& operator= (tmat3x3<T, P> const & m);
template <typename U>
GLM_FUNC_DECL tmat3x3<T, P>& operator= (tmat3x3<U, P> const & m);
template <typename U>

View File

@ -96,14 +96,6 @@ namespace detail
# endif
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x3<T, P>::tmat3x3(tmat3x3<T, P> const & m)
{
this->value[0] = m.value[0];
this->value[1] = m.value[1];
this->value[2] = m.value[2];
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x3<T, P>::tmat3x3(ctor)
{}
@ -263,15 +255,6 @@ namespace detail
//////////////////////////////////////////////////////////////
// Operators
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x3<T, P> & tmat3x3<T, P>::operator=(tmat3x3<T, P> const & m)
{
this->value[0] = m[0];
this->value[1] = m[1];
this->value[2] = m[2];
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat3x3<T, P> & tmat3x3<T, P>::operator=(tmat3x3<U, P> const & m)

View File

@ -61,7 +61,6 @@ namespace glm
public:
// Constructors
GLM_FUNC_DECL tmat3x4();
GLM_FUNC_DECL tmat3x4(tmat3x4<T, P> const & m);
template <precision Q>
GLM_FUNC_DECL tmat3x4(tmat3x4<T, Q> const & m);
@ -110,7 +109,6 @@ namespace glm
GLM_FUNC_DECL col_type & operator[](length_t i);
GLM_FUNC_DECL col_type const & operator[](length_t i) const;
GLM_FUNC_DECL tmat3x4<T, P> & operator=(tmat3x4<T, P> const & m);
template <typename U>
GLM_FUNC_DECL tmat3x4<T, P> & operator=(tmat3x4<U, P> const & m);
template <typename U>

View File

@ -72,14 +72,6 @@ namespace glm
# endif
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x4<T, P>::tmat3x4(tmat3x4<T, P> const & m)
{
this->value[0] = m.value[0];
this->value[1] = m.value[1];
this->value[2] = m.value[2];
}
template <typename T, precision P>
template <precision Q>
GLM_FUNC_QUALIFIER tmat3x4<T, P>::tmat3x4(tmat3x4<T, Q> const & m)
@ -238,15 +230,6 @@ namespace glm
//////////////////////////////////////////////////////////////
// Unary updatable operators
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x4<T, P>& tmat3x4<T, P>::operator=(tmat3x4<T, P> const & m)
{
this->value[0] = m[0];
this->value[1] = m[1];
this->value[2] = m[2];
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat3x4<T, P>& tmat3x4<T, P>::operator=(tmat3x4<U, P> const & m)

View File

@ -61,7 +61,6 @@ namespace glm
public:
// Constructors
GLM_FUNC_DECL tmat4x2();
GLM_FUNC_DECL tmat4x2(tmat4x2<T, P> const & m);
template <precision Q>
GLM_FUNC_DECL tmat4x2(tmat4x2<T, Q> const & m);
@ -116,7 +115,6 @@ namespace glm
GLM_FUNC_DECL col_type & operator[](length_t i);
GLM_FUNC_DECL col_type const & operator[](length_t i) const;
GLM_FUNC_DECL tmat4x2<T, P>& operator=(tmat4x2<T, P> const & m);
template <typename U>
GLM_FUNC_DECL tmat4x2<T, P>& operator=(tmat4x2<U, P> const & m);
template <typename U>

View File

@ -73,15 +73,6 @@ namespace glm
# endif
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x2<T, P>::tmat4x2(tmat4x2<T, P> const & m)
{
this->value[0] = m.value[0];
this->value[1] = m.value[1];
this->value[2] = m.value[2];
this->value[3] = m.value[3];
}
template <typename T, precision P>
template <precision Q>
GLM_FUNC_QUALIFIER tmat4x2<T, P>::tmat4x2(tmat4x2<T, Q> const & m)
@ -262,16 +253,6 @@ namespace glm
//////////////////////////////////////////////////////////////
// Unary updatable operators
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x2<T, P>& tmat4x2<T, P>::operator=(tmat4x2<T, P> const & m)
{
this->value[0] = m[0];
this->value[1] = m[1];
this->value[2] = m[2];
this->value[3] = m[3];
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat4x2<T, P>& tmat4x2<T, P>::operator=(tmat4x2<U, P> const & m)

View File

@ -60,7 +60,6 @@ namespace glm
public:
// Constructors
GLM_FUNC_DECL tmat4x3();
GLM_FUNC_DECL tmat4x3(tmat4x3<T, P> const & m);
template <precision Q>
GLM_FUNC_DECL tmat4x3(tmat4x3<T, Q> const & m);
@ -115,7 +114,6 @@ namespace glm
GLM_FUNC_DECL col_type & operator[](size_type i);
GLM_FUNC_DECL col_type const & operator[](size_type i) const;
GLM_FUNC_DECL tmat4x3<T, P> & operator=(tmat4x3<T, P> const & m);
template <typename U>
GLM_FUNC_DECL tmat4x3<T, P> & operator=(tmat4x3<U, P> const & m);
template <typename U>

View File

@ -73,15 +73,6 @@ namespace glm
# endif
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x3<T, P>::tmat4x3(tmat4x3<T, P> const & m)
{
this->value[0] = m.value[0];
this->value[1] = m.value[1];
this->value[2] = m.value[2];
this->value[3] = m.value[3];
}
template <typename T, precision P>
template <precision Q>
GLM_FUNC_QUALIFIER tmat4x3<T, P>::tmat4x3(tmat4x3<T, Q> const & m)
@ -262,16 +253,6 @@ namespace glm
//////////////////////////////////////////////////////////////
// Unary updatable operators
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x3<T, P>& tmat4x3<T, P>::operator=(tmat4x3<T, P> const & m)
{
this->value[0] = m[0];
this->value[1] = m[1];
this->value[2] = m[2];
this->value[3] = m[3];
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat4x3<T, P>& tmat4x3<T, P>::operator=(tmat4x3<U, P> const & m)

View File

@ -65,7 +65,7 @@ namespace glm
public:
// Constructors
GLM_FUNC_DECL tmat4x4();
GLM_FUNC_DECL tmat4x4(tmat4x4<T, P> const & m);
//GLM_FUNC_DECL tmat4x4(tmat4x4<T, P> const & m);
template <precision Q>
GLM_FUNC_DECL tmat4x4(tmat4x4<T, Q> const & m);
@ -120,7 +120,7 @@ namespace glm
GLM_FUNC_DECL col_type & operator[](length_t i);
GLM_FUNC_DECL col_type const & operator[](length_t i) const;
GLM_FUNC_DECL tmat4x4<T, P> & operator=(tmat4x4<T, P> const & m);
//GLM_FUNC_DECL tmat4x4<T, P> & operator=(tmat4x4<T, P> const & m);
template <typename U>
GLM_FUNC_DECL tmat4x4<T, P> & operator=(tmat4x4<U, P> const & m);
template <typename U>

View File

@ -132,15 +132,6 @@ namespace detail
this->value[3] = col_type(0, 0, 0, 1);
# endif
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x4<T, P>::tmat4x4(tmat4x4<T, P> const & m)
{
this->value[0] = m[0];
this->value[1] = m[1];
this->value[2] = m[2];
this->value[3] = m[3];
}
template <typename T, precision P>
template <precision Q>
@ -348,18 +339,6 @@ namespace detail
//////////////////////////////////////////////////////////////
// Operators
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x4<T, P>& tmat4x4<T, P>::operator=(tmat4x4<T, P> const & m)
{
//memcpy could be faster
//memcpy(&this->value, &m.value, 16 * sizeof(valType));
this->value[0] = m[0];
this->value[1] = m[1];
this->value[2] = m[2];
this->value[3] = m[3];
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat4x4<T, P>& tmat4x4<T, P>::operator=(tmat4x4<U, P> const & m)

View File

@ -102,7 +102,6 @@ namespace glm
// Implicit basic constructors
GLM_FUNC_DECL tvec1();
GLM_FUNC_DECL tvec1(tvec1<T, P> const & v);
template <precision Q>
GLM_FUNC_DECL tvec1(tvec1<T, Q> const & v);
@ -142,8 +141,6 @@ namespace glm
//////////////////////////////////////
// Unary arithmetic operators
GLM_FUNC_DECL tvec1<T, P> & operator=(tvec1<T, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec1<T, P> & operator=(tvec1<U, P> const & v);
template <typename U>

View File

@ -69,11 +69,6 @@ namespace glm
# endif
{}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec1<T, P>::tvec1(tvec1<T, P> const & v)
: x(v.x)
{}
template <typename T, precision P>
template <precision Q>
GLM_FUNC_QUALIFIER tvec1<T, P>::tvec1(tvec1<T, Q> const & v)
@ -122,13 +117,6 @@ namespace glm
//////////////////////////////////////
// Unary arithmetic operators
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec1<T, P> & tvec1<T, P>::operator=(tvec1<T, P> const & v)
{
this->x = v.x;
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec1<T, P> & tvec1<T, P>::operator=(tvec1<U, P> const & v)

View File

@ -104,7 +104,6 @@ namespace glm
// Implicit basic constructors
GLM_FUNC_DECL tvec2();
GLM_FUNC_DECL tvec2(tvec2<T, P> const & v);
template <precision Q>
GLM_FUNC_DECL tvec2(tvec2<T, Q> const & v);
@ -151,8 +150,6 @@ namespace glm
//////////////////////////////////////
// Unary arithmetic operators
GLM_FUNC_DECL tvec2<T, P> & operator=(tvec2<T, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec2<T, P> & operator=(tvec2<U, P> const & v);
template <typename U>

View File

@ -64,16 +64,11 @@ namespace glm
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec2<T, P>::tvec2()
# ifndef GLM_FORCE_NO_CTOR_INIT
# ifndef GLM_FORCE_NO_CTOR_INIT
: x(0), y(0)
# endif
{}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec2<T, P>::tvec2(tvec2<T, P> const & v)
: x(v.x), y(v.y)
{}
template <typename T, precision P>
template <precision Q>
GLM_FUNC_QUALIFIER tvec2<T, P>::tvec2(tvec2<T, Q> const & v)
@ -141,14 +136,6 @@ namespace glm
//////////////////////////////////////
// Unary arithmetic operators
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec2<T, P> & tvec2<T, P>::operator=(tvec2<T, P> const & v)
{
this->x = v.x;
this->y = v.y;
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec2<T, P> & tvec2<T, P>::operator=(tvec2<U, P> const & v)

View File

@ -105,7 +105,6 @@ namespace glm
// Implicit basic constructors
GLM_FUNC_DECL tvec3();
GLM_FUNC_DECL tvec3(tvec3<T, P> const & v);
template <precision Q>
GLM_FUNC_DECL tvec3(tvec3<T, Q> const & v);
@ -173,8 +172,6 @@ namespace glm
//////////////////////////////////////
// Unary arithmetic operators
GLM_FUNC_DECL tvec3<T, P> & operator=(tvec3<T, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec3<T, P> & operator=(tvec3<U, P> const & v);
template <typename U>

View File

@ -69,11 +69,6 @@ namespace glm
# endif
{}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec3<T, P>::tvec3(tvec3<T, P> const & v)
: x(v.x), y(v.y), z(v.z)
{}
template <typename T, precision P>
template <precision Q>
GLM_FUNC_QUALIFIER tvec3<T, P>::tvec3(tvec3<T, Q> const & v)
@ -170,15 +165,6 @@ namespace glm
//////////////////////////////////////
// Unary arithmetic operators
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec3<T, P>& tvec3<T, P>::operator=(tvec3<T, P> const & v)
{
this->x = v.x;
this->y = v.y;
this->z = v.z;
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec3<T, P>& tvec3<T, P>::operator=(tvec3<U, P> const & v)

View File

@ -67,7 +67,7 @@ namespace detail
}//namespace detail
template <typename T, precision P = defaultp>
GLM_ALIGNED_STRUCT(16) tvec4
struct tvec4
{
//////////////////////////////////////
// Implementation detail
@ -148,7 +148,6 @@ namespace detail
// Implicit basic constructors
GLM_FUNC_DECL tvec4();
GLM_FUNC_DECL tvec4(tvec4<T, P> const & v);
template <precision Q>
GLM_FUNC_DECL tvec4(tvec4<T, Q> const & v);
@ -158,6 +157,7 @@ namespace detail
GLM_FUNC_DECL explicit tvec4(ctor);
GLM_FUNC_DECL explicit tvec4(T const & s);
GLM_FUNC_DECL tvec4(T const & s0, T const & s1, T const & s2, T const & s3);
GLM_FUNC_DECL ~tvec4(){}
//////////////////////////////////////
// Conversion scalar constructors
@ -258,8 +258,6 @@ namespace detail
//////////////////////////////////////
// Unary arithmetic operators
GLM_FUNC_DECL tvec4<T, P> & operator=(tvec4<T, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec4<T, P> & operator=(tvec4<U, P> const & v);
template <typename U>

View File

@ -84,7 +84,7 @@ namespace glm
# endif
{}
#endif
/*
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec4<T, P>::tvec4(tvec4<T, P> const & v)
: x(v.x), y(v.y), z(v.z), w(v.w)
@ -101,7 +101,7 @@ namespace glm
: data(v.data)
{}
#endif
*/
template <typename T, precision P>
template <precision Q>
GLM_FUNC_QUALIFIER tvec4<T, P>::tvec4(tvec4<T, Q> const & v)
@ -283,7 +283,7 @@ namespace glm
//////////////////////////////////////
// Unary arithmetic operators
/*
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec4<T, P> & tvec4<T, P>::operator=(tvec4<T, P> const & v)
{
@ -309,7 +309,7 @@ namespace glm
return *this;
}
#endif
*/
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec4<T, P> & tvec4<T, P>::operator=(tvec4<U, P> const & v)

View File

@ -866,7 +866,7 @@ namespace sign
{
int Error = 0;
std::size_t const Count = 1000000000;
std::size_t const Count = 10000000;
std::vector<glm::int32> Input, Output;
Input.resize(Count);
Output.resize(Count);
@ -913,7 +913,7 @@ namespace sign
{
int Error = 0;
std::size_t const Count = 1000000000;
std::size_t const Count = 10000000;
std::vector<glm::int32> Input, Output;
Input.resize(Count);
Output.resize(Count);
@ -960,7 +960,7 @@ namespace sign
{
int Error = 0;
glm::uint32 const Count = 1000000000;
glm::uint32 const Count = 10000000;
std::clock_t Timestamp0 = std::clock();
glm::int32 Sum = 0;

View File

@ -37,11 +37,12 @@ namespace bitfieldInsert
typeU32 const Data32[] =
{
{0x00000000, 0xffffffff, 0, 31, 0x7fffffff},
{0x00000000, 0xffffffff, 0, 32, 0xffffffff},
{0x00000000, 0xffffffff, 0, 0, 0x00000000},
{0xff000000, 0x0000ff00, 8, 8, 0xff00ff00},
{0xffff0000, 0x0000ffff, 16, 16, 0x00000000},
{0x0000ffff, 0xffff0000, 16, 16, 0xffffffff},
{0x00000000, 0xffffffff, 0, 32, 0xffffffff},
{0x00000000, 0xffffffff, 0, 0, 0x00000000}
{0x0000ffff, 0xffff0000, 16, 16, 0xffffffff}
};
int test()
@ -664,7 +665,7 @@ namespace findMSB
std::clock_t Timestamps1 = std::clock();
for(std::size_t k = 0; k < 10000000; ++k)
for(std::size_t k = 0; k < 1000000; ++k)
for(std::size_t i = 0; i < sizeof(Data) / sizeof(type<int>); ++i)
{
int Result = findMSB_095(Data[i].Value);
@ -723,7 +724,7 @@ namespace findMSB
std::clock_t Timestamps1 = std::clock();
for(std::size_t k = 0; k < 10000000; ++k)
for(std::size_t k = 0; k < 1000000; ++k)
for(std::size_t i = 0; i < sizeof(Data) / sizeof(type<int>); ++i)
{
int Result = findMSB_nlz1(Data[i].Value);

View File

@ -188,6 +188,14 @@ int test_ctr()
{
int Error(0);
#if (GLM_LANG & GLM_LANG_CXX11_FLAG) || (GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC12)
//Error += std::is_trivially_default_constructible<glm::mat4>::value ? 0 : 1;
//Error += std::is_trivially_copy_assignable<glm::mat4>::value ? 0 : 1;
Error += std::is_trivially_copyable<glm::mat4>::value ? 0 : 1;
//Error += std::is_copy_constructible<glm::mat4>::value ? 0 : 1;
//Error += std::has_trivial_copy_constructor<glm::mat4>::value ? 0 : 1;
#endif
#if(GLM_HAS_INITIALIZER_LISTS)
glm::mat4 m0(
glm::vec4(0, 1, 2, 3),

View File

@ -44,6 +44,18 @@ int test_vec1_ctor()
{
int Error = 0;
#if (GLM_LANG & GLM_LANG_CXX11_FLAG) || (GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC12)
// Error += std::is_trivially_default_constructible<glm::vec1>::value ? 0 : 1;
// Error += std::is_trivially_copy_assignable<glm::vec1>::value ? 0 : 1;
Error += std::is_trivially_copyable<glm::vec1>::value ? 0 : 1;
Error += std::is_trivially_copyable<glm::dvec1>::value ? 0 : 1;
Error += std::is_trivially_copyable<glm::ivec1>::value ? 0 : 1;
Error += std::is_trivially_copyable<glm::uvec1>::value ? 0 : 1;
Error += std::has_trivial_copy_constructor<glm::vec1>::value ? 0 : 1;
Error += std::is_copy_constructible<glm::vec1>::value ? 0 : 1;
#endif
/*
#if GLM_HAS_INITIALIZER_LISTS
{

View File

@ -201,6 +201,18 @@ int test_vec2_ctor()
{
int Error = 0;
#if (GLM_LANG & GLM_LANG_CXX11_FLAG) || (GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC12)
// Error += std::is_trivially_default_constructible<glm::vec2>::value ? 0 : 1;
// Error += std::is_trivially_copy_assignable<glm::vec2>::value ? 0 : 1;
Error += std::is_trivially_copyable<glm::vec2>::value ? 0 : 1;
Error += std::is_trivially_copyable<glm::dvec2>::value ? 0 : 1;
Error += std::is_trivially_copyable<glm::ivec2>::value ? 0 : 1;
Error += std::is_trivially_copyable<glm::uvec2>::value ? 0 : 1;
Error += std::has_trivial_copy_constructor<glm::vec2>::value ? 0 : 1;
Error += std::is_copy_constructible<glm::vec2>::value ? 0 : 1;
#endif
#if GLM_HAS_INITIALIZER_LISTS
{
glm::vec2 a{ 0, 1 };

View File

@ -19,8 +19,20 @@
int test_vec3_ctor()
{
int Error = 0;
#if(GLM_HAS_INITIALIZER_LISTS)
#if (GLM_LANG & GLM_LANG_CXX11_FLAG) || (GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC12)
// Error += std::is_trivially_default_constructible<glm::vec3>::value ? 0 : 1;
// Error += std::is_trivially_copy_assignable<glm::vec3>::value ? 0 : 1;
Error += std::is_trivially_copyable<glm::vec3>::value ? 0 : 1;
Error += std::is_trivially_copyable<glm::dvec3>::value ? 0 : 1;
Error += std::is_trivially_copyable<glm::ivec3>::value ? 0 : 1;
Error += std::is_trivially_copyable<glm::uvec3>::value ? 0 : 1;
Error += std::has_trivial_copy_constructor<glm::vec3>::value ? 0 : 1;
Error += std::is_copy_constructible<glm::vec3>::value ? 0 : 1;
#endif
#if (GLM_HAS_INITIALIZER_LISTS)
{
glm::vec3 a{ 0, 1, 2 };
std::vector<glm::vec3> v = {

View File

@ -42,7 +42,23 @@ enum comp
int test_vec4_ctor()
{
int Error = 0;
glm::ivec4 A(1, 2, 3, 4);
glm::ivec4 B(A);
Error += glm::all(glm::equal(A, B)) ? 0 : 1;
#if (GLM_LANG & GLM_LANG_CXX11_FLAG) || (GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC12)
// Error += std::is_trivially_default_constructible<glm::vec4>::value ? 0 : 1;
// Error += std::is_trivially_copy_assignable<glm::vec4>::value ? 0 : 1;
Error += std::is_trivially_copyable<glm::vec4>::value ? 0 : 1;
Error += std::is_trivially_copyable<glm::dvec4>::value ? 0 : 1;
Error += std::is_trivially_copyable<glm::ivec4>::value ? 0 : 1;
Error += std::is_trivially_copyable<glm::uvec4>::value ? 0 : 1;
Error += std::has_trivial_copy_constructor<glm::vec4>::value ? 0 : 1;
Error += std::is_copy_constructible<glm::vec4>::value ? 0 : 1;
#endif
#if GLM_HAS_INITIALIZER_LISTS
{
glm::vec4 a{ 0, 1, 2, 3 };

View File

@ -103,10 +103,12 @@ namespace mask
{
type<glm::uint> const Data[] =
{
{0, 0x00000000},
{1, 0x00000001},
{2, 0x00000003},
{3, 0x00000007}
{ 0, 0x00000000},
{ 1, 0x00000001},
{ 2, 0x00000003},
{ 3, 0x00000007},
{31, 0x7fffffff},
{32, 0xffffffff}
};
int Error(0);
@ -142,10 +144,12 @@ namespace mask
{
type<glm::ivec4> const Data[] =
{
{glm::ivec4(0), glm::ivec4(0x00000000)},
{glm::ivec4(1), glm::ivec4(0x00000001)},
{glm::ivec4(2), glm::ivec4(0x00000003)},
{glm::ivec4(3), glm::ivec4(0x00000007)}
{glm::ivec4( 0), glm::ivec4(0x00000000)},
{glm::ivec4( 1), glm::ivec4(0x00000001)},
{glm::ivec4( 2), glm::ivec4(0x00000003)},
{glm::ivec4( 3), glm::ivec4(0x00000007)},
{glm::ivec4(31), glm::ivec4(0x7fffffff)},
{glm::ivec4(32), glm::ivec4(0xffffffff)}
};
int Error(0);