mirror of
https://github.com/fmtlib/fmt.git
synced 2025-04-10 03:44:32 +00:00
FPUtil -> fputil
This commit is contained in:
parent
8428621ddc
commit
b77c8190ca
26
fmt/format.h
26
fmt/format.h
@ -195,7 +195,7 @@ typedef __int64 intmax_t;
|
|||||||
|
|
||||||
#if FMT_USE_DELETED_FUNCTIONS || FMT_HAS_FEATURE(cxx_deleted_functions) || \
|
#if FMT_USE_DELETED_FUNCTIONS || FMT_HAS_FEATURE(cxx_deleted_functions) || \
|
||||||
(FMT_GCC_VERSION >= 404 && FMT_HAS_GXX_CXX11) || FMT_MSC_VER >= 1800
|
(FMT_GCC_VERSION >= 404 && FMT_HAS_GXX_CXX11) || FMT_MSC_VER >= 1800
|
||||||
# define FMT_DELETED_OR_UNDEFINED = delete
|
# define FMT_DELETED_OR_UNDEFINED = delete
|
||||||
# define FMT_DISALLOW_COPY_AND_ASSIGN(TypeName) \
|
# define FMT_DISALLOW_COPY_AND_ASSIGN(TypeName) \
|
||||||
TypeName(const TypeName&) = delete; \
|
TypeName(const TypeName&) = delete; \
|
||||||
TypeName& operator=(const TypeName&) = delete
|
TypeName& operator=(const TypeName&) = delete
|
||||||
@ -283,20 +283,20 @@ inline uint32_t clzll(uint64_t x) {
|
|||||||
|
|
||||||
namespace fmt {
|
namespace fmt {
|
||||||
namespace internal {
|
namespace internal {
|
||||||
struct DummyInt {
|
struct dummy_int {
|
||||||
int data[2];
|
int data[2];
|
||||||
operator int() const { return 0; }
|
operator int() const { return 0; }
|
||||||
};
|
};
|
||||||
typedef std::numeric_limits<fmt::internal::DummyInt> FPUtil;
|
typedef std::numeric_limits<fmt::internal::dummy_int> fputil;
|
||||||
|
|
||||||
// Dummy implementations of system functions such as signbit and ecvt called
|
// Dummy implementations of system functions such as signbit and ecvt called
|
||||||
// if the latter are not available.
|
// if the latter are not available.
|
||||||
inline DummyInt signbit(...) { return DummyInt(); }
|
inline dummy_int signbit(...) { return dummy_int(); }
|
||||||
inline DummyInt _ecvt_s(...) { return DummyInt(); }
|
inline dummy_int _ecvt_s(...) { return dummy_int(); }
|
||||||
inline DummyInt isinf(...) { return DummyInt(); }
|
inline dummy_int isinf(...) { return dummy_int(); }
|
||||||
inline DummyInt _finite(...) { return DummyInt(); }
|
inline dummy_int _finite(...) { return dummy_int(); }
|
||||||
inline DummyInt isnan(...) { return DummyInt(); }
|
inline dummy_int isnan(...) { return dummy_int(); }
|
||||||
inline DummyInt _isnan(...) { return DummyInt(); }
|
inline dummy_int _isnan(...) { return dummy_int(); }
|
||||||
|
|
||||||
// A helper function to suppress bogus "conditional expression is constant"
|
// A helper function to suppress bogus "conditional expression is constant"
|
||||||
// warnings.
|
// warnings.
|
||||||
@ -311,7 +311,7 @@ namespace std {
|
|||||||
// https://gcc.gnu.org/bugzilla/show_bug.cgi?id=48891
|
// https://gcc.gnu.org/bugzilla/show_bug.cgi?id=48891
|
||||||
// and the same for isnan and signbit.
|
// and the same for isnan and signbit.
|
||||||
template <>
|
template <>
|
||||||
class numeric_limits<fmt::internal::DummyInt> :
|
class numeric_limits<fmt::internal::dummy_int> :
|
||||||
public std::numeric_limits<int> {
|
public std::numeric_limits<int> {
|
||||||
public:
|
public:
|
||||||
// Portable version of isinf.
|
// Portable version of isinf.
|
||||||
@ -2760,14 +2760,14 @@ void basic_writer<Char>::write_double(T value, const FormatSpec &spec) {
|
|||||||
char sign = 0;
|
char sign = 0;
|
||||||
// Use isnegative instead of value < 0 because the latter is always
|
// Use isnegative instead of value < 0 because the latter is always
|
||||||
// false for NaN.
|
// false for NaN.
|
||||||
if (internal::FPUtil::isnegative(static_cast<double>(value))) {
|
if (internal::fputil::isnegative(static_cast<double>(value))) {
|
||||||
sign = '-';
|
sign = '-';
|
||||||
value = -value;
|
value = -value;
|
||||||
} else if (spec.flag(SIGN_FLAG)) {
|
} else if (spec.flag(SIGN_FLAG)) {
|
||||||
sign = spec.flag(PLUS_FLAG) ? '+' : ' ';
|
sign = spec.flag(PLUS_FLAG) ? '+' : ' ';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (internal::FPUtil::isnotanumber(value)) {
|
if (internal::fputil::isnotanumber(value)) {
|
||||||
// Format NaN ourselves because sprintf's output is not consistent
|
// Format NaN ourselves because sprintf's output is not consistent
|
||||||
// across platforms.
|
// across platforms.
|
||||||
std::size_t nan_size = 4;
|
std::size_t nan_size = 4;
|
||||||
@ -2782,7 +2782,7 @@ void basic_writer<Char>::write_double(T value, const FormatSpec &spec) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (internal::FPUtil::isinfinity(value)) {
|
if (internal::fputil::isinfinity(value)) {
|
||||||
// Format infinity ourselves because sprintf's output is not consistent
|
// Format infinity ourselves because sprintf's output is not consistent
|
||||||
// across platforms.
|
// across platforms.
|
||||||
std::size_t inf_size = 4;
|
std::size_t inf_size = 4;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user