Commit ea5dce39 authored by Victor Zverovich's avatar Victor Zverovich

Simplify format specs.

parent a1bd3358
...@@ -1227,7 +1227,7 @@ TEST(FormatterTest, FormatUsingIOStreams) { ...@@ -1227,7 +1227,7 @@ TEST(FormatterTest, FormatUsingIOStreams) {
class Answer {}; class Answer {};
template <typename Char> template <typename Char>
void Format(BasicWriter<Char> &f, const fmt::FormatSpec<Char> &spec, Answer) { void Format(BasicWriter<Char> &f, const fmt::FormatSpec &spec, Answer) {
f.Write("42", spec); f.Write("42", spec);
} }
......
...@@ -170,7 +170,7 @@ void fmt::BasicWriter<Char>::FormatDecimal( ...@@ -170,7 +170,7 @@ void fmt::BasicWriter<Char>::FormatDecimal(
template <typename Char> template <typename Char>
typename fmt::BasicWriter<Char>::CharPtr typename fmt::BasicWriter<Char>::CharPtr
fmt::BasicWriter<Char>::PrepareFilledBuffer( fmt::BasicWriter<Char>::PrepareFilledBuffer(
unsigned size, const AlignSpec<Char> &spec, char sign) { unsigned size, const AlignSpec &spec, char sign) {
unsigned width = spec.width(); unsigned width = spec.width();
if (width <= size) { if (width <= size) {
CharPtr p = GrowBuffer(size); CharPtr p = GrowBuffer(size);
...@@ -208,7 +208,7 @@ typename fmt::BasicWriter<Char>::CharPtr ...@@ -208,7 +208,7 @@ typename fmt::BasicWriter<Char>::CharPtr
template <typename Char> template <typename Char>
template <typename T> template <typename T>
void fmt::BasicWriter<Char>::FormatDouble( void fmt::BasicWriter<Char>::FormatDouble(
T value, const FormatSpec<Char> &spec, int precision) { T value, const FormatSpec &spec, int precision) {
// Check type. // Check type.
char type = spec.type(); char type = spec.type();
bool upper = false; bool upper = false;
...@@ -438,7 +438,7 @@ void fmt::BasicFormatter<Char>::DoFormat() { ...@@ -438,7 +438,7 @@ void fmt::BasicFormatter<Char>::DoFormat() {
const Arg &arg = ParseArgIndex(s); const Arg &arg = ParseArgIndex(s);
FormatSpec<Char> spec; FormatSpec spec;
int precision = -1; int precision = -1;
if (*s == ':') { if (*s == ':') {
++s; ++s;
...@@ -666,10 +666,10 @@ void fmt::BasicFormatter<Char>::DoFormat() { ...@@ -666,10 +666,10 @@ void fmt::BasicFormatter<Char>::DoFormat() {
// Explicit instantiations for char. // Explicit instantiations for char.
template void fmt::BasicWriter<char>::FormatDouble<double>( template void fmt::BasicWriter<char>::FormatDouble<double>(
double value, const FormatSpec<char> &spec, int precision); double value, const FormatSpec &spec, int precision);
template void fmt::BasicWriter<char>::FormatDouble<long double>( template void fmt::BasicWriter<char>::FormatDouble<long double>(
long double value, const FormatSpec<char> &spec, int precision); long double value, const FormatSpec &spec, int precision);
template fmt::BasicWriter<char>::CharPtr template fmt::BasicWriter<char>::CharPtr
fmt::BasicWriter<char>::FillPadding(CharPtr buffer, fmt::BasicWriter<char>::FillPadding(CharPtr buffer,
...@@ -680,7 +680,7 @@ template void fmt::BasicWriter<char>::FormatDecimal( ...@@ -680,7 +680,7 @@ template void fmt::BasicWriter<char>::FormatDecimal(
template fmt::BasicWriter<char>::CharPtr template fmt::BasicWriter<char>::CharPtr
fmt::BasicWriter<char>::PrepareFilledBuffer( fmt::BasicWriter<char>::PrepareFilledBuffer(
unsigned size, const AlignSpec<char> &spec, char sign); unsigned size, const AlignSpec &spec, char sign);
template void fmt::BasicFormatter<char>::ReportError( template void fmt::BasicFormatter<char>::ReportError(
const char *s, StringRef message) const; const char *s, StringRef message) const;
...@@ -698,10 +698,10 @@ template void fmt::BasicFormatter<char>::DoFormat(); ...@@ -698,10 +698,10 @@ template void fmt::BasicFormatter<char>::DoFormat();
// Explicit instantiations for wchar_t. // Explicit instantiations for wchar_t.
template void fmt::BasicWriter<wchar_t>::FormatDouble<double>( template void fmt::BasicWriter<wchar_t>::FormatDouble<double>(
double value, const FormatSpec<wchar_t> &spec, int precision); double value, const FormatSpec &spec, int precision);
template void fmt::BasicWriter<wchar_t>::FormatDouble<long double>( template void fmt::BasicWriter<wchar_t>::FormatDouble<long double>(
long double value, const FormatSpec<wchar_t> &spec, int precision); long double value, const FormatSpec &spec, int precision);
template fmt::BasicWriter<wchar_t>::CharPtr template fmt::BasicWriter<wchar_t>::CharPtr
fmt::BasicWriter<wchar_t>::FillPadding(CharPtr buffer, fmt::BasicWriter<wchar_t>::FillPadding(CharPtr buffer,
...@@ -712,7 +712,7 @@ template void fmt::BasicWriter<wchar_t>::FormatDecimal( ...@@ -712,7 +712,7 @@ template void fmt::BasicWriter<wchar_t>::FormatDecimal(
template fmt::BasicWriter<wchar_t>::CharPtr template fmt::BasicWriter<wchar_t>::CharPtr
fmt::BasicWriter<wchar_t>::PrepareFilledBuffer( fmt::BasicWriter<wchar_t>::PrepareFilledBuffer(
unsigned size, const AlignSpec<wchar_t> &spec, char sign); unsigned size, const AlignSpec &spec, char sign);
template void fmt::BasicFormatter<wchar_t>::ReportError( template void fmt::BasicFormatter<wchar_t>::ReportError(
const wchar_t *s, StringRef message) const; const wchar_t *s, StringRef message) const;
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment