From f6b2293f7603de7930c83f7e7e2952191b48ad7c Mon Sep 17 00:00:00 2001 From: Pavel Krajcevski Date: Thu, 19 Feb 2015 00:53:34 -0800 Subject: [PATCH] Fix some compiler warnings --- ASTCEncoder/test/TestIntegerEncoding.cpp | 24 ++++++++++++------------ PVRTCEncoder/test/ImageTest.cpp | 16 ++++++++-------- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/ASTCEncoder/test/TestIntegerEncoding.cpp b/ASTCEncoder/test/TestIntegerEncoding.cpp index cf98ed7..68e79b0 100644 --- a/ASTCEncoder/test/TestIntegerEncoding.cpp +++ b/ASTCEncoder/test/TestIntegerEncoding.cpp @@ -58,50 +58,50 @@ TEST(IntegerEncoding, GetEncoding) { // According to table C.2.7 IntegerEncodedValue val = IntegerEncodedValue::CreateEncoding(1); EXPECT_EQ(val.GetEncoding(), ASTCC::eIntegerEncoding_JustBits); - EXPECT_EQ(val.BaseBitLength(), 1); + EXPECT_EQ(val.BaseBitLength(), 1U); val = IntegerEncodedValue::CreateEncoding(2); EXPECT_EQ(val.GetEncoding(), ASTCC::eIntegerEncoding_Trit); - EXPECT_EQ(val.BaseBitLength(), 0); + EXPECT_EQ(val.BaseBitLength(), 0U); val = IntegerEncodedValue::CreateEncoding(3); EXPECT_EQ(val.GetEncoding(), ASTCC::eIntegerEncoding_JustBits); - EXPECT_EQ(val.BaseBitLength(), 2); + EXPECT_EQ(val.BaseBitLength(), 2U); val = IntegerEncodedValue::CreateEncoding(4); EXPECT_EQ(val.GetEncoding(), ASTCC::eIntegerEncoding_Quint); - EXPECT_EQ(val.BaseBitLength(), 0); + EXPECT_EQ(val.BaseBitLength(), 0U); val = IntegerEncodedValue::CreateEncoding(5); EXPECT_EQ(val.GetEncoding(), ASTCC::eIntegerEncoding_Trit); - EXPECT_EQ(val.BaseBitLength(), 1); + EXPECT_EQ(val.BaseBitLength(), 1U); val = IntegerEncodedValue::CreateEncoding(7); EXPECT_EQ(val.GetEncoding(), ASTCC::eIntegerEncoding_JustBits); - EXPECT_EQ(val.BaseBitLength(), 3); + EXPECT_EQ(val.BaseBitLength(), 3U); val = IntegerEncodedValue::CreateEncoding(9); EXPECT_EQ(val.GetEncoding(), ASTCC::eIntegerEncoding_Quint); - EXPECT_EQ(val.BaseBitLength(), 1); + EXPECT_EQ(val.BaseBitLength(), 1U); val = IntegerEncodedValue::CreateEncoding(11); EXPECT_EQ(val.GetEncoding(), ASTCC::eIntegerEncoding_Trit); - EXPECT_EQ(val.BaseBitLength(), 2); + EXPECT_EQ(val.BaseBitLength(), 2U); val = IntegerEncodedValue::CreateEncoding(15); EXPECT_EQ(val.GetEncoding(), ASTCC::eIntegerEncoding_JustBits); - EXPECT_EQ(val.BaseBitLength(), 4); + EXPECT_EQ(val.BaseBitLength(), 4U); val = IntegerEncodedValue::CreateEncoding(19); EXPECT_EQ(val.GetEncoding(), ASTCC::eIntegerEncoding_Quint); - EXPECT_EQ(val.BaseBitLength(), 2); + EXPECT_EQ(val.BaseBitLength(), 2U); val = IntegerEncodedValue::CreateEncoding(23); EXPECT_EQ(val.GetEncoding(), ASTCC::eIntegerEncoding_Trit); - EXPECT_EQ(val.BaseBitLength(), 3); + EXPECT_EQ(val.BaseBitLength(), 3U); val = IntegerEncodedValue::CreateEncoding(31); EXPECT_EQ(val.GetEncoding(), ASTCC::eIntegerEncoding_JustBits); - EXPECT_EQ(val.BaseBitLength(), 5); + EXPECT_EQ(val.BaseBitLength(), 5U); } diff --git a/PVRTCEncoder/test/ImageTest.cpp b/PVRTCEncoder/test/ImageTest.cpp index 97dcc10..4b89f70 100644 --- a/PVRTCEncoder/test/ImageTest.cpp +++ b/PVRTCEncoder/test/ImageTest.cpp @@ -74,15 +74,15 @@ TEST(Image, BilinearUpscale) { for(uint32 i = 0; i < img.GetWidth(); i++) { for(uint32 j = 0; j < img.GetHeight(); j++) { if(i == 0) { - EXPECT_EQ(img(i, j).R(), i); + EXPECT_EQ(static_cast(img(i, j).R()), i); } else { - EXPECT_EQ(img(i, j).R(), i-1); + EXPECT_EQ(static_cast(img(i, j).R()), i-1); } if(j == 0) { - EXPECT_EQ(img(i, j).G(), j); + EXPECT_EQ(static_cast(img(i, j).G()), j); } else { - EXPECT_EQ(img(i, j).G(), j-1); + EXPECT_EQ(static_cast(img(i, j).G()), j-1); } } } @@ -145,13 +145,13 @@ TEST(Image, NonuniformBilinearUpscale) { } else if(i == 15) { EXPECT_EQ(img(i, j).R(), 12); } else { - EXPECT_EQ(img(i, j).R(), i-2); + EXPECT_EQ(static_cast(img(i, j).R()), i-2); } if(j == 0) { EXPECT_EQ(img(i, j).G(), 0); } else { - EXPECT_EQ(img(i, j).G(), j-1); + EXPECT_EQ(static_cast(img(i, j).G()), j-1); } } } @@ -198,7 +198,7 @@ TEST(Image, BilinearUpscaleWrapped) { } else if(i == 15) { EXPECT_EQ(p.R(), 9); } else { - EXPECT_EQ(p.R(), i-2); + EXPECT_EQ(static_cast(p.R()), i-2); } if(j == 0) { @@ -208,7 +208,7 @@ TEST(Image, BilinearUpscaleWrapped) { } else if(j == 15) { EXPECT_EQ(p.G(), 9); } else { - EXPECT_EQ(p.G(), j-2); + EXPECT_EQ(static_cast(p.G()), j-2); } } }