# endif
};
#else
-# error "Qt not configured correctly, please run configure"
+# error "Qt not configured correctly, please run cmake"
#endif
#if defined(Q_WS_WIN) || defined(Q_OS_CYGWIN)
enum WinVersion {
QT_BEGIN_NAMESPACE
+#ifdef QT_NO_STL
/*!
Returns true if the double \a {d} is equivalent to infinity.
*/
-Q_CORE_EXPORT bool qIsInf(double d) { return qt_is_inf(d); }
+Q_CORE_EXPORT bool qIsInf(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
+}
/*!
Returns true if the double \a {d} is not a number (NaN).
*/
-Q_CORE_EXPORT bool qIsNaN(double d) { return qt_is_nan(d); }
+Q_CORE_EXPORT bool qIsNaN(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
+}
/*!
Returns true if the double \a {d} is a finite number.
*/
-Q_CORE_EXPORT bool qIsFinite(double d) { return qt_is_finite(d); }
+Q_CORE_EXPORT bool qIsFinite(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
+}
/*!
Returns true if the float \a {f} is equivalent to infinity.
*/
-Q_CORE_EXPORT bool qIsInf(float f) { return qt_is_inf(f); }
+Q_CORE_EXPORT bool qIsInf(float f)
+{
+ uchar *ch = (uchar *)&f;
+ if (QSysInfo::ByteOrder == QSysInfo::BigEndian) {
+ return (ch[0] & 0x7f) == 0x7f && ch[1] == 0x80;
+ } else {
+ return (ch[3] & 0x7f) == 0x7f && ch[2] == 0x80;
+ }
+}
/*!
Returns true if the float \a {f} is not a number (NaN).
*/
-Q_CORE_EXPORT bool qIsNaN(float f) { return qt_is_nan(f); }
+Q_CORE_EXPORT bool qIsNaN(float f)
+{
+ uchar *ch = (uchar *)&f;
+ if (QSysInfo::ByteOrder == QSysInfo::BigEndian) {
+ return (ch[0] & 0x7f) == 0x7f && ch[1] > 0x80;
+ } else {
+ return (ch[3] & 0x7f) == 0x7f && ch[2] > 0x80;
+ }
+}
/*!
Returns true if the float \a {f} is a finite number.
*/
-Q_CORE_EXPORT bool qIsFinite(float f) { return qt_is_finite(f); }
+Q_CORE_EXPORT bool qIsFinite(float f)
+{
+ uchar *ch = (uchar *)&f;
+ if (QSysInfo::ByteOrder == QSysInfo::BigEndian) {
+ return (ch[0] & 0x7f) != 0x7f || (ch[1] & 0x80) != 0x80;
+ } else {
+ return (ch[3] & 0x7f) != 0x7f || (ch[2] & 0x80) != 0x80;
+ }
+}
+#endif // QT_NO_STL
/*!
Returns the bit pattern of a signalling NaN as a double.
*/
Q_CORE_EXPORT double qInf() { return qt_inf(); }
-
QT_END_NAMESPACE
#include <QtCore/qglobal.h>
+#ifndef QT_NO_STL
+#include <math.h>
+#endif
+
QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
-
+#ifndef QT_NO_STL
+Q_CORE_EXPORT_INLINE bool qIsInf(double d) { return isinf(d); }
+Q_CORE_EXPORT_INLINE bool qIsNaN(double d) { return isnan(d); }
+Q_CORE_EXPORT_INLINE bool qIsFinite(double d) { return isfinite(d); }
+Q_CORE_EXPORT_INLINE bool qIsInf(float f) { return isinf(f); }
+Q_CORE_EXPORT_INLINE bool qIsNaN(float f) { return isnan(f); }
+Q_CORE_EXPORT_INLINE bool qIsFinite(float f) { return isfinite(f); }
+#else
Q_CORE_EXPORT bool qIsInf(double d);
Q_CORE_EXPORT bool qIsNaN(double d);
Q_CORE_EXPORT bool qIsFinite(double d);
Q_CORE_EXPORT bool qIsInf(float f);
Q_CORE_EXPORT bool qIsNaN(float f);
Q_CORE_EXPORT bool qIsFinite(float f);
+#endif
+
Q_CORE_EXPORT double qSNaN();
Q_CORE_EXPORT double qQNaN();
Q_CORE_EXPORT double qInf();
#endif // Q_CC_MIPS
-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)
-{
- uchar *ch = (uchar *)&d;
- if (QSysInfo::ByteOrder == QSysInfo::BigEndian) {
- return (ch[0] & 0x7f) == 0x7f && ch[1] == 0x80;
- } else {
- return (ch[3] & 0x7f) == 0x7f && ch[2] == 0x80;
- }
-}
-
-static inline bool qt_is_nan(float d)
-{
- uchar *ch = (uchar *)&d;
- if (QSysInfo::ByteOrder == QSysInfo::BigEndian) {
- return (ch[0] & 0x7f) == 0x7f && ch[1] > 0x80;
- } else {
- return (ch[3] & 0x7f) == 0x7f && ch[2] > 0x80;
- }
-}
-
-static inline bool qt_is_finite(float d)
-{
- uchar *ch = (uchar *)&d;
- if (QSysInfo::ByteOrder == QSysInfo::BigEndian) {
- return (ch[0] & 0x7f) != 0x7f || (ch[1] & 0x80) != 0x80;
- } else {
- return (ch[3] & 0x7f) != 0x7f || (ch[2] & 0x80) != 0x80;
- }
-}
-
QT_END_NAMESPACE
#endif // QNUMERIC_P_H
#include "qdebug.h"
#include "qdatastream.h"
#include "qmath.h"
-#include <qnumeric_p.h>
+#include <qnumeric.h>
QT_BEGIN_NAMESPACE
const QPointF c = pt1 - l.pt1;
const qreal denominator = a.y() * b.x() - a.x() * b.y();
- if (denominator == 0 || !qt_is_finite(denominator))
+ if (denominator == 0 || !qIsFinite(denominator))
return NoIntersection;
const qreal reciprocal = 1 / denominator;
# include "qt_windows.h"
# include <time.h>
#endif
+#include "qnumeric.h"
#include "qnumeric_p.h"
#include "qsystemlibrary_p.h"
QString num_str;
// Detect special numbers (nan, +/-inf)
- if (qt_is_inf(d)) {
+ if (qIsInf(d)) {
num_str = QString::fromLatin1("inf");
special_number = true;
negative = d < 0;
- } else if (qt_is_nan(d)) {
+ } else if (qIsNaN(d)) {
num_str = QString::fromLatin1("nan");
special_number = true;
}
#include <qdebug.h>
#include <qcoreapplication.h>
#include <qmath.h>
+#include <qnumeric.h>
#include <qfont_p.h>
#include <qfontengine_p.h>
Q_D(QCoreGraphicsPaintEngine);
Q_ASSERT(isActive());
- if (qt_is_nan(transform.m11()) || qt_is_nan(transform.m12()) || qt_is_nan(transform.m13())
- || qt_is_nan(transform.m21()) || qt_is_nan(transform.m22()) || qt_is_nan(transform.m23())
- || qt_is_nan(transform.m31()) || qt_is_nan(transform.m32()) || qt_is_nan(transform.m33()))
+ if (qIsNaN(transform.m11()) || qIsNaN(transform.m12()) || qIsNaN(transform.m13())
+ || qIsNaN(transform.m21()) || qIsNaN(transform.m22()) || qIsNaN(transform.m23())
+ || qIsNaN(transform.m31()) || qIsNaN(transform.m32()) || qIsNaN(transform.m33()))
return;
d->current.transform = transform;
#include <qbezier_p.h>
#include <qfontengine_p.h>
-#include <qnumeric_p.h>
+#include <qnumeric.h>
#include <qobject_p.h>
#include <qpathclipper_p.h>
#include <qstroker_p.h>
printf("QPainterPath::moveTo() (%.2f,%.2f)\n", p.x(), p.y());
#endif
- if (!qt_is_finite(p.x()) || !qt_is_finite(p.y())) {
+ if (!qIsFinite(p.x()) || !qIsFinite(p.y())) {
#ifndef QT_NO_DEBUG
qWarning("QPainterPath::moveTo: Adding point where x or y is NaN or Inf, ignoring call");
#endif
printf("QPainterPath::lineTo() (%.2f,%.2f)\n", p.x(), p.y());
#endif
- if (!qt_is_finite(p.x()) || !qt_is_finite(p.y())) {
+ if (!qIsFinite(p.x()) || !qIsFinite(p.y())) {
#ifndef QT_NO_DEBUG
qWarning("QPainterPath::lineTo: Adding point where x or y is NaN or Inf, ignoring call");
#endif
c1.x(), c1.y(), c2.x(), c2.y(), e.x(), e.y());
#endif
- if (!qt_is_finite(c1.x()) || !qt_is_finite(c1.y()) || !qt_is_finite(c2.x()) || !qt_is_finite(c2.y())
- || !qt_is_finite(e.x()) || !qt_is_finite(e.y())) {
+ if (!qIsFinite(c1.x()) || !qIsFinite(c1.y()) || !qIsFinite(c2.x()) || !qIsFinite(c2.y())
+ || !qIsFinite(e.x()) || !qIsFinite(e.y())) {
#ifndef QT_NO_DEBUG
qWarning("QPainterPath::cubicTo: Adding point where x or y is NaN or Inf, ignoring call");
#endif
c.x(), c.y(), e.x(), e.y());
#endif
- if (!qt_is_finite(c.x()) || !qt_is_finite(c.y()) || !qt_is_finite(e.x()) || !qt_is_finite(e.y())) {
+ if (!qIsFinite(c.x()) || !qIsFinite(c.y()) || !qIsFinite(e.x()) || !qIsFinite(e.y())) {
#ifndef QT_NO_DEBUG
qWarning("QPainterPath::quadTo: Adding point where x or y is NaN or Inf, ignoring call");
#endif
rect.x(), rect.y(), rect.width(), rect.height(), startAngle, sweepLength);
#endif
- if ((!qt_is_finite(rect.x()) && !qt_is_finite(rect.y())) || !qt_is_finite(rect.width()) || !qt_is_finite(rect.height())
- || !qt_is_finite(startAngle) || !qt_is_finite(sweepLength)) {
+ if ((!qIsFinite(rect.x()) && !qIsFinite(rect.y())) || !qIsFinite(rect.width()) || !qIsFinite(rect.height())
+ || !qIsFinite(startAngle) || !qIsFinite(sweepLength)) {
#ifndef QT_NO_DEBUG
qWarning("QPainterPath::arcTo: Adding arc where a parameter is NaN or Inf, ignoring call");
#endif
*/
void QPainterPath::addRect(const QRectF &r)
{
- if (!qt_is_finite(r.x()) || !qt_is_finite(r.y()) || !qt_is_finite(r.width()) || !qt_is_finite(r.height())) {
+ if (!qIsFinite(r.x()) || !qIsFinite(r.y()) || !qIsFinite(r.width()) || !qIsFinite(r.height())) {
#ifndef QT_NO_DEBUG
qWarning("QPainterPath::addRect: Adding rect where a parameter is NaN or Inf, ignoring call");
#endif
*/
void QPainterPath::addEllipse(const QRectF &boundingRect)
{
- if (!qt_is_finite(boundingRect.x()) || !qt_is_finite(boundingRect.y())
- || !qt_is_finite(boundingRect.width()) || !qt_is_finite(boundingRect.height())) {
+ if (!qIsFinite(boundingRect.x()) || !qIsFinite(boundingRect.y())
+ || !qIsFinite(boundingRect.width()) || !qIsFinite(boundingRect.height())) {
#ifndef QT_NO_DEBUG
qWarning("QPainterPath::addEllipse: Adding ellipse where a parameter is NaN or Inf, ignoring call");
#endif
s >> x;
s >> y;
Q_ASSERT(type >= 0 && type <= 3);
- if (!qt_is_finite(x) || !qt_is_finite(y)) {
+ if (!qIsFinite(x) || !qIsFinite(y)) {
#ifndef QT_NO_DEBUG
qWarning("QDataStream::operator>>: NaN or Inf element found in path, skipping it");
#endif
#include "qmath_p.h"
#include "qline.h"
#include "qtransform.h"
-#include <qmath.h>
+#include "qmath.h"
+#include "qnumeric.h"
QT_BEGIN_NAMESPACE
Q_ASSERT(curves);
*point_count = 0;
- if (qt_is_nan(rect.x()) || qt_is_nan(rect.y()) || qt_is_nan(rect.width()) || qt_is_nan(rect.height())
- || qt_is_nan(startAngle) || qt_is_nan(sweepLength)) {
+ if (qIsNaN(rect.x()) || qIsNaN(rect.y()) || qIsNaN(rect.width()) || qIsNaN(rect.height())
+ || qIsNaN(startAngle) || qIsNaN(sweepLength)) {
qWarning("QPainterPath::arcTo: Adding arc where a parameter is NaN, results are undefined");
return QPointF();
}