clang format

This commit is contained in:
gabime
2018-07-21 23:48:07 +03:00
parent a96b4d7529
commit 9e4925eff0
35 changed files with 197 additions and 152 deletions

View File

@@ -230,7 +230,7 @@ public:
typedef Char char_type;
typedef const Char *iterator;
// Standard basic_string_view type.
// Standard basic_string_view type.
#if defined(FMT_USE_STD_STRING_VIEW)
typedef std::basic_string_view<Char> type;
#elif defined(FMT_USE_EXPERIMENTAL_STRING_VIEW)
@@ -1233,7 +1233,8 @@ const long long format_arg_store<Context, Args...>::TYPES = get_types();
/**
\rst
Constructs an `~fmt::format_arg_store` object that contains references to
arguments and can be implicitly converted to `~fmt::format_args`. `Context` can
arguments and can be implicitly converted to `~fmt::format_args`. `Context`
can
be omitted in which case it defaults to `~fmt::context`.
\endrst
*/
@@ -1536,7 +1537,8 @@ inline void print(std::FILE *f, string_view format_str, const Args &... args)
vprint(f, format_str, as);
}
/**
Prints formatted data to the file *f* which should be in wide-oriented mode set
Prints formatted data to the file *f* which should be in wide-oriented mode
set
via ``fwide(f, 1)`` or ``_setmode(_fileno(f), _O_U8TEXT)`` on Windows.
*/
template<typename... Args>

View File

@@ -320,7 +320,8 @@ FMT_FUNC fp get_cached_power(int min_exponent, int &pow10_exponent)
int index = static_cast<int>(std::ceil((min_exponent + fp::significand_size - 1) * one_over_log2_10));
// Decimal exponent of the first (smallest) cached power of 10.
const int first_dec_exp = -348;
// Difference between two consecutive decimal exponents in cached powers of 10.
// Difference between two consecutive decimal exponents in cached powers of
// 10.
const int dec_exp_step = 8;
index = (index - first_dec_exp - 1) / dec_exp_step + 1;
pow10_exponent = first_dec_exp + index * dec_exp_step;

View File

@@ -192,9 +192,9 @@ inline uint32_t clz(uint32_t x)
_BitScanReverse(&r, x);
assert(x != 0);
// Static analysis complains about using uninitialized data
// "r", but the only way that can happen is if "x" is 0,
// which the callers guarantee to not happen.
// Static analysis complains about using uninitialized data
// "r", but the only way that can happen is if "x" is 0,
// which the callers guarantee to not happen.
#pragma warning(suppress : 6102)
return 31 - r;
}
@@ -219,9 +219,9 @@ inline uint32_t clzll(uint64_t x)
#endif
assert(x != 0);
// Static analysis complains about using uninitialized data
// "r", but the only way that can happen is if "x" is 0,
// which the callers guarantee to not happen.
// Static analysis complains about using uninitialized data
// "r", but the only way that can happen is if "x" is 0,
// which the callers guarantee to not happen.
#pragma warning(suppress : 6102)
return 63 - r;
}
@@ -388,7 +388,8 @@ inline fp operator-(fp x, fp y)
}
// Computes an fp number r with r.f = x.f * y.f / pow(2, 64) rounded to nearest
// with half-up tie breaking, r.e = x.e + y.e + 64. Result may not be normalized.
// with half-up tie breaking, r.e = x.e + y.e + 64. Result may not be
// normalized.
fp operator*(fp x, fp y);
// Returns cached power (of 10) c_k = c_k.f * pow(2, c_k.e) such that its
@@ -4305,7 +4306,8 @@ inline format_to_n_result<OutputIt> vformat_to_n(OutputIt out, std::size_t n, st
/**
\rst
Formats arguments, writes up to ``n`` characters of the result to the output
iterator ``out`` and returns the total output size and the iterator past the end
iterator ``out`` and returns the total output size and the iterator past the
end
of the output range.
\endrst
*/
@@ -4561,7 +4563,8 @@ inline void print(rgb fd, string_view format_str, const Args &... args)
Formats a string and prints it to stdout using ANSI escape sequences to
specify foreground color 'fd' and background color 'bg'.
Example:
fmt::print(fmt::color::red, fmt::color::black, "Elapsed time: {0:.2f} seconds", 1.23);
fmt::print(fmt::color::red, fmt::color::black, "Elapsed time: {0:.2f}
seconds", 1.23);
*/
template<typename... Args>
inline void print(rgb fd, rgb bg, string_view format_str, const Args &... args)

View File

@@ -60,7 +60,8 @@ private:
void operator<<(null);
};
// Checks if T has a user-defined operator<< (e.g. not a member of std::ostream).
// Checks if T has a user-defined operator<< (e.g. not a member of
// std::ostream).
template<typename T, typename Char>
class is_streamable
{
@@ -74,7 +75,8 @@ private:
typedef decltype(test<T>(0)) result;
public:
// std::string operator<< is not considered user-defined because we handle strings
// std::string operator<< is not considered user-defined because we handle
// strings
// specially.
static const bool value = result::value && !std::is_same<T, std::string>::value;
};

View File

@@ -35,8 +35,8 @@ struct formatting_base
template<typename Char, typename Enable = void>
struct formatting_range : formatting_base<Char>
{
static FMT_CONSTEXPR_DECL const std::size_t range_length_limit =
FMT_RANGE_OUTPUT_LENGTH_LIMIT; // output only up to N items from the range.
static FMT_CONSTEXPR_DECL const std::size_t range_length_limit = FMT_RANGE_OUTPUT_LENGTH_LIMIT; // output only up to N items from the
// range.
Char prefix;
Char delimiter;
Char postfix;