Skip to content

Commit

Permalink
fix warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
christophe-lunarg committed Feb 7, 2024
1 parent cabd2c3 commit ca87394
Showing 1 changed file with 97 additions and 106 deletions.
203 changes: 97 additions & 106 deletions test/gtc/gtc_type_aligned.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#if GLM_CONFIG_ALIGNED_GENTYPES == GLM_ENABLE
#include <glm/gtc/type_aligned.hpp>
#include <glm/gtc/type_precision.hpp>
#include <glm/ext/scalar_relational.hpp>
#include <glm/ext/vector_relational.hpp>
#include <glm/ext/matrix_relational.hpp>

Expand Down Expand Up @@ -97,35 +98,35 @@ static int test_copy_vec4()
{
glm::aligned_vec4 const u(1.f, 2.f, 3.f, 4.f);
glm::packed_vec4 const v(u);
Error += v.x == u.x ? 0 : 1;
Error += v.y == u.y ? 0 : 1;
Error += v.z == u.z ? 0 : 1;
Error += v.w == u.w ? 0 : 1;
Error += glm::equal(v.x, u.x, glm::epsilon<float>()) ? 0 : 1;
Error += glm::equal(v.y, u.y, glm::epsilon<float>()) ? 0 : 1;
Error += glm::equal(v.z, u.z, glm::epsilon<float>()) ? 0 : 1;
Error += glm::equal(v.w, u.w, glm::epsilon<float>()) ? 0 : 1;
}
{
glm::packed_vec4 const u(1.f, 2.f, 3.f, 4.f);
glm::aligned_vec4 const v(u);
Error += v.x == u.x ? 0 : 1;
Error += v.y == u.y ? 0 : 1;
Error += v.z == u.z ? 0 : 1;
Error += v.w == u.w ? 0 : 1;
Error += glm::equal(v.x, u.x, glm::epsilon<float>()) ? 0 : 1;
Error += glm::equal(v.y, u.y, glm::epsilon<float>()) ? 0 : 1;
Error += glm::equal(v.z, u.z, glm::epsilon<float>()) ? 0 : 1;
Error += glm::equal(v.w, u.w, glm::epsilon<float>()) ? 0 : 1;
}

{
glm::aligned_dvec4 const u(1., 2., 3., 4.);
glm::packed_dvec4 const v(u);
Error += v.x == u.x ? 0 : 1;
Error += v.y == u.y ? 0 : 1;
Error += v.z == u.z ? 0 : 1;
Error += v.w == u.w ? 0 : 1;
Error += glm::equal(v.x, u.x, glm::epsilon<double>()) ? 0 : 1;
Error += glm::equal(v.y, u.y, glm::epsilon<double>()) ? 0 : 1;
Error += glm::equal(v.z, u.z, glm::epsilon<double>()) ? 0 : 1;
Error += glm::equal(v.w, u.w, glm::epsilon<double>()) ? 0 : 1;
}
{
glm::packed_dvec4 const u(1.f, 2.f, 3.f, 4.f);
glm::aligned_dvec4 const v(u);
Error += v.x == u.x ? 0 : 1;
Error += v.y == u.y ? 0 : 1;
Error += v.z == u.z ? 0 : 1;
Error += v.w == u.w ? 0 : 1;
Error += glm::equal(v.x, u.x, glm::epsilon<double>()) ? 0 : 1;
Error += glm::equal(v.y, u.y, glm::epsilon<double>()) ? 0 : 1;
Error += glm::equal(v.z, u.z, glm::epsilon<double>()) ? 0 : 1;
Error += glm::equal(v.w, u.w, glm::epsilon<double>()) ? 0 : 1;
}

{
Expand Down Expand Up @@ -154,31 +155,31 @@ static int test_copy_vec3()
{
glm::aligned_vec3 const u(1.f, 2.f, 3.f);
glm::packed_vec3 const v(u);
Error += v.x == u.x ? 0 : 1;
Error += v.y == u.y ? 0 : 1;
Error += v.z == u.z ? 0 : 1;
Error += glm::equal(v.x, u.x, glm::epsilon<float>()) ? 0 : 1;
Error += glm::equal(v.y, u.y, glm::epsilon<float>()) ? 0 : 1;
Error += glm::equal(v.z, u.z, glm::epsilon<float>()) ? 0 : 1;
}
{
glm::packed_vec3 const u(1.f, 2.f, 3.f);
glm::aligned_vec3 const v(u);
Error += v.x == u.x ? 0 : 1;
Error += v.y == u.y ? 0 : 1;
Error += v.z == u.z ? 0 : 1;
Error += glm::equal(v.x, u.x, glm::epsilon<float>()) ? 0 : 1;
Error += glm::equal(v.y, u.y, glm::epsilon<float>()) ? 0 : 1;
Error += glm::equal(v.z, u.z, glm::epsilon<float>()) ? 0 : 1;
}

{
glm::aligned_dvec3 const u(1., 2., 3.);
glm::packed_dvec3 const v(u);
Error += v.x == u.x ? 0 : 1;
Error += v.y == u.y ? 0 : 1;
Error += v.z == u.z ? 0 : 1;
Error += glm::equal(v.x, u.x, glm::epsilon<double>()) ? 0 : 1;
Error += glm::equal(v.y, u.y, glm::epsilon<double>()) ? 0 : 1;
Error += glm::equal(v.z, u.z, glm::epsilon<double>()) ? 0 : 1;
}
{
glm::packed_dvec3 const u(1.f, 2.f, 3.f);
glm::aligned_dvec3 const v(u);
Error += v.x == u.x ? 0 : 1;
Error += v.y == u.y ? 0 : 1;
Error += v.z == u.z ? 0 : 1;
Error += glm::equal(v.x, u.x, glm::epsilon<double>()) ? 0 : 1;
Error += glm::equal(v.y, u.y, glm::epsilon<double>()) ? 0 : 1;
Error += glm::equal(v.z, u.z, glm::epsilon<double>()) ? 0 : 1;
}

{
Expand All @@ -205,49 +206,49 @@ static int test_splat_vec3()
{
glm::aligned_vec3 const u(1.f, 2.f, 3.f);
glm::aligned_vec3 const v(glm::splatX(u));
Error += v.x == u.x ? 0 : 1;
Error += v.y == u.x ? 0 : 1;
Error += v.z == u.x ? 0 : 1;
Error += glm::equal(v.x, u.x, glm::epsilon<float>()) ? 0 : 1;
Error += glm::equal(v.y, u.x, glm::epsilon<float>()) ? 0 : 1;
Error += glm::equal(v.z, u.x, glm::epsilon<float>()) ? 0 : 1;
}

{
glm::aligned_vec3 const u(1.f, 2.f, 3.f);
glm::aligned_vec3 const v(glm::splatY(u));
Error += v.x == u.y ? 0 : 1;
Error += v.y == u.y ? 0 : 1;
Error += v.z == u.y ? 0 : 1;
Error += glm::equal(v.x, u.y, glm::epsilon<float>()) ? 0 : 1;
Error += glm::equal(v.y, u.y, glm::epsilon<float>()) ? 0 : 1;
Error += glm::equal(v.z, u.y, glm::epsilon<float>()) ? 0 : 1;
}

{
glm::aligned_vec3 const u(1.f, 2.f, 3.f);
glm::aligned_vec3 const v(glm::splatZ(u));
Error += v.x == u.z ? 0 : 1;
Error += v.y == u.z ? 0 : 1;
Error += v.z == u.z ? 0 : 1;
Error += glm::equal(v.x, u.z, glm::epsilon<float>()) ? 0 : 1;
Error += glm::equal(v.y, u.z, glm::epsilon<float>()) ? 0 : 1;
Error += glm::equal(v.z, u.z, glm::epsilon<float>()) ? 0 : 1;
}

{
glm::aligned_dvec3 const u(1., 2., 3.);
glm::aligned_dvec3 const v(glm::splatX(u));
Error += v.x == u.x ? 0 : 1;
Error += v.y == u.x ? 0 : 1;
Error += v.z == u.x ? 0 : 1;
Error += glm::equal(v.x, u.x, glm::epsilon<double>()) ? 0 : 1;
Error += glm::equal(v.y, u.x, glm::epsilon<double>()) ? 0 : 1;
Error += glm::equal(v.z, u.x, glm::epsilon<double>()) ? 0 : 1;
}

{
glm::aligned_dvec3 const u(1., 2., 3.);
glm::aligned_dvec3 const v(glm::splatY(u));
Error += v.x == u.y ? 0 : 1;
Error += v.y == u.y ? 0 : 1;
Error += v.z == u.y ? 0 : 1;
Error += glm::equal(v.x, u.y, glm::epsilon<double>()) ? 0 : 1;
Error += glm::equal(v.y, u.y, glm::epsilon<double>()) ? 0 : 1;
Error += glm::equal(v.z, u.y, glm::epsilon<double>()) ? 0 : 1;
}

{
glm::aligned_dvec3 const u(1., 2., 3.);
glm::aligned_dvec3 const v(glm::splatZ(u));
Error += v.x == u.z ? 0 : 1;
Error += v.y == u.z ? 0 : 1;
Error += v.z == u.z ? 0 : 1;
Error += glm::equal(v.x, u.z, glm::epsilon<double>()) ? 0 : 1;
Error += glm::equal(v.y, u.z, glm::epsilon<double>()) ? 0 : 1;
Error += glm::equal(v.z, u.z, glm::epsilon<double>()) ? 0 : 1;
}

return Error;
Expand All @@ -260,52 +261,52 @@ static int test_splat_vec4()
glm::aligned_vec4 const u(1.f, 2.f, 3.f, 4.f);
{
glm::aligned_vec4 const v(glm::splatX(u));
Error += v.x == u.x ? 0 : 1;
Error += v.y == u.x ? 0 : 1;
Error += v.z == u.x ? 0 : 1;
Error += v.w == u.x ? 0 : 1;
Error += glm::equal(v.x, u.x, glm::epsilon<float>()) ? 0 : 1;
Error += glm::equal(v.y, u.x, glm::epsilon<float>()) ? 0 : 1;
Error += glm::equal(v.z, u.x, glm::epsilon<float>()) ? 0 : 1;
Error += glm::equal(v.w, u.x, glm::epsilon<float>()) ? 0 : 1;
}

{
glm::aligned_vec4 const v(glm::splatY(u));
Error += v.x == u.y ? 0 : 1;
Error += v.y == u.y ? 0 : 1;
Error += v.z == u.y ? 0 : 1;
Error += v.w == u.y ? 0 : 1;
Error += glm::equal(v.x, u.y, glm::epsilon<float>()) ? 0 : 1;
Error += glm::equal(v.y, u.y, glm::epsilon<float>()) ? 0 : 1;
Error += glm::equal(v.z, u.y, glm::epsilon<float>()) ? 0 : 1;
Error += glm::equal(v.w, u.y, glm::epsilon<float>()) ? 0 : 1;
}

{
glm::aligned_vec4 const v(glm::splatZ(u));
Error += v.x == u.z ? 0 : 1;
Error += v.y == u.z ? 0 : 1;
Error += v.z == u.z ? 0 : 1;
Error += v.w == u.z ? 0 : 1;
Error += glm::equal(v.x, u.z, glm::epsilon<float>()) ? 0 : 1;
Error += glm::equal(v.y, u.z, glm::epsilon<float>()) ? 0 : 1;
Error += glm::equal(v.z, u.z, glm::epsilon<float>()) ? 0 : 1;
Error += glm::equal(v.w, u.z, glm::epsilon<float>()) ? 0 : 1;
}
}
{
glm::aligned_dvec4 const u(1.f, 2.f, 3.f, 4.f);
{
glm::aligned_dvec4 const v(glm::splatX(u));
Error += v.x == u.x ? 0 : 1;
Error += v.y == u.x ? 0 : 1;
Error += v.z == u.x ? 0 : 1;
Error += v.w == u.x ? 0 : 1;
Error += glm::equal(v.x, u.x, glm::epsilon<double>()) ? 0 : 1;
Error += glm::equal(v.y, u.x, glm::epsilon<double>()) ? 0 : 1;
Error += glm::equal(v.z, u.x, glm::epsilon<double>()) ? 0 : 1;
Error += glm::equal(v.w, u.x, glm::epsilon<double>()) ? 0 : 1;
}

{
glm::aligned_dvec4 const v(glm::splatY(u));
Error += v.x == u.y ? 0 : 1;
Error += v.y == u.y ? 0 : 1;
Error += v.z == u.y ? 0 : 1;
Error += v.w == u.y ? 0 : 1;
Error += glm::equal(v.x, u.y, glm::epsilon<double>()) ? 0 : 1;
Error += glm::equal(v.y, u.y, glm::epsilon<double>()) ? 0 : 1;
Error += glm::equal(v.z, u.y, glm::epsilon<double>()) ? 0 : 1;
Error += glm::equal(v.w, u.y, glm::epsilon<double>()) ? 0 : 1;
}

{
glm::aligned_dvec4 const v(glm::splatZ(u));
Error += v.x == u.z ? 0 : 1;
Error += v.y == u.z ? 0 : 1;
Error += v.z == u.z ? 0 : 1;
Error += v.w == u.z ? 0 : 1;
Error += glm::equal(v.x, u.z, glm::epsilon<double>()) ? 0 : 1;
Error += glm::equal(v.y, u.z, glm::epsilon<double>()) ? 0 : 1;
Error += glm::equal(v.z, u.z, glm::epsilon<double>()) ? 0 : 1;
Error += glm::equal(v.w, u.z, glm::epsilon<double>()) ? 0 : 1;
}
}
return Error;
Expand All @@ -318,72 +319,62 @@ static int test_copy_vec4_vec3()
{
glm::aligned_vec3 const u(1.f, 2.f, 3.f);
glm::aligned_vec4 const v(glm::xyz0(u));
Error += v.x == u.x ? 0 : 1;
Error += v.y == u.y ? 0 : 1;
Error += v.z == u.z ? 0 : 1;
Error += v.w == 0.0f ? 0 : 1;
Error += glm::equal(v.x, u.x, glm::epsilon<float>()) ? 0 : 1;
Error += glm::equal(v.y, u.y, glm::epsilon<float>()) ? 0 : 1;
Error += glm::equal(v.z, u.z, glm::epsilon<float>()) ? 0 : 1;
Error += glm::equal(v.w, 0.0f, glm::epsilon<float>()) ? 0 : 1;
}

{
glm::aligned_vec3 const u(1.f, 2.f, 3.f);
glm::aligned_vec4 const v(glm::xyz1(u));
Error += v.x == u.x ? 0 : 1;
Error += v.y == u.y ? 0 : 1;
Error += v.z == u.z ? 0 : 1;
Error += v.w == 1.0f ? 0 : 1;
Error += glm::equal(v.x, u.x, glm::epsilon<float>()) ? 0 : 1;
Error += glm::equal(v.y, u.y, glm::epsilon<float>()) ? 0 : 1;
Error += glm::equal(v.z, u.z, glm::epsilon<float>()) ? 0 : 1;
Error += glm::equal(v.w, 1.0f, glm::epsilon<float>()) ? 0 : 1;
}

{
glm::aligned_dvec3 const u(1., 2., 3.);
glm::aligned_dvec4 const v(glm::xyz0(u));
Error += v.x == u.x ? 0 : 1;
Error += v.y == u.y ? 0 : 1;
Error += v.z == u.z ? 0 : 1;
Error += v.w == 0. ? 0 : 1;
Error += glm::equal(v.x, u.x, glm::epsilon<double>()) ? 0 : 1;
Error += glm::equal(v.y, u.y, glm::epsilon<double>()) ? 0 : 1;
Error += glm::equal(v.z, u.z, glm::epsilon<double>()) ? 0 : 1;
Error += glm::equal(v.w, 0.0, glm::epsilon<double>()) ? 0 : 1;
}

{
glm::aligned_dvec3 const u(1., 2., 3.);
glm::aligned_dvec4 const v(glm::xyz1(u));
Error += v.x == u.x ? 0 : 1;
Error += v.y == u.y ? 0 : 1;
Error += v.z == u.z ? 0 : 1;
Error += v.w == 1.0 ? 0 : 1;
}

{
glm::aligned_dvec3 const u(1., 2., 3.);
glm::aligned_dvec4 const v(glm::xyzz(u));
Error += v.x == u.x ? 0 : 1;
Error += v.y == u.y ? 0 : 1;
Error += v.z == u.z ? 0 : 1;
Error += v.w == u.z ? 0 : 1;
Error += glm::equal(v.x, u.x, glm::epsilon<double>()) ? 0 : 1;
Error += glm::equal(v.y, u.y, glm::epsilon<double>()) ? 0 : 1;
Error += glm::equal(v.z, u.z, glm::epsilon<double>()) ? 0 : 1;
Error += glm::equal(v.w, 1.0, glm::epsilon<double>()) ? 0 : 1;
}

{
glm::aligned_dvec3 const u(1., 2., 3.);
glm::aligned_dvec4 const v(glm::xyzz(u));
Error += v.x == u.x ? 0 : 1;
Error += v.y == u.y ? 0 : 1;
Error += v.z == u.z ? 0 : 1;
Error += v.w == u.z ? 0 : 1;
Error += glm::equal(v.x, u.x, glm::epsilon<double>()) ? 0 : 1;
Error += glm::equal(v.y, u.y, glm::epsilon<double>()) ? 0 : 1;
Error += glm::equal(v.z, u.z, glm::epsilon<double>()) ? 0 : 1;
Error += glm::equal(v.w, u.z, glm::epsilon<double>()) ? 0 : 1;
}


{
glm::aligned_vec4 const u(1.f, 2.f, 3.f, 4.f);
glm::aligned_vec3 const v(glm::xyz(u));
Error += v.x == u.x ? 0 : 1;
Error += v.y == u.y ? 0 : 1;
Error += v.z == u.z ? 0 : 1;
Error += glm::equal(v.x, u.x, glm::epsilon<float>()) ? 0 : 1;
Error += glm::equal(v.y, u.y, glm::epsilon<float>()) ? 0 : 1;
Error += glm::equal(v.z, u.z, glm::epsilon<float>()) ? 0 : 1;
}

{
glm::aligned_dvec4 const u(1., 2., 3., 4.);
glm::aligned_dvec3 const v(glm::xyz(u));
Error += v.x == u.x ? 0 : 1;
Error += v.y == u.y ? 0 : 1;
Error += v.z == u.z ? 0 : 1;
Error += glm::equal(v.x, u.x, glm::epsilon<double>()) ? 0 : 1;
Error += glm::equal(v.y, u.y, glm::epsilon<double>()) ? 0 : 1;
Error += glm::equal(v.z, u.z, glm::epsilon<double>()) ? 0 : 1;
}
return Error;
}
Expand Down

0 comments on commit ca87394

Please sign in to comment.