Commit 474fc5ae authored by Boudewijn Rempt's avatar Boudewijn Rempt

Use qIsNaN everywhere instead of std::isnan with windows ifdefs.

parent c00797a2
......@@ -46,12 +46,7 @@
#define BEZIER_FLATNESS_THRESHOLD 0.5
#include <kis_distance_information.h>
#ifdef Q_OS_WIN
#include <float.h>
#ifndef __MINGW32__
#define isnan _isnan
#endif
#endif
#include <qnumeric.h>
struct Q_DECL_HIDDEN KisPaintOp::Private {
Private(KisPaintOp *_q)
......@@ -124,11 +119,7 @@ static void paintBezierCurve(KisPaintOp *paintOp,
qreal d2 = line.absDistance(control2);
if ((d1 < BEZIER_FLATNESS_THRESHOLD && d2 < BEZIER_FLATNESS_THRESHOLD)
#ifdef Q_CC_MSVC
|| isnan(d1) || isnan(d2)) {
#else
|| std::isnan(d1) || std::isnan(d2)) {
#endif
|| qIsNaN(d1) || qIsNaN(d2)) {
paintOp->paintLine(pi1, pi2, currentDistance);
} else {
// Midpoint subdivision. See Foley & Van Dam Computer Graphics P.508
......
......@@ -28,12 +28,7 @@
#include "kis_painter.h"
#include "kis_image.h"
#ifdef Q_OS_WIN
#include <float.h>
#ifndef __MINGW32__
#define isnan _isnan
#endif
#endif
#include <qnumeric.h>
struct Q_DECL_HIDDEN KisCageTransformWorker::Private
{
......@@ -213,15 +208,9 @@ QVector<QPointF> KisCageTransformWorker::Private::calculateTransformedPoints()
for (int i = 0; i < numValidPoints; i++) {
transformedPoints[i] = cage.transformedPoint(i, transfCage);
#ifdef Q_CC_MSVC
if (isnan(transformedPoints[i].x()) ||
isnan(transformedPoints[i].y())) {
#else
if (std::isnan(transformedPoints[i].x()) ||
std::isnan(transformedPoints[i].y())) {
#endif
warnKrita << "WARNING: One grid point has been removed from consideration" << validPoints[i];
if (qIsNaN(transformedPoints[i].x()) ||
qIsNaN(transformedPoints[i].y())) {
warnKrita << "WARNING: One grid point has been removed from consideration" << validPoints[i];
transformedPoints[i] = validPoints[i];
}
......
......@@ -26,12 +26,7 @@
#include "kis_rect_mask_generator.h"
#include "kis_base_mask_generator.h"
#ifdef Q_OS_WIN
#include <float.h>
#ifndef __MINGW32__
#define isnan _isnan
#endif
#endif
#include <qnumeric.h>
struct Q_DECL_HIDDEN KisRectangleMaskGenerator::Private {
double m_c;
......@@ -50,11 +45,7 @@ KisRectangleMaskGenerator::KisRectangleMaskGenerator(qreal radius, qreal ratio,
d->m_c = 0;
} else {
d->m_c = (fv / fh);
#ifdef Q_CC_MSVC
Q_ASSERT(!isnan(d->m_c));
#else
Q_ASSERT(!std::isnan(d->m_c));
#endif
Q_ASSERT(!qIsNaN(d->m_c));
}
......
......@@ -26,13 +26,7 @@
#include <WidgetsDebug.h>
#include <klocalizedstring.h>
#ifdef Q_OS_WIN
#include <float.h>
#ifndef __MINGW32__
#define isnan _isnan
#endif
#endif
#include <qnumeric.h>
// #define DEBUG_VALIDATOR
// #define DEBUG_VALUEFROMTEXT
......@@ -101,12 +95,7 @@ QValidator::State KoUnitDoubleSpinBox::validate(QString &input, int &pos) const
const double value = valueFromText( number );
double newVal = 0.0;
#ifdef Q_CC_MSVC
if (!isnan(value)) {
#else
if (!std::isnan(value)) {
#endif
if (!qIsNaN(value)) {
bool ok;
const KoUnit unit = KoUnit::fromSymbol(unitName, &ok);
if ( ok )
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment