ref: 0d4453c8fe16a3423c8b17546488e9f464e2fff4
parent: 9b8acbfee4608db95c761e95887aadf69015d045
parent: a7059eca33bc3bac7e3b71e2099b2fc578230353
author: Hien Ho <[email protected]>
date: Wed Aug 21 18:13:35 EDT 2019
Merge "test/lpf_test: fix int sanitizer warning"
--- a/test/lpf_test.cc
+++ b/test/lpf_test.cc
@@ -75,9 +75,9 @@
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<uint16_t>(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<uint16_t>(tmp_s[j - 1] - (limit - 1));
}
j++;
}
@@ -94,11 +94,11 @@
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<uint16_t>(
+ 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<uint16_t>(
+ tmp_s[((j - 1) % 32) * 32 + (j - 1) / 32] - (limit - 1));
}
j++;
}