Make more use of the new get_int_t
This commit is contained in:
+12
-9
@@ -412,9 +412,10 @@ std::size_t cfmt_append(Dst& out, const Char* fmt, Src&& src)
|
||||
}
|
||||
|
||||
const u64 mask =
|
||||
ctx.type == 1 ? 0xffull :
|
||||
ctx.type == 2 ? 0xffffull :
|
||||
ctx.type == 4 ? 0xffffffffull : 0xffffffffffffffffull;
|
||||
ctx.type == 1 ? u64{std::numeric_limits<get_int_t<1>>::max()} :
|
||||
ctx.type == 2 ? u64{std::numeric_limits<get_int_t<2>>::max()} :
|
||||
ctx.type == 4 ? u64{std::numeric_limits<get_int_t<4>>::max()} :
|
||||
u64{std::numeric_limits<get_int_t<8>>::max()};
|
||||
|
||||
// Trunc sign-extended signed types
|
||||
const u64 val = src.template get<u64>(ctx.args) & mask;
|
||||
@@ -468,9 +469,10 @@ std::size_t cfmt_append(Dst& out, const Char* fmt, Src&& src)
|
||||
}
|
||||
|
||||
const u64 mask =
|
||||
ctx.type == 1 ? 0xffull :
|
||||
ctx.type == 2 ? 0xffffull :
|
||||
ctx.type == 4 ? 0xffffffffull : 0xffffffffffffffffull;
|
||||
ctx.type == 1 ? u64{std::numeric_limits<get_int_t<1>>::max()} :
|
||||
ctx.type == 2 ? u64{std::numeric_limits<get_int_t<2>>::max()} :
|
||||
ctx.type == 4 ? u64{std::numeric_limits<get_int_t<4>>::max()} :
|
||||
u64{std::numeric_limits<get_int_t<8>>::max()};
|
||||
|
||||
// Trunc sign-extended signed types
|
||||
const u64 val = src.template get<u64>(ctx.args) & mask;
|
||||
@@ -531,9 +533,10 @@ std::size_t cfmt_append(Dst& out, const Char* fmt, Src&& src)
|
||||
}
|
||||
|
||||
const u64 mask =
|
||||
ctx.type == 1 ? 0xffull :
|
||||
ctx.type == 2 ? 0xffffull :
|
||||
ctx.type == 4 ? 0xffffffffull : 0xffffffffffffffffull;
|
||||
ctx.type == 1 ? u64{std::numeric_limits<get_int_t<1>>::max()} :
|
||||
ctx.type == 2 ? u64{std::numeric_limits<get_int_t<2>>::max()} :
|
||||
ctx.type == 4 ? u64{std::numeric_limits<get_int_t<4>>::max()} :
|
||||
u64{std::numeric_limits<get_int_t<8>>::max()};
|
||||
|
||||
// Trunc sign-extended signed types
|
||||
const u64 val = src.template get<u64>(ctx.args) & mask;
|
||||
|
||||
Reference in New Issue
Block a user