diff options
Diffstat (limited to 'src/corelib/global/qnumeric_p.h')
-rw-r--r-- | src/corelib/global/qnumeric_p.h | 42 |
1 files changed, 0 insertions, 42 deletions
diff --git a/src/corelib/global/qnumeric_p.h b/src/corelib/global/qnumeric_p.h index 6b5ecf73e1..851c18203d 100644 --- a/src/corelib/global/qnumeric_p.h +++ b/src/corelib/global/qnumeric_p.h @@ -61,63 +61,43 @@ QT_BEGIN_NAMESPACE static const union { unsigned char c[8]; double d; } qt_be_inf_bytes = { { 0x7f, 0xf0, 0, 0, 0, 0, 0, 0 } }; static const union { unsigned char c[8]; double d; } qt_le_inf_bytes = { { 0, 0, 0, 0, 0, 0, 0xf0, 0x7f } }; -static const union { unsigned char c[8]; double d; } qt_armfpa_inf_bytes = { { 0, 0, 0xf0, 0x7f, 0, 0, 0, 0 } }; static inline double qt_inf() { -#ifdef QT_ARMFPA - return qt_armfpa_inf_bytes.d; -#else return (QSysInfo::ByteOrder == QSysInfo::BigEndian ? qt_be_inf_bytes.d : qt_le_inf_bytes.d); -#endif } // Signaling NAN static const union { unsigned char c[8]; double d; } qt_be_snan_bytes = { { 0x7f, 0xf8, 0, 0, 0, 0, 0, 0 } }; static const union { unsigned char c[8]; double d; } qt_le_snan_bytes = { { 0, 0, 0, 0, 0, 0, 0xf8, 0x7f } }; -static const union { unsigned char c[8]; double d; } qt_armfpa_snan_bytes = { { 0, 0, 0xf8, 0x7f, 0, 0, 0, 0 } }; static inline double qt_snan() { -#ifdef QT_ARMFPA - return qt_armfpa_snan_bytes.d; -#else return (QSysInfo::ByteOrder == QSysInfo::BigEndian ? qt_be_snan_bytes.d : qt_le_snan_bytes.d); -#endif } // Quiet NAN static const union { unsigned char c[8]; double d; } qt_be_qnan_bytes = { { 0xff, 0xf8, 0, 0, 0, 0, 0, 0 } }; static const union { unsigned char c[8]; double d; } qt_le_qnan_bytes = { { 0, 0, 0, 0, 0, 0, 0xf8, 0xff } }; -static const union { unsigned char c[8]; double d; } qt_armfpa_qnan_bytes = { { 0, 0, 0xf8, 0xff, 0, 0, 0, 0 } }; static inline double qt_qnan() { -#ifdef QT_ARMFPA - return qt_armfpa_qnan_bytes.d; -#else return (QSysInfo::ByteOrder == QSysInfo::BigEndian ? qt_be_qnan_bytes.d : qt_le_qnan_bytes.d); -#endif } #else // Q_CC_MIPS static const unsigned char qt_be_inf_bytes[] = { 0x7f, 0xf0, 0, 0, 0, 0, 0, 0 }; static const unsigned char qt_le_inf_bytes[] = { 0, 0, 0, 0, 0, 0, 0xf0, 0x7f }; -static const unsigned char qt_armfpa_inf_bytes[] = { 0, 0, 0xf0, 0x7f, 0, 0, 0, 0 }; static inline double qt_inf() { const unsigned char *bytes; -#ifdef QT_ARMFPA - bytes = qt_armfpa_inf_bytes; -#else bytes = (QSysInfo::ByteOrder == QSysInfo::BigEndian ? qt_be_inf_bytes : qt_le_inf_bytes); -#endif union { unsigned char c[8]; double d; } returnValue; qMemCopy(returnValue.c, bytes, sizeof(returnValue.c)); @@ -127,17 +107,12 @@ static inline double qt_inf() // Signaling NAN static const unsigned char qt_be_snan_bytes[] = { 0x7f, 0xf8, 0, 0, 0, 0, 0, 0 }; static const unsigned char qt_le_snan_bytes[] = { 0, 0, 0, 0, 0, 0, 0xf8, 0x7f }; -static const unsigned char qt_armfpa_snan_bytes[] = { 0, 0, 0xf8, 0x7f, 0, 0, 0, 0 }; static inline double qt_snan() { const unsigned char *bytes; -#ifdef QT_ARMFPA - bytes = qt_armfpa_snan_bytes; -#else bytes = (QSysInfo::ByteOrder == QSysInfo::BigEndian ? qt_be_snan_bytes : qt_le_snan_bytes); -#endif union { unsigned char c[8]; double d; } returnValue; qMemCopy(returnValue.c, bytes, sizeof(returnValue.c)); @@ -147,17 +122,12 @@ static inline double qt_snan() // Quiet NAN static const unsigned char qt_be_qnan_bytes[] = { 0xff, 0xf8, 0, 0, 0, 0, 0, 0 }; static const unsigned char qt_le_qnan_bytes[] = { 0, 0, 0, 0, 0, 0, 0xf8, 0xff }; -static const unsigned char qt_armfpa_qnan_bytes[] = { 0, 0, 0xf8, 0xff, 0, 0, 0, 0 }; static inline double qt_qnan() { const unsigned char *bytes; -#ifdef QT_ARMFPA - bytes = qt_armfpa_qnan_bytes; -#else bytes = (QSysInfo::ByteOrder == QSysInfo::BigEndian ? qt_be_qnan_bytes : qt_le_qnan_bytes); -#endif union { unsigned char c[8]; double d; } returnValue; qMemCopy(returnValue.c, bytes, sizeof(returnValue.c)); @@ -169,43 +139,31 @@ static inline double qt_qnan() static inline bool qt_is_inf(double d) { uchar *ch = (uchar *)&d; -#ifdef QT_ARMFPA - return (ch[3] & 0x7f) == 0x7f && ch[2] == 0xf0; -#else if (QSysInfo::ByteOrder == QSysInfo::BigEndian) { return (ch[0] & 0x7f) == 0x7f && ch[1] == 0xf0; } else { return (ch[7] & 0x7f) == 0x7f && ch[6] == 0xf0; } -#endif } static inline bool qt_is_nan(double d) { uchar *ch = (uchar *)&d; -#ifdef QT_ARMFPA - return (ch[3] & 0x7f) == 0x7f && ch[2] > 0xf0; -#else if (QSysInfo::ByteOrder == QSysInfo::BigEndian) { return (ch[0] & 0x7f) == 0x7f && ch[1] > 0xf0; } else { return (ch[7] & 0x7f) == 0x7f && ch[6] > 0xf0; } -#endif } static inline bool qt_is_finite(double d) { uchar *ch = (uchar *)&d; -#ifdef QT_ARMFPA - return (ch[3] & 0x7f) != 0x7f || (ch[2] & 0xf0) != 0xf0; -#else if (QSysInfo::ByteOrder == QSysInfo::BigEndian) { return (ch[0] & 0x7f) != 0x7f || (ch[1] & 0xf0) != 0xf0; } else { return (ch[7] & 0x7f) != 0x7f || (ch[6] & 0xf0) != 0xf0; } -#endif } static inline bool qt_is_inf(float d) |