diff --git a/glm/core/func_packing.inl b/glm/core/func_packing.inl index 4821a358..7e26b91c 100644 --- a/glm/core/func_packing.inl +++ b/glm/core/func_packing.inl @@ -61,7 +61,7 @@ namespace glm GLM_FUNC_QUALIFIER uint packUnorm4x8(vec4 const & v) { u8vec4 Topack(round(clamp(v, 0.0f, 1.0f) * 255.0f)); - return reinterpret_cast(&Topack); + return reinterpret_cast(Topack); } GLM_FUNC_QUALIFIER vec4 unpackUnorm4x8(uint const & p) diff --git a/glm/gtc/packing.inl b/glm/gtc/packing.inl index d7b98391..326a4423 100644 --- a/glm/gtc/packing.inl +++ b/glm/gtc/packing.inl @@ -230,7 +230,7 @@ namespace detail GLM_FUNC_QUALIFIER float unpackUnorm1x8(uint8 const & p) { - float Unpack(static_cast(*const_cast(&p))); + float Unpack(static_cast(p)); return Unpack * float(0.0039215686274509803921568627451); // 1 / 255 } diff --git a/glm/gtc/quaternion.inl b/glm/gtc/quaternion.inl index a34e40ce..a824f7bd 100644 --- a/glm/gtc/quaternion.inl +++ b/glm/gtc/quaternion.inl @@ -92,7 +92,7 @@ namespace detail z(static_cast(l.begin()[2])), w(static_cast(l.begin()[3])) { - assert(v.size() >= this->length()); + assert(l.size() >= this->length()); } #endif//GLM_HAS_INITIALIZER_LISTS diff --git a/test/core/core_type_mat2x3.cpp b/test/core/core_type_mat2x3.cpp index b6321209..0a1684ab 100644 --- a/test/core/core_type_mat2x3.cpp +++ b/test/core/core_type_mat2x3.cpp @@ -7,7 +7,9 @@ // File : test/core/type_mat2x3.cpp /////////////////////////////////////////////////////////////////////////////////////////////////// +#include #include +#include static int test_operators() { @@ -34,8 +36,8 @@ int test_ctr() #if(GLM_HAS_INITIALIZER_LISTS) glm::mat2x3 m0( - glm::vec2(0, 1, 2), - glm::vec2(3, 4, 5)); + glm::vec3(0, 1, 2), + glm::vec3(3, 4, 5)); glm::mat2x3 m1{0, 1, 2, 3, 4, 5}; diff --git a/test/core/core_type_mat2x4.cpp b/test/core/core_type_mat2x4.cpp index 4b4e67a3..3e88dacb 100644 --- a/test/core/core_type_mat2x4.cpp +++ b/test/core/core_type_mat2x4.cpp @@ -7,7 +7,9 @@ // File : test/core/type_mat2x4.cpp /////////////////////////////////////////////////////////////////////////////////////////////////// +#include #include +#include static int test_operators() { diff --git a/test/core/core_type_mat3x2.cpp b/test/core/core_type_mat3x2.cpp index 2cdefc54..feb3f1eb 100644 --- a/test/core/core_type_mat3x2.cpp +++ b/test/core/core_type_mat3x2.cpp @@ -7,7 +7,9 @@ // File : test/core/type_mat3x2.cpp /////////////////////////////////////////////////////////////////////////////////////////////////// +#include #include +#include static bool test_operators() { diff --git a/test/core/core_type_mat3x3.cpp b/test/core/core_type_mat3x3.cpp index 610d7ff2..3edf8ab6 100644 --- a/test/core/core_type_mat3x3.cpp +++ b/test/core/core_type_mat3x3.cpp @@ -10,6 +10,7 @@ #include #include #include +#include void print(glm::dmat3 const & Mat0) { @@ -94,7 +95,7 @@ int test_ctr() glm::mat3x3 m0( glm::vec3(0, 1, 2), glm::vec3(3, 4, 5), - glm::vec3(6, 7, 9)); + glm::vec3(6, 7, 8)); glm::mat3x3 m1{0, 1, 2, 3, 4, 5, 6, 7, 8}; @@ -117,13 +118,13 @@ int test_ctr() std::vector v2{ { { 0, 1, 2}, - { 4, 5, 6}, - { 7, 8, 9} + { 3, 4, 5}, + { 6, 7, 8} }, { { 0, 1, 2}, - { 4, 5, 6}, - { 7, 8, 9} + { 3, 4, 5}, + { 6, 7, 8} } }; diff --git a/test/core/core_type_mat3x4.cpp b/test/core/core_type_mat3x4.cpp index 89573268..dd91bf20 100644 --- a/test/core/core_type_mat3x4.cpp +++ b/test/core/core_type_mat3x4.cpp @@ -7,7 +7,9 @@ // File : test/core/type_mat3x4.cpp /////////////////////////////////////////////////////////////////////////////////////////////////// +#include #include +#include static bool test_operators() { @@ -34,17 +36,16 @@ int test_ctr() #if(GLM_HAS_INITIALIZER_LISTS) glm::mat3x4 m0( - glm::vec3(0, 1, 2), - glm::vec3(3, 4, 5), - glm::vec3(6, 7, 8), - glm::vec3(9, 10, 11)); + glm::vec4(0, 1, 2, 3), + glm::vec4(4, 5, 6, 7), + glm::vec4(8, 9, 10, 11)); glm::mat3x4 m1{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11}; glm::mat3x4 m2{ - {0, 1, 2}, - {3, 4, 5}, - {6, 7, 8}}; + {0, 1, 2, 3}, + {4, 5, 6, 7}, + {8, 9, 10, 11}}; for(int i = 0; i < m0.length(); ++i) Error += glm::all(glm::equal(m0[i], m2[i])) ? 0 : 1; @@ -53,18 +54,20 @@ int test_ctr() Error += glm::all(glm::equal(m1[i], m2[i])) ? 0 : 1; std::vector v1{ - {0, 1, 2, 3, 4, 5, 6, 7, 8}, - {0, 1, 2, 3, 4, 5, 6, 7, 8} + {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11}, + {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11} }; std::vector v2{ { - { 0, 1, 2}, - { 4, 5, 6} + { 0, 1, 2, 3}, + { 4, 5, 6, 7}, + { 8, 9, 10, 11} }, { - { 0, 1, 2}, - { 4, 5, 6} + { 0, 1, 2, 3}, + { 4, 5, 6, 7}, + { 8, 9, 10, 11} } };