@@ -320,6 +320,8 @@ using underlying_t = typename std::underlying_type<T>::type;
320320template <typename T> using decay_t = typename std::decay<T>::type;
321321using nullptr_t = decltype (nullptr );
322322
323+ using ullong = unsigned long long ;
324+
323325#if (FMT_GCC_VERSION && FMT_GCC_VERSION < 500) || FMT_MSC_VERSION
324326// A workaround for gcc 4.9 & MSVC v141 to make void_t work in a SFINAE context.
325327template <typename ...> struct void_t_impl {
@@ -1014,7 +1016,7 @@ struct type_constant : std::integral_constant<type, type::custom_type> {};
10141016FMT_TYPE_CONSTANT (int , int_type);
10151017FMT_TYPE_CONSTANT (unsigned , uint_type);
10161018FMT_TYPE_CONSTANT (long long , long_long_type);
1017- FMT_TYPE_CONSTANT (unsigned long long , ulong_long_type);
1019+ FMT_TYPE_CONSTANT (ullong , ulong_long_type);
10181020FMT_TYPE_CONSTANT (int128_opt, int128_type);
10191021FMT_TYPE_CONSTANT (uint128_opt, uint128_type);
10201022FMT_TYPE_CONSTANT (bool , bool_type);
@@ -1131,7 +1133,7 @@ FMT_CONSTEXPR void init_static_named_arg(named_arg_info<Char>* named_args,
11311133// either to int or to long long depending on its size.
11321134enum { long_short = sizeof (long ) == sizeof (int ) && FMT_BUILTIN_TYPES };
11331135using long_type = conditional_t <long_short, int , long long >;
1134- using ulong_type = conditional_t <long_short, unsigned , unsigned long long >;
1136+ using ulong_type = conditional_t <long_short, unsigned , ullong >;
11351137
11361138template <typename T>
11371139using format_as_result =
@@ -1185,16 +1187,15 @@ template <typename Char> struct type_mapper {
11851187 static auto map (long ) -> long_type;
11861188 static auto map (unsigned long ) -> ulong_type;
11871189 static auto map (long long ) -> long long;
1188- static auto map (unsigned long long ) -> unsigned long long ;
1190+ static auto map (ullong ) -> ullong ;
11891191 static auto map (int128_opt) -> int128_opt;
11901192 static auto map (uint128_opt) -> uint128_opt;
11911193 static auto map (bool ) -> bool;
11921194
11931195 template <int N>
11941196 static auto map (bitint<N>) -> conditional_t<N <= 64, long long, void>;
11951197 template <int N>
1196- static auto map (ubitint<N>)
1197- -> conditional_t<N <= 64, unsigned long long, void>;
1198+ static auto map (ubitint<N>) -> conditional_t<N <= 64, ullong, void>;
11981199
11991200 template <typename T, FMT_ENABLE_IF(is_code_unit<T>::value)>
12001201 static auto map (T) -> conditional_t<
@@ -2178,7 +2179,7 @@ template <typename Context> class value {
21782179 int int_value;
21792180 unsigned uint_value;
21802181 long long long_long_value;
2181- unsigned long long ulong_long_value;
2182+ ullong ulong_long_value;
21822183 int128_opt int128_value;
21832184 uint128_opt uint128_value;
21842185 bool bool_value;
@@ -2203,8 +2204,7 @@ template <typename Context> class value {
22032204 constexpr FMT_INLINE value (unsigned long x FMT_BUILTIN)
22042205 : value(ulong_type(x)) {}
22052206 constexpr FMT_INLINE value (long long x FMT_BUILTIN) : long_long_value(x) {}
2206- constexpr FMT_INLINE value (unsigned long long x FMT_BUILTIN)
2207- : ulong_long_value(x) {}
2207+ constexpr FMT_INLINE value (ullong x FMT_BUILTIN) : ulong_long_value(x) {}
22082208 FMT_INLINE value (int128_opt x FMT_BUILTIN) : int128_value(x) {}
22092209 FMT_INLINE value (uint128_opt x FMT_BUILTIN) : uint128_value(x) {}
22102210 constexpr FMT_INLINE value (bool x FMT_BUILTIN) : bool_value(x) {}
@@ -2324,8 +2324,8 @@ template <typename Context> class value {
23242324enum { packed_arg_bits = 4 };
23252325// Maximum number of arguments with packed types.
23262326enum { max_packed_args = 62 / packed_arg_bits };
2327- enum : unsigned long long { is_unpacked_bit = 1ULL << 63 };
2328- enum : unsigned long long { has_named_args_bit = 1ULL << 62 };
2327+ enum : ullong { is_unpacked_bit = 1ULL << 63 };
2328+ enum : ullong { has_named_args_bit = 1ULL << 62 };
23292329
23302330template <typename It, typename T, typename Enable = void >
23312331struct is_output_iterator : std::false_type {};
@@ -2338,18 +2338,16 @@ struct is_output_iterator<
23382338 enable_if_t <std::is_assignable<decltype (*std::declval<decay_t <It>&>()++),
23392339 T>::value>> : std::true_type {};
23402340
2341- template <typename > constexpr auto encode_types () -> unsigned long long {
2342- return 0 ;
2343- }
2341+ template <typename > constexpr auto encode_types () -> ullong { return 0 ; }
23442342
23452343template <typename Context, typename First, typename ... T>
2346- constexpr auto encode_types () -> unsigned long long {
2344+ constexpr auto encode_types () -> ullong {
23472345 return static_cast <unsigned >(stored_type_constant<First, Context>::value) |
23482346 (encode_types<Context, T...>() << packed_arg_bits);
23492347}
23502348
23512349template <typename Context, typename ... T, size_t NUM_ARGS = sizeof ...(T)>
2352- constexpr auto make_descriptor () -> unsigned long long {
2350+ constexpr auto make_descriptor () -> ullong {
23532351 return NUM_ARGS <= max_packed_args ? encode_types<Context, T...>()
23542352 : is_unpacked_bit | NUM_ARGS;
23552353}
@@ -2358,8 +2356,7 @@ template <typename Context, int NUM_ARGS>
23582356using arg_t = conditional_t <NUM_ARGS <= max_packed_args, value<Context>,
23592357 basic_format_arg<Context>>;
23602358
2361- template <typename Context, int NUM_ARGS, int NUM_NAMED_ARGS,
2362- unsigned long long DESC>
2359+ template <typename Context, int NUM_ARGS, int NUM_NAMED_ARGS, ullong DESC>
23632360struct named_arg_store {
23642361 // args_[0].named_args points to named_args to avoid bloating format_args.
23652362 arg_t <Context, NUM_ARGS> args[1u + NUM_ARGS];
@@ -2391,8 +2388,7 @@ struct named_arg_store {
23912388// An array of references to arguments. It can be implicitly converted to
23922389// `basic_format_args` for passing into type-erased formatting functions
23932390// such as `vformat`. It is a plain struct to reduce binary size in debug mode.
2394- template <typename Context, int NUM_ARGS, int NUM_NAMED_ARGS,
2395- unsigned long long DESC>
2391+ template <typename Context, int NUM_ARGS, int NUM_NAMED_ARGS, ullong DESC>
23962392struct format_arg_store {
23972393 // +1 to workaround a bug in gcc 7.5 that causes duplicated-branches warning.
23982394 using type =
@@ -2585,7 +2581,7 @@ template <typename Context> class basic_format_args {
25852581 // If the number of arguments is less or equal to max_packed_args then
25862582 // argument types are passed in the descriptor. This reduces binary code size
25872583 // per formatting function call.
2588- unsigned long long desc_;
2584+ ullong desc_;
25892585 union {
25902586 // If is_packed() returns true then argument values are stored in values_;
25912587 // otherwise they are stored in args_. This is done to improve cache
@@ -2609,7 +2605,7 @@ template <typename Context> class basic_format_args {
26092605 return static_cast <detail::type>((desc_ >> shift) & mask);
26102606 }
26112607
2612- template <int NUM_ARGS, int NUM_NAMED_ARGS, unsigned long long DESC>
2608+ template <int NUM_ARGS, int NUM_NAMED_ARGS, ullong DESC>
26132609 using store =
26142610 detail::format_arg_store<Context, NUM_ARGS, NUM_NAMED_ARGS, DESC>;
26152611
@@ -2619,14 +2615,14 @@ template <typename Context> class basic_format_args {
26192615 constexpr basic_format_args () : desc_(0 ), args_(nullptr ) {}
26202616
26212617 // / Constructs a `basic_format_args` object from `format_arg_store`.
2622- template <int NUM_ARGS, int NUM_NAMED_ARGS, unsigned long long DESC,
2618+ template <int NUM_ARGS, int NUM_NAMED_ARGS, ullong DESC,
26232619 FMT_ENABLE_IF (NUM_ARGS <= detail::max_packed_args)>
26242620 constexpr FMT_ALWAYS_INLINE basic_format_args (
26252621 const store<NUM_ARGS, NUM_NAMED_ARGS, DESC>& s)
26262622 : desc_(DESC | (NUM_NAMED_ARGS != 0 ? +detail::has_named_args_bit : 0 )),
26272623 values_(s.args) {}
26282624
2629- template <int NUM_ARGS, int NUM_NAMED_ARGS, unsigned long long DESC,
2625+ template <int NUM_ARGS, int NUM_NAMED_ARGS, ullong DESC,
26302626 FMT_ENABLE_IF (NUM_ARGS > detail::max_packed_args)>
26312627 constexpr basic_format_args (const store<NUM_ARGS, NUM_NAMED_ARGS, DESC>& s)
26322628 : desc_(DESC | (NUM_NAMED_ARGS != 0 ? +detail::has_named_args_bit : 0 )),
@@ -2670,8 +2666,7 @@ template <typename Context> class basic_format_args {
26702666 }
26712667
26722668 auto max_size () const -> int {
2673- unsigned long long max_packed = detail::max_packed_args;
2674- return static_cast <int >(is_packed () ? max_packed
2669+ return static_cast <int >(is_packed () ? ullong (detail::max_packed_args)
26752670 : desc_ & ~detail::is_unpacked_bit);
26762671 }
26772672};
@@ -2816,7 +2811,7 @@ struct formatter<T, Char,
28162811template <typename Context = context, typename ... T,
28172812 int NUM_ARGS = sizeof ...(T),
28182813 int NUM_NAMED_ARGS = detail::count_named_args<T...>(),
2819- unsigned long long DESC = detail::make_descriptor<Context, T...>()>
2814+ ullong DESC = detail::make_descriptor<Context, T...>()>
28202815constexpr FMT_ALWAYS_INLINE auto make_format_args (T&... args)
28212816 -> detail::format_arg_store<Context, NUM_ARGS, NUM_NAMED_ARGS, DESC> {
28222817 // Suppress warnings for pathological types convertible to detail::value.
0 commit comments