remove inline from functions with FMT_CONSTEXPR
This commit is contained in:
parent
ab3c8efadd
commit
706555bf3c
@ -980,7 +980,7 @@ FMT_EXTERN template struct basic_data<void>;
|
|||||||
// This is a struct rather than an alias to avoid shadowing warnings in gcc.
|
// This is a struct rather than an alias to avoid shadowing warnings in gcc.
|
||||||
struct data : basic_data<> {};
|
struct data : basic_data<> {};
|
||||||
|
|
||||||
template <typename T> inline FMT_CONSTEXPR int count_digits_trivial(T n) {
|
template <typename T> FMT_CONSTEXPR int count_digits_trivial(T n) {
|
||||||
int count = 1;
|
int count = 1;
|
||||||
for (;;) {
|
for (;;) {
|
||||||
// Integer division is slow so do it for a group of four digits instead
|
// Integer division is slow so do it for a group of four digits instead
|
||||||
@ -1008,13 +1008,13 @@ inline FMT_CONSTEXPR20 int count_digits(uint64_t n) {
|
|||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
// Fallback version of count_digits used when __builtin_clz is not available.
|
// Fallback version of count_digits used when __builtin_clz is not available.
|
||||||
inline FMT_CONSTEXPR int count_digits(uint64_t n) {
|
FMT_CONSTEXPR int count_digits(uint64_t n) {
|
||||||
return count_digits_trivial(n);
|
return count_digits_trivial(n);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if FMT_USE_INT128
|
#if FMT_USE_INT128
|
||||||
inline FMT_CONSTEXPR int count_digits(uint128_t n) {
|
FMT_CONSTEXPR int count_digits(uint128_t n) {
|
||||||
int count = 1;
|
int count = 1;
|
||||||
for (;;) {
|
for (;;) {
|
||||||
// Integer division is slow so do it for a group of four digits instead
|
// Integer division is slow so do it for a group of four digits instead
|
||||||
@ -1032,7 +1032,7 @@ inline FMT_CONSTEXPR int count_digits(uint128_t n) {
|
|||||||
|
|
||||||
// Counts the number of digits in n. BITS = log2(radix).
|
// Counts the number of digits in n. BITS = log2(radix).
|
||||||
template <unsigned BITS, typename UInt>
|
template <unsigned BITS, typename UInt>
|
||||||
inline FMT_CONSTEXPR int count_digits(UInt n) {
|
FMT_CONSTEXPR int count_digits(UInt n) {
|
||||||
int num_digits = 0;
|
int num_digits = 0;
|
||||||
do {
|
do {
|
||||||
++num_digits;
|
++num_digits;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user