From a7059eca33bc3bac7e3b71e2099b2fc578230353 Mon Sep 17 00:00:00 2001 From: Hien Ho Date: Fri, 9 Aug 2019 16:33:57 -0700 Subject: test/lpf_test: fix int sanitizer warning runtime error: implicit conversion from type 'int' of value 65594 (32-bit, signed) to type 'uint16_t' (aka 'unsigned short') changed the value to 58 (16-bit, unsigned) BUG=webm:1615 Change-Id: I6046a4a4fc0a108c337153f2c59d5cef5c8dcbd6 --- test/lpf_test.cc | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'test') diff --git a/test/lpf_test.cc b/test/lpf_test.cc index dfdd51599..9db1181c6 100644 --- a/test/lpf_test.cc +++ b/test/lpf_test.cc @@ -75,9 +75,9 @@ void InitInput(Pixel *s, Pixel *ref_s, ACMRandom *rnd, const uint8_t limit, if (j < 1) { tmp_s[j] = rnd->Rand16(); } else if (val & 0x20) { // Increment by a value within the limit. - tmp_s[j] = tmp_s[j - 1] + (limit - 1); + tmp_s[j] = static_cast(tmp_s[j - 1] + (limit - 1)); } else { // Decrement by a value within the limit. - tmp_s[j] = tmp_s[j - 1] - (limit - 1); + tmp_s[j] = static_cast(tmp_s[j - 1] - (limit - 1)); } j++; } @@ -94,11 +94,11 @@ void InitInput(Pixel *s, Pixel *ref_s, ACMRandom *rnd, const uint8_t limit, if (j < 1) { tmp_s[j] = rnd->Rand16(); } else if (val & 0x20) { // Increment by a value within the limit. - tmp_s[(j % 32) * 32 + j / 32] = - tmp_s[((j - 1) % 32) * 32 + (j - 1) / 32] + (limit - 1); + tmp_s[(j % 32) * 32 + j / 32] = static_cast( + tmp_s[((j - 1) % 32) * 32 + (j - 1) / 32] + (limit - 1)); } else { // Decrement by a value within the limit. - tmp_s[(j % 32) * 32 + j / 32] = - tmp_s[((j - 1) % 32) * 32 + (j - 1) / 32] - (limit - 1); + tmp_s[(j % 32) * 32 + j / 32] = static_cast( + tmp_s[((j - 1) % 32) * 32 + (j - 1) / 32] - (limit - 1)); } j++; } -- cgit v1.2.3