Skip to content

Commit a0d06b3

Browse files
committed
Make a variable unsigned to represent the data more correctly
1 parent 022d33d commit a0d06b3

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

qt5/tests/check_annotations.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,12 @@ private Q_SLOTS:
3333
void TestAnnotations::checkQColorPrecision()
3434
{
3535
bool precisionOk = true;
36-
for (int i = std::numeric_limits<uint16_t>::min(); i <= std::numeric_limits<uint16_t>::max(); i++) {
36+
for (uint32_t i = std::numeric_limits<uint16_t>::min(); i <= std::numeric_limits<uint16_t>::max(); i++) {
3737
double normalized = static_cast<uint16_t>(i) / static_cast<double>(std::numeric_limits<uint16_t>::max());
3838
const std::string serialized = GooString::format("{0:.5f}", normalized);
3939
double deserialized = gatof(serialized.c_str());
4040
uint16_t denormalized = std::round(deserialized * std::numeric_limits<uint16_t>::max());
41-
if (static_cast<uint16_t>(i) != denormalized) {
41+
if (i != denormalized) {
4242
precisionOk = false;
4343
break;
4444
}

0 commit comments

Comments
 (0)