Fix warnings.

This commit is contained in:
Victor Zverovich 2013-09-08 13:30:14 -07:00
parent 93e4125248
commit 88972f487b

View File

@ -304,6 +304,7 @@ void fmt::BasicWriter<Char>::FormatDouble(
*format_ptr = '\0'; *format_ptr = '\0';
// Format using snprintf. // Format using snprintf.
Char fill = static_cast<Char>(spec.fill());
for (;;) { for (;;) {
std::size_t size = buffer_.capacity() - offset; std::size_t size = buffer_.capacity() - offset;
Char *start = &buffer_[offset]; Char *start = &buffer_[offset];
@ -316,7 +317,7 @@ void fmt::BasicWriter<Char>::FormatDouble(
*(start - 1) = sign; *(start - 1) = sign;
sign = 0; sign = 0;
} else { } else {
*(start - 1) = spec.fill(); *(start - 1) = fill;
} }
++n; ++n;
} }
@ -325,12 +326,12 @@ void fmt::BasicWriter<Char>::FormatDouble(
unsigned width = spec.width(); unsigned width = spec.width();
CharPtr p = GrowBuffer(width); CharPtr p = GrowBuffer(width);
std::copy(p, p + n, p + (width - n) / 2); std::copy(p, p + n, p + (width - n) / 2);
FillPadding(p, spec.width(), n, spec.fill()); FillPadding(p, spec.width(), n, fill);
return; return;
} }
if (spec.fill() != ' ' || sign) { if (spec.fill() != ' ' || sign) {
while (*start == ' ') while (*start == ' ')
*start++ = spec.fill(); *start++ = fill;
if (sign) if (sign)
*(start - 1) = sign; *(start - 1) = sign;
} }