fmt/fmt_char_width.patch

33 lines
1.3 KiB
Diff

--- a/fmt/format.h
+++ b/fmt/format.h
@@ -1822,21 +1822,21 @@
typedef typename BasicWriter<Char>::CharPtr CharPtr;
Char fill = internal::CharTraits<Char>::cast(spec_.fill());
CharPtr out = CharPtr();
- const unsigned CHAR_WIDTH = 1;
- if (spec_.width_ > CHAR_WIDTH) {
+ const unsigned CHAR_SIZE = 1;
+ if (spec_.width_ > CHAR_SIZE) {
out = writer_.grow_buffer(spec_.width_);
if (spec_.align_ == ALIGN_RIGHT) {
- std::uninitialized_fill_n(out, spec_.width_ - CHAR_WIDTH, fill);
- out += spec_.width_ - CHAR_WIDTH;
+ std::uninitialized_fill_n(out, spec_.width_ - CHAR_SIZE, fill);
+ out += spec_.width_ - CHAR_SIZE;
} else if (spec_.align_ == ALIGN_CENTER) {
out = writer_.fill_padding(out, spec_.width_,
- internal::check(CHAR_WIDTH), fill);
+ internal::check(CHAR_SIZE), fill);
} else {
- std::uninitialized_fill_n(out + CHAR_WIDTH,
- spec_.width_ - CHAR_WIDTH, fill);
+ std::uninitialized_fill_n(out + CHAR_SIZE,
+ spec_.width_ - CHAR_SIZE, fill);
}
} else {
- out = writer_.grow_buffer(CHAR_WIDTH);
+ out = writer_.grow_buffer(CHAR_SIZE);
}
*out = internal::CharTraits<Char>::cast(value);
}