mirror of
https://github.com/fmtlib/fmt.git
synced 2024-12-24 12:14:26 +00:00
Fix unreachable code warning when signbit returns bool
This commit is contained in:
parent
1760c31b52
commit
f78c3e41be
@ -456,8 +456,7 @@ class numeric_limits<fmt::internal::DummyInt> :
|
||||
using namespace fmt::internal;
|
||||
// The resolution "priority" is:
|
||||
// isinf macro > std::isinf > ::isinf > fmt::internal::isinf
|
||||
if (const_check(sizeof(isinf(x)) == sizeof(bool) ||
|
||||
sizeof(isinf(x)) == sizeof(int))) {
|
||||
if (const_check(sizeof(isinf(x)) != sizeof(fmt::internal::DummyInt))) {
|
||||
return isinf(x) != 0;
|
||||
}
|
||||
return !_finite(static_cast<double>(x));
|
||||
@ -467,8 +466,7 @@ class numeric_limits<fmt::internal::DummyInt> :
|
||||
template <typename T>
|
||||
static bool isnotanumber(T x) {
|
||||
using namespace fmt::internal;
|
||||
if (const_check(sizeof(isnan(x)) == sizeof(bool) ||
|
||||
sizeof(isnan(x)) == sizeof(int))) {
|
||||
if (const_check(sizeof(isnan(x)) != sizeof(fmt::internal::DummyInt))) {
|
||||
return isnan(x) != 0;
|
||||
}
|
||||
return _isnan(static_cast<double>(x)) != 0;
|
||||
@ -477,8 +475,7 @@ class numeric_limits<fmt::internal::DummyInt> :
|
||||
// Portable version of signbit.
|
||||
static bool isnegative(double x) {
|
||||
using namespace fmt::internal;
|
||||
if (const_check(sizeof(signbit(x)) == sizeof(bool) ||
|
||||
sizeof(signbit(x)) == sizeof(int))) {
|
||||
if (const_check(sizeof(signbit(x)) != sizeof(fmt::internal::DummyInt))) {
|
||||
return signbit(x) != 0;
|
||||
}
|
||||
if (x < 0) return true;
|
||||
|
Loading…
Reference in New Issue
Block a user