Fix sign mismatch warning

Cast negative ints to uint32_t to avoid int/uint comparison warning.
This commit is contained in:
Tobin Ehlis 2018-08-31 08:12:16 -06:00 committed by David Neto
parent cb0f1f565b
commit 58e53ea82f

View File

@ -673,11 +673,16 @@ TEST(HexFloatOperationTest, NormalizedSignificand) {
// For denormalized numbers we expect the normalized significand to
// shift as if it were normalized. This means, in practice that the
// top_most set bit will be cut off. Looks very similar to above (on purpose)
EXPECT_EQ(bits_set({}), normalized_significand({0}, -127));
EXPECT_EQ(bits_set({3}), normalized_significand({0, 4}, -128));
EXPECT_EQ(bits_set({3}), normalized_significand({0, 4}, -127));
EXPECT_EQ(bits_set({}), normalized_significand({22}, -127));
EXPECT_EQ(bits_set({0}), normalized_significand({21, 22}, -127));
EXPECT_EQ(bits_set({}),
normalized_significand({0}, static_cast<uint32_t>(-127)));
EXPECT_EQ(bits_set({3}),
normalized_significand({0, 4}, static_cast<uint32_t>(-128)));
EXPECT_EQ(bits_set({3}),
normalized_significand({0, 4}, static_cast<uint32_t>(-127)));
EXPECT_EQ(bits_set({}),
normalized_significand({22}, static_cast<uint32_t>(-127)));
EXPECT_EQ(bits_set({0}),
normalized_significand({21, 22}, static_cast<uint32_t>(-127)));
}
// Returns the 32-bit floating point value created by