From b9367619603ec55115ccb5977038d6de9c0851a2 Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Wed, 9 Aug 2017 22:15:01 +0200 Subject: [PATCH] Fixed warnings --- test/core/core_func_common.cpp | 12 ++++++------ test/core/core_func_matrix.cpp | 2 +- test/core/core_type_mat4x4.cpp | 8 ++++---- test/gtc/gtc_packing.cpp | 2 +- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/test/core/core_func_common.cpp b/test/core/core_func_common.cpp index 16388318..fdb201e8 100644 --- a/test/core/core_func_common.cpp +++ b/test/core/core_func_common.cpp @@ -16,12 +16,12 @@ namespace floor_ int Error(0); { - float A(1.1f); + float A = 1.1f; float B = glm::floor(A); } { - double A(1.1f); + double A = 1.1; double B = glm::floor(A); } @@ -33,7 +33,7 @@ namespace floor_ } { - glm::dvec1 A(1.1f); + glm::dvec1 A(1.1); glm::dvec1 B = glm::floor(A); Error += glm::all(glm::epsilonEqual(B, glm::dvec1(1.0), 0.0001)) ? 0 : 1; @@ -47,7 +47,7 @@ namespace floor_ } { - glm::dvec2 A(1.1f); + glm::dvec2 A(1.1); glm::dvec2 B = glm::floor(A); Error += glm::all(glm::epsilonEqual(B, glm::dvec2(1.0), 0.0001)) ? 0 : 1; @@ -61,7 +61,7 @@ namespace floor_ } { - glm::dvec3 A(1.1f); + glm::dvec3 A(1.1); glm::dvec3 B = glm::floor(A); Error += glm::all(glm::epsilonEqual(B, glm::dvec3(1.0), 0.0001)) ? 0 : 1; @@ -75,7 +75,7 @@ namespace floor_ } { - glm::dvec4 A(1.1f); + glm::dvec4 A(1.1); glm::dvec4 B = glm::floor(A); Error += glm::all(glm::epsilonEqual(B, glm::dvec4(1.0), 0.0001)) ? 0 : 1; diff --git a/test/core/core_func_matrix.cpp b/test/core/core_func_matrix.cpp index e0c1e8a6..78c149e3 100644 --- a/test/core/core_func_matrix.cpp +++ b/test/core/core_func_matrix.cpp @@ -248,7 +248,7 @@ int test_inverse_perf(std::size_t Count, std::size_t Instance, char const * Mess //glm::uint Ulp = 0; //Ulp = glm::max(glm::float_distance(*Dst, *Src), Ulp); - printf("inverse<%s>(%f): %lu\n", Message, Diff, EndTime - StartTime); + printf("inverse<%s>(%f): %lu\n", Message, static_cast(Diff), EndTime - StartTime); return 0; } diff --git a/test/core/core_type_mat4x4.cpp b/test/core/core_type_mat4x4.cpp index 036d0dff..ee750fac 100644 --- a/test/core/core_type_mat4x4.cpp +++ b/test/core/core_type_mat4x4.cpp @@ -17,10 +17,10 @@ template void print(genType const & Mat0) { printf("mat4(\n"); - printf("\tvec4(%2.9f, %2.9f, %2.9f, %2.9f)\n", Mat0[0][0], Mat0[0][1], Mat0[0][2], Mat0[0][3]); - printf("\tvec4(%2.9f, %2.9f, %2.9f, %2.9f)\n", Mat0[1][0], Mat0[1][1], Mat0[1][2], Mat0[1][3]); - printf("\tvec4(%2.9f, %2.9f, %2.9f, %2.9f)\n", Mat0[2][0], Mat0[2][1], Mat0[2][2], Mat0[2][3]); - printf("\tvec4(%2.9f, %2.9f, %2.9f, %2.9f))\n\n", Mat0[3][0], Mat0[3][1], Mat0[3][2], Mat0[3][3]); + printf("\tvec4(%2.9f, %2.9f, %2.9f, %2.9f)\n", static_cast(Mat0[0][0]), static_cast(Mat0[0][1]), static_cast(Mat0[0][2]), static_cast(Mat0[0][3])); + printf("\tvec4(%2.9f, %2.9f, %2.9f, %2.9f)\n", static_cast(Mat0[1][0]), static_cast(Mat0[1][1]), static_cast(Mat0[1][2]), static_cast(Mat0[1][3])); + printf("\tvec4(%2.9f, %2.9f, %2.9f, %2.9f)\n", static_cast(Mat0[2][0]), static_cast(Mat0[2][1]), static_cast(Mat0[2][2]), static_cast(Mat0[2][3])); + printf("\tvec4(%2.9f, %2.9f, %2.9f, %2.9f))\n\n", static_cast(Mat0[3][0]), static_cast(Mat0[3][1]), static_cast(Mat0[3][2]), static_cast(Mat0[3][3])); } int test_inverse_mat4x4() diff --git a/test/gtc/gtc_packing.cpp b/test/gtc/gtc_packing.cpp index 239417f7..8fdf2ec6 100644 --- a/test/gtc/gtc_packing.cpp +++ b/test/gtc/gtc_packing.cpp @@ -46,7 +46,7 @@ void print_11bits(glm::uint const & s) void print_value(float const & s) { - printf("%2.5f, ", s); + printf("%2.5f, ", static_cast(s); print_bits(s); printf(", "); // print_11bits(detail::floatTo11bit(s));