Fix warnings

This commit is contained in:
Victor Zverovich 2019-04-06 22:10:10 -07:00
parent ab1474ef66
commit 07d5a86a7c
2 changed files with 6 additions and 4 deletions

View File

@ -1018,10 +1018,12 @@ Char* format_uint(Char* buffer, internal::uintptr_t n, int num_digits,
bool = false) { bool = false) {
auto char_digits = std::numeric_limits<unsigned char>::digits / 4; auto char_digits = std::numeric_limits<unsigned char>::digits / 4;
int start = (num_digits + char_digits - 1) / char_digits - 1; int start = (num_digits + char_digits - 1) / char_digits - 1;
if (int start_digits = num_digits % char_digits) if (int start_digits = num_digits % char_digits) {
buffer = format_uint<BASE_BITS>(buffer, n.value[start--], start_digits); unsigned value = n.value[start--];
buffer = format_uint<BASE_BITS>(buffer, value, start_digits);
}
for (; start >= 0; --start) { for (; start >= 0; --start) {
auto value = n.value[start]; unsigned value = n.value[start];
buffer += char_digits; buffer += char_digits;
auto p = buffer; auto p = buffer;
for (int i = 0; i < char_digits; ++i) { for (int i = 0; i < char_digits; ++i) {

View File

@ -94,7 +94,7 @@ TEST(FPTest, GetCachedPower) {
EXPECT_LE(exp, fp.e); EXPECT_LE(exp, fp.e);
int dec_exp_step = 8; int dec_exp_step = 8;
EXPECT_LE(fp.e, exp + dec_exp_step * log2(10)); EXPECT_LE(fp.e, exp + dec_exp_step * log2(10));
EXPECT_DOUBLE_EQ(pow(10, dec_exp), ldexp(fp.f, fp.e)); EXPECT_DOUBLE_EQ(pow(10, dec_exp), ldexp(static_cast<double>(fp.f), fp.e));
} }
} }