mirror of
https://github.com/fmtlib/fmt.git
synced 2025-07-29 18:27:40 +02:00
Cleanup warning suppression
This commit is contained in:
@ -1678,13 +1678,12 @@ template <typename... T> struct arg_pack {};
|
|||||||
template <typename Char, int NUM_ARGS, int NUM_NAMED_ARGS, bool DYNAMIC_NAMES>
|
template <typename Char, int NUM_ARGS, int NUM_NAMED_ARGS, bool DYNAMIC_NAMES>
|
||||||
class format_string_checker {
|
class format_string_checker {
|
||||||
private:
|
private:
|
||||||
type types_[static_cast<size_t>(max_of(1, NUM_ARGS))];
|
type types_[max_of<size_t>(1, NUM_ARGS)];
|
||||||
named_arg_info<Char>
|
named_arg_info<Char> named_args_[max_of<size_t>(1, NUM_NAMED_ARGS)];
|
||||||
named_args_[static_cast<size_t>(max_of(1, NUM_NAMED_ARGS))];
|
|
||||||
compile_parse_context<Char> context_;
|
compile_parse_context<Char> context_;
|
||||||
|
|
||||||
using parse_func = auto (*)(parse_context<Char>&) -> const Char*;
|
using parse_func = auto (*)(parse_context<Char>&) -> const Char*;
|
||||||
parse_func parse_funcs_[static_cast<size_t>(max_of(1, NUM_ARGS))];
|
parse_func parse_funcs_[max_of<size_t>(1, NUM_ARGS)];
|
||||||
|
|
||||||
public:
|
public:
|
||||||
template <typename... T>
|
template <typename... T>
|
||||||
@ -2339,7 +2338,7 @@ template <typename Context, int NUM_ARGS, int NUM_NAMED_ARGS,
|
|||||||
unsigned long long DESC>
|
unsigned long long DESC>
|
||||||
struct named_arg_store {
|
struct named_arg_store {
|
||||||
// args_[0].named_args points to named_args to avoid bloating format_args.
|
// args_[0].named_args points to named_args to avoid bloating format_args.
|
||||||
arg_t<Context, NUM_ARGS> args[static_cast<size_t>(1 + NUM_ARGS)];
|
arg_t<Context, NUM_ARGS> args[1u + NUM_ARGS];
|
||||||
named_arg_info<typename Context::char_type>
|
named_arg_info<typename Context::char_type>
|
||||||
named_args[static_cast<size_t>(NUM_NAMED_ARGS)];
|
named_args[static_cast<size_t>(NUM_NAMED_ARGS)];
|
||||||
|
|
||||||
@ -2372,10 +2371,10 @@ template <typename Context, int NUM_ARGS, int NUM_NAMED_ARGS,
|
|||||||
unsigned long long DESC>
|
unsigned long long DESC>
|
||||||
struct format_arg_store {
|
struct format_arg_store {
|
||||||
// +1 to workaround a bug in gcc 7.5 that causes duplicated-branches warning.
|
// +1 to workaround a bug in gcc 7.5 that causes duplicated-branches warning.
|
||||||
using type = conditional_t<
|
using type =
|
||||||
NUM_NAMED_ARGS == 0,
|
conditional_t<NUM_NAMED_ARGS == 0,
|
||||||
arg_t<Context, NUM_ARGS>[static_cast<size_t>(max_of(1, NUM_ARGS))],
|
arg_t<Context, NUM_ARGS>[max_of<size_t>(1, NUM_ARGS)],
|
||||||
named_arg_store<Context, NUM_ARGS, NUM_NAMED_ARGS, DESC>>;
|
named_arg_store<Context, NUM_ARGS, NUM_NAMED_ARGS, DESC>>;
|
||||||
type args;
|
type args;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1225,8 +1225,7 @@ FMT_CONSTEXPR auto do_format_base2e(int base_bits, Char* out, UInt value,
|
|||||||
out += size;
|
out += size;
|
||||||
do {
|
do {
|
||||||
const char* digits = upper ? "0123456789ABCDEF" : "0123456789abcdef";
|
const char* digits = upper ? "0123456789ABCDEF" : "0123456789abcdef";
|
||||||
unsigned digit = static_cast<unsigned>(
|
unsigned digit = static_cast<unsigned>(value & ((1u << base_bits) - 1));
|
||||||
value & ((static_cast<UInt>(1) << base_bits) - 1));
|
|
||||||
*--out = static_cast<Char>(base_bits < 4 ? static_cast<char>('0' + digit)
|
*--out = static_cast<Char>(base_bits < 4 ? static_cast<char>('0' + digit)
|
||||||
: digits[digit]);
|
: digits[digit]);
|
||||||
} while ((value >>= base_bits) != 0);
|
} while ((value >>= base_bits) != 0);
|
||||||
|
Reference in New Issue
Block a user