Commit 198bce39 authored by Frank Barchard's avatar Frank Barchard

Cast for clang-cl 64 bit build warnings in unittests

R=kjellander@chromium.org
BUG=libyuv:649

Review URL: https://codereview.chromium.org/2414763002 .
parent a7166c33
Name: libyuv Name: libyuv
URL: http://code.google.com/p/libyuv/ URL: http://code.google.com/p/libyuv/
Version: 1624 Version: 1625
License: BSD License: BSD
License File: LICENSE License File: LICENSE
......
...@@ -11,6 +11,6 @@ ...@@ -11,6 +11,6 @@
#ifndef INCLUDE_LIBYUV_VERSION_H_ #ifndef INCLUDE_LIBYUV_VERSION_H_
#define INCLUDE_LIBYUV_VERSION_H_ #define INCLUDE_LIBYUV_VERSION_H_
#define LIBYUV_VERSION 1624 #define LIBYUV_VERSION 1625
#endif // INCLUDE_LIBYUV_VERSION_H_ #endif // INCLUDE_LIBYUV_VERSION_H_
...@@ -157,19 +157,19 @@ TEST_F(LibYUVBaseTest, BenchmarkARGBDetect_Opt) { ...@@ -157,19 +157,19 @@ TEST_F(LibYUVBaseTest, BenchmarkARGBDetect_Opt) {
src_a[0] = 0; src_a[0] = 0;
fourcc = ARGBDetect(src_a, benchmark_width_ * 4, fourcc = ARGBDetect(src_a, benchmark_width_ * 4,
benchmark_width_, benchmark_height_); benchmark_width_, benchmark_height_);
EXPECT_EQ(libyuv::FOURCC_BGRA, fourcc); EXPECT_EQ(static_cast<uint32>(libyuv::FOURCC_BGRA), fourcc);
src_a[0] = 255; src_a[0] = 255;
src_a[3] = 0; src_a[3] = 0;
fourcc = ARGBDetect(src_a, benchmark_width_ * 4, fourcc = ARGBDetect(src_a, benchmark_width_ * 4,
benchmark_width_, benchmark_height_); benchmark_width_, benchmark_height_);
EXPECT_EQ(libyuv::FOURCC_ARGB, fourcc); EXPECT_EQ(static_cast<uint32>(libyuv::FOURCC_ARGB), fourcc);
src_a[3] = 255; src_a[3] = 255;
for (int i = 0; i < benchmark_iterations_; ++i) { for (int i = 0; i < benchmark_iterations_; ++i) {
fourcc = ARGBDetect(src_a, benchmark_width_ * 4, fourcc = ARGBDetect(src_a, benchmark_width_ * 4,
benchmark_width_, benchmark_height_); benchmark_width_, benchmark_height_);
} }
EXPECT_EQ(0, fourcc); EXPECT_EQ(0u, fourcc);
free_aligned_buffer_page_end(src_a); free_aligned_buffer_page_end(src_a);
} }
...@@ -185,19 +185,19 @@ TEST_F(LibYUVBaseTest, BenchmarkARGBDetect_Unaligned) { ...@@ -185,19 +185,19 @@ TEST_F(LibYUVBaseTest, BenchmarkARGBDetect_Unaligned) {
src_a[0 + 1] = 0; src_a[0 + 1] = 0;
fourcc = ARGBDetect(src_a + 1, benchmark_width_ * 4, fourcc = ARGBDetect(src_a + 1, benchmark_width_ * 4,
benchmark_width_, benchmark_height_); benchmark_width_, benchmark_height_);
EXPECT_EQ(libyuv::FOURCC_BGRA, fourcc); EXPECT_EQ(static_cast<uint32>(libyuv::FOURCC_BGRA), fourcc);
src_a[0 + 1] = 255; src_a[0 + 1] = 255;
src_a[3 + 1] = 0; src_a[3 + 1] = 0;
fourcc = ARGBDetect(src_a + 1, benchmark_width_ * 4, fourcc = ARGBDetect(src_a + 1, benchmark_width_ * 4,
benchmark_width_, benchmark_height_); benchmark_width_, benchmark_height_);
EXPECT_EQ(libyuv::FOURCC_ARGB, fourcc); EXPECT_EQ(static_cast<uint32>(libyuv::FOURCC_ARGB), fourcc);
src_a[3 + 1] = 255; src_a[3 + 1] = 255;
for (int i = 0; i < benchmark_iterations_; ++i) { for (int i = 0; i < benchmark_iterations_; ++i) {
fourcc = ARGBDetect(src_a + 1, benchmark_width_ * 4, fourcc = ARGBDetect(src_a + 1, benchmark_width_ * 4,
benchmark_width_, benchmark_height_); benchmark_width_, benchmark_height_);
} }
EXPECT_EQ(0, fourcc); EXPECT_EQ(0u, fourcc);
free_aligned_buffer_page_end(src_a); free_aligned_buffer_page_end(src_a);
} }
...@@ -226,7 +226,7 @@ TEST_F(LibYUVBaseTest, BenchmarkSumSquareError_Opt) { ...@@ -226,7 +226,7 @@ TEST_F(LibYUVBaseTest, BenchmarkSumSquareError_Opt) {
h1 = ComputeSumSquareError(src_a, src_b, kMaxWidth); h1 = ComputeSumSquareError(src_a, src_b, kMaxWidth);
} }
EXPECT_EQ(0, h1); EXPECT_EQ(0u, h1);
free_aligned_buffer_page_end(src_a); free_aligned_buffer_page_end(src_a);
free_aligned_buffer_page_end(src_b); free_aligned_buffer_page_end(src_b);
...@@ -242,18 +242,18 @@ TEST_F(LibYUVBaseTest, SumSquareError) { ...@@ -242,18 +242,18 @@ TEST_F(LibYUVBaseTest, SumSquareError) {
uint64 err; uint64 err;
err = ComputeSumSquareError(src_a, src_b, kMaxWidth); err = ComputeSumSquareError(src_a, src_b, kMaxWidth);
EXPECT_EQ(0, err); EXPECT_EQ(0u, err);
memset(src_a, 1, kMaxWidth); memset(src_a, 1, kMaxWidth);
err = ComputeSumSquareError(src_a, src_b, kMaxWidth); err = ComputeSumSquareError(src_a, src_b, kMaxWidth);
EXPECT_EQ(err, kMaxWidth); EXPECT_EQ(static_cast<int>(err), kMaxWidth);
memset(src_a, 190, kMaxWidth); memset(src_a, 190, kMaxWidth);
memset(src_b, 193, kMaxWidth); memset(src_b, 193, kMaxWidth);
err = ComputeSumSquareError(src_a, src_b, kMaxWidth); err = ComputeSumSquareError(src_a, src_b, kMaxWidth);
EXPECT_EQ(kMaxWidth * 3 * 3, err); EXPECT_EQ(static_cast<int>(err), kMaxWidth * 3 * 3);
for (int i = 0; i < kMaxWidth; ++i) { for (int i = 0; i < kMaxWidth; ++i) {
src_a[i] = (fastrand() & 0xff); src_a[i] = (fastrand() & 0xff);
......
...@@ -2017,7 +2017,6 @@ TEST_F(LibYUVConvertTest, FMT_PLANAR##To##FMT_B##_##FMT_C##N) { \ ...@@ -2017,7 +2017,6 @@ TEST_F(LibYUVConvertTest, FMT_PLANAR##To##FMT_B##_##FMT_C##N) { \
dst_argb_b + OFF, kStrideB, \ dst_argb_b + OFF, kStrideB, \
kWidth, NEG kHeight, ATTEN); \ kWidth, NEG kHeight, ATTEN); \
} \ } \
int max_diff = 0; \
/* Convert to a 3rd format in 1 step and 2 steps and compare */ \ /* Convert to a 3rd format in 1 step and 2 steps and compare */ \
const int kStrideC = kWidth * BPP_C; \ const int kStrideC = kWidth * BPP_C; \
align_buffer_page_end(dst_argb_c, kStrideC * kHeight + OFF); \ align_buffer_page_end(dst_argb_c, kStrideC * kHeight + OFF); \
......
...@@ -96,7 +96,7 @@ TEST_F(LibYUVBaseTest, TestCpuId) { ...@@ -96,7 +96,7 @@ TEST_F(LibYUVBaseTest, TestCpuId) {
cpu_info[3] = 0; cpu_info[3] = 0;
printf("Cpu Vendor: %s %x %x %x\n", reinterpret_cast<char*>(&cpu_info[0]), printf("Cpu Vendor: %s %x %x %x\n", reinterpret_cast<char*>(&cpu_info[0]),
cpu_info[0], cpu_info[1], cpu_info[2]); cpu_info[0], cpu_info[1], cpu_info[2]);
EXPECT_EQ(12, strlen(reinterpret_cast<char*>(&cpu_info[0]))); EXPECT_EQ(12u, strlen(reinterpret_cast<char*>(&cpu_info[0])));
// CPU Family and Model // CPU Family and Model
// 3:0 - Stepping // 3:0 - Stepping
......
...@@ -42,23 +42,23 @@ static bool TestValidFourCC(uint32 fourcc, int bpp) { ...@@ -42,23 +42,23 @@ static bool TestValidFourCC(uint32 fourcc, int bpp) {
} }
TEST_F(LibYUVBaseTest, TestCanonicalFourCC) { TEST_F(LibYUVBaseTest, TestCanonicalFourCC) {
EXPECT_EQ(FOURCC_I420, CanonicalFourCC(FOURCC_IYUV)); EXPECT_EQ(static_cast<uint32>(FOURCC_I420), CanonicalFourCC(FOURCC_IYUV));
EXPECT_EQ(FOURCC_I420, CanonicalFourCC(FOURCC_YU12)); EXPECT_EQ(static_cast<uint32>(FOURCC_I420), CanonicalFourCC(FOURCC_YU12));
EXPECT_EQ(FOURCC_I422, CanonicalFourCC(FOURCC_YU16)); EXPECT_EQ(static_cast<uint32>(FOURCC_I422), CanonicalFourCC(FOURCC_YU16));
EXPECT_EQ(FOURCC_I444, CanonicalFourCC(FOURCC_YU24)); EXPECT_EQ(static_cast<uint32>(FOURCC_I444), CanonicalFourCC(FOURCC_YU24));
EXPECT_EQ(FOURCC_YUY2, CanonicalFourCC(FOURCC_YUYV)); EXPECT_EQ(static_cast<uint32>(FOURCC_YUY2), CanonicalFourCC(FOURCC_YUYV));
EXPECT_EQ(FOURCC_YUY2, CanonicalFourCC(FOURCC_YUVS)); EXPECT_EQ(static_cast<uint32>(FOURCC_YUY2), CanonicalFourCC(FOURCC_YUVS));
EXPECT_EQ(FOURCC_UYVY, CanonicalFourCC(FOURCC_HDYC)); EXPECT_EQ(static_cast<uint32>(FOURCC_UYVY), CanonicalFourCC(FOURCC_HDYC));
EXPECT_EQ(FOURCC_UYVY, CanonicalFourCC(FOURCC_2VUY)); EXPECT_EQ(static_cast<uint32>(FOURCC_UYVY), CanonicalFourCC(FOURCC_2VUY));
EXPECT_EQ(FOURCC_MJPG, CanonicalFourCC(FOURCC_JPEG)); EXPECT_EQ(static_cast<uint32>(FOURCC_MJPG), CanonicalFourCC(FOURCC_JPEG));
EXPECT_EQ(FOURCC_MJPG, CanonicalFourCC(FOURCC_DMB1)); EXPECT_EQ(static_cast<uint32>(FOURCC_MJPG), CanonicalFourCC(FOURCC_DMB1));
EXPECT_EQ(FOURCC_RAW, CanonicalFourCC(FOURCC_RGB3)); EXPECT_EQ(static_cast<uint32>(FOURCC_RAW), CanonicalFourCC(FOURCC_RGB3));
EXPECT_EQ(FOURCC_24BG, CanonicalFourCC(FOURCC_BGR3)); EXPECT_EQ(static_cast<uint32>(FOURCC_24BG), CanonicalFourCC(FOURCC_BGR3));
EXPECT_EQ(FOURCC_BGRA, CanonicalFourCC(FOURCC_CM32)); EXPECT_EQ(static_cast<uint32>(FOURCC_BGRA), CanonicalFourCC(FOURCC_CM32));
EXPECT_EQ(FOURCC_RAW, CanonicalFourCC(FOURCC_CM24)); EXPECT_EQ(static_cast<uint32>(FOURCC_RAW), CanonicalFourCC(FOURCC_CM24));
EXPECT_EQ(FOURCC_RGBO, CanonicalFourCC(FOURCC_L555)); EXPECT_EQ(static_cast<uint32>(FOURCC_RGBO), CanonicalFourCC(FOURCC_L555));
EXPECT_EQ(FOURCC_RGBP, CanonicalFourCC(FOURCC_L565)); EXPECT_EQ(static_cast<uint32>(FOURCC_RGBP), CanonicalFourCC(FOURCC_L565));
EXPECT_EQ(FOURCC_RGBO, CanonicalFourCC(FOURCC_5551)); EXPECT_EQ(static_cast<uint32>(FOURCC_RGBO), CanonicalFourCC(FOURCC_5551));
} }
TEST_F(LibYUVBaseTest, TestFourCC) { TEST_F(LibYUVBaseTest, TestFourCC) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment