From 18672ef9941cb98d4818743085d6e5df82655ae9 Mon Sep 17 00:00:00 2001 From: "Yan, Shaobo" Date: Wed, 22 May 2019 02:41:49 +0000 Subject: [PATCH] Fix MSVC compilation failure because of implicit conversions This patch fixed compile error because of implicit conversions when is_clang = false. BUG=dawn:151 Change-Id: Id94f3f62147962cb73be0d0688ef03b2811d863c Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/7380 Commit-Queue: Corentin Wallez Reviewed-by: Corentin Wallez Reviewed-by: Kai Ninomiya --- src/tests/end2end/VertexFormatTests.cpp | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/tests/end2end/VertexFormatTests.cpp b/src/tests/end2end/VertexFormatTests.cpp index df04776b7b..6d20bb8d5c 100644 --- a/src/tests/end2end/VertexFormatTests.cpp +++ b/src/tests/end2end/VertexFormatTests.cpp @@ -486,8 +486,8 @@ TEST_P(VertexFormatTest, UChar2Norm) { std::numeric_limits::min(), 0, // padding two bytes for stride 0, - std::numeric_limits::max() / 2, - std::numeric_limits::min() / 2, + std::numeric_limits::max() / 2u, + std::numeric_limits::min() / 2u, 0, // padding two bytes for stride 0, 200, @@ -498,8 +498,8 @@ TEST_P(VertexFormatTest, UChar2Norm) { std::vector expectedData = {std::numeric_limits::max(), std::numeric_limits::min(), - std::numeric_limits::max() / 2, - std::numeric_limits::min() / 2, + std::numeric_limits::max() / 2u, + std::numeric_limits::min() / 2u, 200, 201}; @@ -511,8 +511,8 @@ TEST_P(VertexFormatTest, UChar4Norm) { std::numeric_limits::min(), 0, 0, - std::numeric_limits::max() / 2, - std::numeric_limits::min() / 2, + std::numeric_limits::max() / 2u, + std::numeric_limits::min() / 2u, 0, 0, 200, @@ -631,8 +631,8 @@ TEST_P(VertexFormatTest, Short4) { TEST_P(VertexFormatTest, UShort2Norm) { std::vector vertexData = {std::numeric_limits::max(), std::numeric_limits::min(), - std::numeric_limits::max() / 2, - std::numeric_limits::min() / 2, + std::numeric_limits::max() / 2u, + std::numeric_limits::min() / 2u, 3456, 6543}; @@ -644,8 +644,8 @@ TEST_P(VertexFormatTest, UShort4Norm) { std::numeric_limits::min(), 0, 0, - std::numeric_limits::max() / 2, - std::numeric_limits::min() / 2, + std::numeric_limits::max() / 2u, + std::numeric_limits::min() / 2u, 0, 0, 2987, @@ -686,14 +686,14 @@ TEST_P(VertexFormatTest, Short4Norm) { TEST_P(VertexFormatTest, Half2) { std::vector vertexData = - Float32ToFloat16(std::vector({14.8, -0.0, 22.5, 1.3, +0.0, -24.8})); + Float32ToFloat16(std::vector({14.8f, -0.0f, 22.5f, 1.3f, +0.0f, -24.8f})); DoVertexFormatTest(dawn::VertexFormat::Half2, vertexData, vertexData); } TEST_P(VertexFormatTest, Half4) { std::vector vertexData = Float32ToFloat16(std::vector( - {+0.0, -16.8, 18.2, -0.0, 12.5, 1.3, 14.8, -12.4, 22.5, -48.8, 47.4, -24.8})); + {+0.0f, -16.8f, 18.2f, -0.0f, 12.5f, 1.3f, 14.8f, -12.4f, 22.5f, -48.8f, 47.4f, -24.8f})); DoVertexFormatTest(dawn::VertexFormat::Half4, vertexData, vertexData); }