diff --git a/format.cc b/format.cc index c073fed5..53430f34 100644 --- a/format.cc +++ b/format.cc @@ -421,7 +421,8 @@ class fmt::internal::ArgFormatter : const Char *format_; public: - ArgFormatter(fmt::BasicFormatter &f, fmt::FormatSpec &s, const Char *fmt) + ArgFormatter( + fmt::BasicFormatter &f,fmt::FormatSpec &s, const Char *fmt) : formatter_(f), writer_(f.writer()), spec_(s), format_(fmt) {} template @@ -651,20 +652,20 @@ void fmt::BasicWriter::write_double(T value, const FormatSpec &spec) { } template -template +template void fmt::BasicWriter::write_str( - const Arg::StringValue &str, const FormatSpec &spec) { - // Check if StringChar is convertible to Char. - internal::CharTraits::convert(StringChar()); + const Arg::StringValue &str, const FormatSpec &spec) { + // Check if StrChar is convertible to Char. + internal::CharTraits::convert(StrChar()); if (spec.type_ && spec.type_ != 's') internal::report_unknown_type(spec.type_, "string"); - const StringChar *s = str.value; + const StrChar *s = str.value; std::size_t size = str.size; if (size == 0) { if (!s) throw FormatError("string pointer is null"); if (*s) - size = std::char_traits::length(s); + size = std::char_traits::length(s); } write_str(s, size, spec); } @@ -699,12 +700,12 @@ void fmt::BasicFormatter::CheckSign( const Char *&s, const Arg &arg) { char sign = static_cast(*s); if (arg.type > Arg::LAST_NUMERIC_TYPE) { - report_error_(s, - fmt::format("format specifier '{}' requires numeric argument", sign).c_str()); + report_error_(s, fmt::format( + "format specifier '{}' requires numeric argument", sign).c_str()); } if (arg.type == Arg::UINT || arg.type == Arg::ULONG_LONG) { - report_error_(s, - fmt::format("format specifier '{}' requires signed argument", sign).c_str()); + report_error_(s, fmt::format( + "format specifier '{}' requires signed argument", sign).c_str()); } ++s; } diff --git a/format.h b/format.h index ae7b18ae..3be1f3ab 100644 --- a/format.h +++ b/format.h @@ -1337,13 +1337,13 @@ class BasicWriter { void write_double(T value, const FormatSpec &spec); // Writes a formatted string. - template + template CharPtr write_str( - const StringChar *s, std::size_t size, const AlignSpec &spec); + const StrChar *s, std::size_t size, const AlignSpec &spec); - template + template void write_str( - const internal::Arg::StringValue &str, const FormatSpec &spec); + const internal::Arg::StringValue &str, const FormatSpec &spec); // This method is private to disallow writing a wide string to a // char stream and vice versa. If you want to print a wide string @@ -1502,9 +1502,9 @@ class BasicWriter { return *this; } - template - BasicWriter &operator<<(const StrFormatSpec &spec) { - const StringChar *s = spec.str(); + template + BasicWriter &operator<<(const StrFormatSpec &spec) { + const StrChar *s = spec.str(); // TODO: error if fill is not convertible to Char write_str(s, std::char_traits::length(s), spec); return *this; @@ -1514,9 +1514,9 @@ class BasicWriter { }; template -template +template typename BasicWriter::CharPtr BasicWriter::write_str( - const StringChar *s, std::size_t size, const AlignSpec &spec) { + const StrChar *s, std::size_t size, const AlignSpec &spec) { CharPtr out = CharPtr(); if (spec.width() > size) { out = GrowBuffer(spec.width()); @@ -1560,7 +1560,8 @@ typename fmt::BasicWriter::CharPtr CharPtr p = GrowBuffer(fill_size); std::fill(p, p + fill_size, fill); } - CharPtr result = PrepareBufferForInt(num_digits, subspec, prefix, prefix_size); + CharPtr result = PrepareBufferForInt( + num_digits, subspec, prefix, prefix_size); if (align == ALIGN_LEFT) { CharPtr p = GrowBuffer(fill_size); std::fill(p, p + fill_size, fill); @@ -1651,7 +1652,8 @@ void BasicWriter::write_int(T value, const Spec &spec) { do { ++num_digits; } while ((n >>= 1) != 0); - Char *p = GetBase(PrepareBufferForInt(num_digits, spec, prefix, prefix_size)); + Char *p = GetBase(PrepareBufferForInt( + num_digits, spec, prefix, prefix_size)); n = abs_value; do { *p-- = '0' + (n & 1); @@ -1917,9 +1919,9 @@ inline void FormatDec(char *&buffer, T value) { #if FMT_GCC_VERSION // Use the system_header pragma to suppress warnings about variadic macros -// because suppressing -Wvariadic-macros with the diagnostic pragma doesn't work. -// It is used at the end because we want to suppress as little warnings as -// possible. +// because suppressing -Wvariadic-macros with the diagnostic pragma doesn't +// work. It is used at the end because we want to suppress as little warnings +// as possible. # pragma GCC system_header #endif