aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@theqtcompany.com>2015-12-07 14:15:47 +0100
committerUlf Hermann <ulf.hermann@theqtcompany.com>2015-12-07 13:44:07 +0000
commit2177fb44eac92690807d80fa24ce5564d94d508e (patch)
tree8216057bd4df09683c5d631b33c06f3210647c84
parent4ab7deb923237b0186a211b0326217c480e33848 (diff)
Replace all occurrences of qSNaN() with qQNaN()
We generally don't want to produce signalling NaNs as those cannot be used in any further arithmetic operations. In particular -(qSNaN()) claims it's not a double. Task-number: QTBUG-49753 Change-Id: I23cec4fec2ddf08c02a7d53db7f3b9ba46b6c288 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
-rw-r--r--src/particles/qquickv4particledata.cpp4
-rw-r--r--src/qml/compiler/qv4jsir.cpp2
-rw-r--r--src/qml/compiler/qv4ssa.cpp2
-rw-r--r--src/qml/jsruntime/qv4dataview.cpp2
-rw-r--r--src/qml/jsruntime/qv4dateobject.cpp48
-rw-r--r--src/qml/jsruntime/qv4dateobject_p.h2
-rw-r--r--src/qml/jsruntime/qv4mathobject.cpp42
-rw-r--r--src/qml/jsruntime/qv4numberobject.cpp2
-rw-r--r--src/qml/jsruntime/qv4stringobject.cpp2
-rw-r--r--src/qml/parser/qqmljsengine_p.cpp4
-rw-r--r--src/quick/items/context2d/qquickcontext2d.cpp6
-rw-r--r--tests/auto/qml/qjsvalue/tst_qjsvalue.cpp16
12 files changed, 66 insertions, 66 deletions
diff --git a/src/particles/qquickv4particledata.cpp b/src/particles/qquickv4particledata.cpp
index 876c7214b0..41e8c8e94a 100644
--- a/src/particles/qquickv4particledata.cpp
+++ b/src/particles/qquickv4particledata.cpp
@@ -380,7 +380,7 @@ static QV4::ReturnedValue particleData_set_ ## VARIABLE (QV4::CallContext *ctx)\
if (!r || !r->d()->datum)\
ctx->engine()->throwError(QStringLiteral("Not a valid ParticleData object"));\
\
- r->d()->datum-> VARIABLE = ctx->argc() ? ctx->args()[0].toNumber() : qSNaN();\
+ r->d()->datum-> VARIABLE = ctx->argc() ? ctx->args()[0].toNumber() : qQNaN();\
return QV4::Encode::undefined(); \
}
@@ -401,7 +401,7 @@ static QV4::ReturnedValue particleData_set_ ## VARIABLE (QV4::CallContext *ctx)\
if (!r || !r->d()->datum)\
ctx->engine()->throwError(QStringLiteral("Not a valid ParticleData object"));\
\
- r->d()->datum-> SETTER (ctx->argc() ? ctx->args()[0].toNumber() : qSNaN());\
+ r->d()->datum-> SETTER (ctx->argc() ? ctx->args()[0].toNumber() : qQNaN());\
return QV4::Encode::undefined(); \
}
diff --git a/src/qml/compiler/qv4jsir.cpp b/src/qml/compiler/qv4jsir.cpp
index 98b53c6b3b..f49a440572 100644
--- a/src/qml/compiler/qv4jsir.cpp
+++ b/src/qml/compiler/qv4jsir.cpp
@@ -558,7 +558,7 @@ Expr *BasicBlock::CONST(Type type, double value)
} else if (type == NullType) {
value = 0;
} else if (type == UndefinedType) {
- value = qSNaN();
+ value = qQNaN();
}
e->init(type, value);
diff --git a/src/qml/compiler/qv4ssa.cpp b/src/qml/compiler/qv4ssa.cpp
index 89101ad756..28437a1d3c 100644
--- a/src/qml/compiler/qv4ssa.cpp
+++ b/src/qml/compiler/qv4ssa.cpp
@@ -2771,7 +2771,7 @@ void convertConst(Const *c, Type targetType)
break;
case NullType:
case UndefinedType:
- c->value = qSNaN();
+ c->value = qQNaN();
c->type = targetType;
default:
Q_UNIMPLEMENTED();
diff --git a/src/qml/jsruntime/qv4dataview.cpp b/src/qml/jsruntime/qv4dataview.cpp
index 8901834e76..cd28c03fa3 100644
--- a/src/qml/jsruntime/qv4dataview.cpp
+++ b/src/qml/jsruntime/qv4dataview.cpp
@@ -285,7 +285,7 @@ ReturnedValue DataViewPrototype::method_setFloat(CallContext *ctx)
return scope.engine->throwTypeError();
idx += v->d()->byteOffset;
- double val = ctx->argc() >= 2 ? ctx->args()[1].toNumber() : qSNaN();
+ double val = ctx->argc() >= 2 ? ctx->args()[1].toNumber() : qQNaN();
bool littleEndian = ctx->argc() < 3 ? false : ctx->args()[2].toBoolean();
if (sizeof(T) == 4) {
diff --git a/src/qml/jsruntime/qv4dateobject.cpp b/src/qml/jsruntime/qv4dateobject.cpp
index a6e1f47d91..d414ec2084 100644
--- a/src/qml/jsruntime/qv4dateobject.cpp
+++ b/src/qml/jsruntime/qv4dateobject.cpp
@@ -198,7 +198,7 @@ static inline double MonthFromTime(double t)
else if (d < 365.0 + l)
return 11;
- return qSNaN(); // ### assert?
+ return qQNaN(); // ### assert?
}
static inline double DateFromTime(double t)
@@ -222,7 +222,7 @@ static inline double DateFromTime(double t)
case 11: return d - 333.0 - l;
}
- return qSNaN(); // ### assert
+ return qQNaN(); // ### assert
}
static inline double WeekDay(double t)
@@ -254,7 +254,7 @@ static inline double DayFromMonth(double month, double leap)
case 11: return 334.0 + leap;
}
- return qSNaN(); // ### assert?
+ return qQNaN(); // ### assert?
}
static double MakeDay(double year, double month, double day)
@@ -333,7 +333,7 @@ static inline double currentTime()
static inline double TimeClip(double t)
{
if (! qIsFinite(t) || fabs(t) > 8.64e15)
- return qSNaN();
+ return qQNaN();
return Primitive::toInteger(t);
}
@@ -538,7 +538,7 @@ static inline double ParseString(const QString &s)
}
}
if (!dt.isValid())
- return qSNaN();
+ return qQNaN();
return dt.toMSecsSinceEpoch();
}
@@ -630,7 +630,7 @@ DEFINE_OBJECT_VTABLE(DateObject);
Heap::DateObject::DateObject(const QDateTime &date)
{
- this->date = date.isValid() ? date.toMSecsSinceEpoch() : qSNaN();
+ this->date = date.isValid() ? date.toMSecsSinceEpoch() : qQNaN();
}
QDateTime DateObject::toQDateTime() const
@@ -764,7 +764,7 @@ double DatePrototype::getThisDate(ExecutionContext *ctx)
ReturnedValue DatePrototype::method_parse(CallContext *ctx)
{
if (!ctx->argc())
- return Encode(qSNaN());
+ return Encode(qQNaN());
return Encode(ParseString(ctx->args()[0].toQString()));
}
@@ -994,7 +994,7 @@ ReturnedValue DatePrototype::method_setTime(CallContext *ctx)
if (!self)
return ctx->engine()->throwTypeError();
- double t = ctx->argc() ? ctx->args()[0].toNumber() : qSNaN();
+ double t = ctx->argc() ? ctx->args()[0].toNumber() : qQNaN();
self->setDate(TimeClip(t));
return Encode(self->date());
}
@@ -1007,7 +1007,7 @@ ReturnedValue DatePrototype::method_setMilliseconds(CallContext *ctx)
return ctx->engine()->throwTypeError();
double t = LocalTime(self->date());
- double ms = ctx->argc() ? ctx->args()[0].toNumber() : qSNaN();
+ double ms = ctx->argc() ? ctx->args()[0].toNumber() : qQNaN();
self->setDate(TimeClip(UTC(MakeDate(Day(t), MakeTime(HourFromTime(t), MinFromTime(t), SecFromTime(t), ms)))));
return Encode(self->date());
}
@@ -1019,7 +1019,7 @@ ReturnedValue DatePrototype::method_setUTCMilliseconds(CallContext *ctx)
return ctx->engine()->throwTypeError();
double t = self->date();
- double ms = ctx->argc() ? ctx->args()[0].toNumber() : qSNaN();
+ double ms = ctx->argc() ? ctx->args()[0].toNumber() : qQNaN();
self->setDate(TimeClip(MakeDate(Day(t), MakeTime(HourFromTime(t), MinFromTime(t), SecFromTime(t), ms))));
return Encode(self->date());
}
@@ -1031,7 +1031,7 @@ ReturnedValue DatePrototype::method_setSeconds(CallContext *ctx)
return ctx->engine()->throwTypeError();
double t = LocalTime(self->date());
- double sec = ctx->argc() ? ctx->args()[0].toNumber() : qSNaN();
+ double sec = ctx->argc() ? ctx->args()[0].toNumber() : qQNaN();
double ms = (ctx->argc() < 2) ? msFromTime(t) : ctx->args()[1].toNumber();
t = TimeClip(UTC(MakeDate(Day(t), MakeTime(HourFromTime(t), MinFromTime(t), sec, ms))));
self->setDate(t);
@@ -1045,7 +1045,7 @@ ReturnedValue DatePrototype::method_setUTCSeconds(CallContext *ctx)
return ctx->engine()->throwTypeError();
double t = self->date();
- double sec = ctx->argc() ? ctx->args()[0].toNumber() : qSNaN();
+ double sec = ctx->argc() ? ctx->args()[0].toNumber() : qQNaN();
double ms = (ctx->argc() < 2) ? msFromTime(t) : ctx->args()[1].toNumber();
t = TimeClip(MakeDate(Day(t), MakeTime(HourFromTime(t), MinFromTime(t), sec, ms)));
self->setDate(t);
@@ -1059,7 +1059,7 @@ ReturnedValue DatePrototype::method_setMinutes(CallContext *ctx)
return ctx->engine()->throwTypeError();
double t = LocalTime(self->date());
- double min = ctx->argc() ? ctx->args()[0].toNumber() : qSNaN();
+ double min = ctx->argc() ? ctx->args()[0].toNumber() : qQNaN();
double sec = (ctx->argc() < 2) ? SecFromTime(t) : ctx->args()[1].toNumber();
double ms = (ctx->argc() < 3) ? msFromTime(t) : ctx->args()[2].toNumber();
t = TimeClip(UTC(MakeDate(Day(t), MakeTime(HourFromTime(t), min, sec, ms))));
@@ -1074,7 +1074,7 @@ ReturnedValue DatePrototype::method_setUTCMinutes(CallContext *ctx)
return ctx->engine()->throwTypeError();
double t = self->date();
- double min = ctx->argc() ? ctx->args()[0].toNumber() : qSNaN();
+ double min = ctx->argc() ? ctx->args()[0].toNumber() : qQNaN();
double sec = (ctx->argc() < 2) ? SecFromTime(t) : ctx->args()[1].toNumber();
double ms = (ctx->argc() < 3) ? msFromTime(t) : ctx->args()[2].toNumber();
t = TimeClip(MakeDate(Day(t), MakeTime(HourFromTime(t), min, sec, ms)));
@@ -1089,7 +1089,7 @@ ReturnedValue DatePrototype::method_setHours(CallContext *ctx)
return ctx->engine()->throwTypeError();
double t = LocalTime(self->date());
- double hour = ctx->argc() ? ctx->args()[0].toNumber() : qSNaN();
+ double hour = ctx->argc() ? ctx->args()[0].toNumber() : qQNaN();
double min = (ctx->argc() < 2) ? MinFromTime(t) : ctx->args()[1].toNumber();
double sec = (ctx->argc() < 3) ? SecFromTime(t) : ctx->args()[2].toNumber();
double ms = (ctx->argc() < 4) ? msFromTime(t) : ctx->args()[3].toNumber();
@@ -1105,7 +1105,7 @@ ReturnedValue DatePrototype::method_setUTCHours(CallContext *ctx)
return ctx->engine()->throwTypeError();
double t = self->date();
- double hour = ctx->argc() ? ctx->args()[0].toNumber() : qSNaN();
+ double hour = ctx->argc() ? ctx->args()[0].toNumber() : qQNaN();
double min = (ctx->argc() < 2) ? MinFromTime(t) : ctx->args()[1].toNumber();
double sec = (ctx->argc() < 3) ? SecFromTime(t) : ctx->args()[2].toNumber();
double ms = (ctx->argc() < 4) ? msFromTime(t) : ctx->args()[3].toNumber();
@@ -1121,7 +1121,7 @@ ReturnedValue DatePrototype::method_setDate(CallContext *ctx)
return ctx->engine()->throwTypeError();
double t = LocalTime(self->date());
- double date = ctx->argc() ? ctx->args()[0].toNumber() : qSNaN();
+ double date = ctx->argc() ? ctx->args()[0].toNumber() : qQNaN();
t = TimeClip(UTC(MakeDate(MakeDay(YearFromTime(t), MonthFromTime(t), date), TimeWithinDay(t))));
self->setDate(t);
return Encode(self->date());
@@ -1134,7 +1134,7 @@ ReturnedValue DatePrototype::method_setUTCDate(CallContext *ctx)
return ctx->engine()->throwTypeError();
double t = self->date();
- double date = ctx->argc() ? ctx->args()[0].toNumber() : qSNaN();
+ double date = ctx->argc() ? ctx->args()[0].toNumber() : qQNaN();
t = TimeClip(MakeDate(MakeDay(YearFromTime(t), MonthFromTime(t), date), TimeWithinDay(t)));
self->setDate(t);
return Encode(self->date());
@@ -1147,7 +1147,7 @@ ReturnedValue DatePrototype::method_setMonth(CallContext *ctx)
return ctx->engine()->throwTypeError();
double t = LocalTime(self->date());
- double month = ctx->argc() ? ctx->args()[0].toNumber() : qSNaN();
+ double month = ctx->argc() ? ctx->args()[0].toNumber() : qQNaN();
double date = (ctx->argc() < 2) ? DateFromTime(t) : ctx->args()[1].toNumber();
t = TimeClip(UTC(MakeDate(MakeDay(YearFromTime(t), month, date), TimeWithinDay(t))));
self->setDate(t);
@@ -1161,7 +1161,7 @@ ReturnedValue DatePrototype::method_setUTCMonth(CallContext *ctx)
return ctx->engine()->throwTypeError();
double t = self->date();
- double month = ctx->argc() ? ctx->args()[0].toNumber() : qSNaN();
+ double month = ctx->argc() ? ctx->args()[0].toNumber() : qQNaN();
double date = (ctx->argc() < 2) ? DateFromTime(t) : ctx->args()[1].toNumber();
t = TimeClip(MakeDate(MakeDay(YearFromTime(t), month, date), TimeWithinDay(t)));
self->setDate(t);
@@ -1179,10 +1179,10 @@ ReturnedValue DatePrototype::method_setYear(CallContext *ctx)
t = 0;
else
t = LocalTime(t);
- double year = ctx->argc() ? ctx->args()[0].toNumber() : qSNaN();
+ double year = ctx->argc() ? ctx->args()[0].toNumber() : qQNaN();
double r;
if (std::isnan(year)) {
- r = qSNaN();
+ r = qQNaN();
} else {
if ((Primitive::toInteger(year) >= 0) && (Primitive::toInteger(year) <= 99))
year += 1900;
@@ -1201,7 +1201,7 @@ ReturnedValue DatePrototype::method_setUTCFullYear(CallContext *ctx)
return ctx->engine()->throwTypeError();
double t = self->date();
- double year = ctx->argc() ? ctx->args()[0].toNumber() : qSNaN();
+ double year = ctx->argc() ? ctx->args()[0].toNumber() : qQNaN();
double month = (ctx->argc() < 2) ? MonthFromTime(t) : ctx->args()[1].toNumber();
double date = (ctx->argc() < 3) ? DateFromTime(t) : ctx->args()[2].toNumber();
t = TimeClip(MakeDate(MakeDay(year, month, date), TimeWithinDay(t)));
@@ -1218,7 +1218,7 @@ ReturnedValue DatePrototype::method_setFullYear(CallContext *ctx)
double t = LocalTime(self->date());
if (std::isnan(t))
t = 0;
- double year = ctx->argc() ? ctx->args()[0].toNumber() : qSNaN();
+ double year = ctx->argc() ? ctx->args()[0].toNumber() : qQNaN();
double month = (ctx->argc() < 2) ? MonthFromTime(t) : ctx->args()[1].toNumber();
double date = (ctx->argc() < 3) ? DateFromTime(t) : ctx->args()[2].toNumber();
t = TimeClip(UTC(MakeDate(MakeDay(year, month, date), TimeWithinDay(t))));
diff --git a/src/qml/jsruntime/qv4dateobject_p.h b/src/qml/jsruntime/qv4dateobject_p.h
index 2eaa837666..eb048b1e99 100644
--- a/src/qml/jsruntime/qv4dateobject_p.h
+++ b/src/qml/jsruntime/qv4dateobject_p.h
@@ -59,7 +59,7 @@ namespace Heap {
struct DateObject : Object {
DateObject()
{
- date = qSNaN();
+ date = qQNaN();
}
DateObject(const Value &date)
diff --git a/src/qml/jsruntime/qv4mathobject.cpp b/src/qml/jsruntime/qv4mathobject.cpp
index 3d3ac84576..ada073fbd4 100644
--- a/src/qml/jsruntime/qv4mathobject.cpp
+++ b/src/qml/jsruntime/qv4mathobject.cpp
@@ -96,7 +96,7 @@ static double copySign(double x, double y)
ReturnedValue MathObject::method_abs(CallContext *context)
{
if (!context->argc())
- return Encode(qSNaN());
+ return Encode(qQNaN());
if (context->args()[0].isInteger()) {
int i = context->args()[0].integerValue();
@@ -114,7 +114,7 @@ ReturnedValue MathObject::method_acos(CallContext *context)
{
double v = context->argc() ? context->args()[0].toNumber() : 2;
if (v > 1)
- return Encode(qSNaN());
+ return Encode(qQNaN());
return Encode(std::acos(v));
}
@@ -123,14 +123,14 @@ ReturnedValue MathObject::method_asin(CallContext *context)
{
double v = context->argc() ? context->args()[0].toNumber() : 2;
if (v > 1)
- return Encode(qSNaN());
+ return Encode(qQNaN());
else
return Encode(std::asin(v));
}
ReturnedValue MathObject::method_atan(CallContext *context)
{
- double v = context->argc() ? context->args()[0].toNumber() : qSNaN();
+ double v = context->argc() ? context->args()[0].toNumber() : qQNaN();
if (v == 0.0)
return Encode(v);
else
@@ -139,8 +139,8 @@ ReturnedValue MathObject::method_atan(CallContext *context)
ReturnedValue MathObject::method_atan2(CallContext *context)
{
- double v1 = context->argc() ? context->args()[0].toNumber() : qSNaN();
- double v2 = context->argc() > 1 ? context->args()[1].toNumber() : qSNaN();
+ double v1 = context->argc() ? context->args()[0].toNumber() : qQNaN();
+ double v2 = context->argc() > 1 ? context->args()[1].toNumber() : qQNaN();
if ((v1 < 0) && qIsFinite(v1) && qIsInf(v2) && (copySign(1.0, v2) == 1.0))
return Encode(copySign(0, -1.0));
@@ -157,7 +157,7 @@ ReturnedValue MathObject::method_atan2(CallContext *context)
ReturnedValue MathObject::method_ceil(CallContext *context)
{
- double v = context->argc() ? context->args()[0].toNumber() : qSNaN();
+ double v = context->argc() ? context->args()[0].toNumber() : qQNaN();
if (v < 0.0 && v > -1.0)
return Encode(copySign(0, -1.0));
else
@@ -166,13 +166,13 @@ ReturnedValue MathObject::method_ceil(CallContext *context)
ReturnedValue MathObject::method_cos(CallContext *context)
{
- double v = context->argc() ? context->args()[0].toNumber() : qSNaN();
+ double v = context->argc() ? context->args()[0].toNumber() : qQNaN();
return Encode(std::cos(v));
}
ReturnedValue MathObject::method_exp(CallContext *context)
{
- double v = context->argc() ? context->args()[0].toNumber() : qSNaN();
+ double v = context->argc() ? context->args()[0].toNumber() : qQNaN();
if (qIsInf(v)) {
if (copySign(1.0, v) == -1.0)
return Encode(0);
@@ -185,15 +185,15 @@ ReturnedValue MathObject::method_exp(CallContext *context)
ReturnedValue MathObject::method_floor(CallContext *context)
{
- double v = context->argc() ? context->args()[0].toNumber() : qSNaN();
+ double v = context->argc() ? context->args()[0].toNumber() : qQNaN();
return Encode(std::floor(v));
}
ReturnedValue MathObject::method_log(CallContext *context)
{
- double v = context->argc() ? context->args()[0].toNumber() : qSNaN();
+ double v = context->argc() ? context->args()[0].toNumber() : qQNaN();
if (v < 0)
- return Encode(qSNaN());
+ return Encode(qQNaN());
else
return Encode(std::log(v));
}
@@ -224,16 +224,16 @@ ReturnedValue MathObject::method_min(CallContext *context)
ReturnedValue MathObject::method_pow(CallContext *context)
{
- double x = context->argc() > 0 ? context->args()[0].toNumber() : qSNaN();
- double y = context->argc() > 1 ? context->args()[1].toNumber() : qSNaN();
+ double x = context->argc() > 0 ? context->args()[0].toNumber() : qQNaN();
+ double y = context->argc() > 1 ? context->args()[1].toNumber() : qQNaN();
if (std::isnan(y))
- return Encode(qSNaN());
+ return Encode(qQNaN());
if (y == 0) {
return Encode(1);
} else if (((x == 1) || (x == -1)) && std::isinf(y)) {
- return Encode(qSNaN());
+ return Encode(qQNaN());
} else if (((x == 0) && copySign(1.0, x) == 1.0) && (y < 0)) {
return Encode(qInf());
} else if ((x == 0) && copySign(1.0, x) == -1.0) {
@@ -269,7 +269,7 @@ ReturnedValue MathObject::method_pow(CallContext *context)
return Encode(std::pow(x, y));
}
// ###
- return Encode(qSNaN());
+ return Encode(qQNaN());
}
Q_GLOBAL_STATIC(QThreadStorage<bool *>, seedCreatedStorage);
@@ -290,26 +290,26 @@ ReturnedValue MathObject::method_random(CallContext *context)
ReturnedValue MathObject::method_round(CallContext *context)
{
- double v = context->argc() ? context->args()[0].toNumber() : qSNaN();
+ double v = context->argc() ? context->args()[0].toNumber() : qQNaN();
v = copySign(std::floor(v + 0.5), v);
return Encode(v);
}
ReturnedValue MathObject::method_sin(CallContext *context)
{
- double v = context->argc() ? context->args()[0].toNumber() : qSNaN();
+ double v = context->argc() ? context->args()[0].toNumber() : qQNaN();
return Encode(std::sin(v));
}
ReturnedValue MathObject::method_sqrt(CallContext *context)
{
- double v = context->argc() ? context->args()[0].toNumber() : qSNaN();
+ double v = context->argc() ? context->args()[0].toNumber() : qQNaN();
return Encode(std::sqrt(v));
}
ReturnedValue MathObject::method_tan(CallContext *context)
{
- double v = context->argc() ? context->args()[0].toNumber() : qSNaN();
+ double v = context->argc() ? context->args()[0].toNumber() : qQNaN();
if (v == 0.0)
return Encode(v);
else
diff --git a/src/qml/jsruntime/qv4numberobject.cpp b/src/qml/jsruntime/qv4numberobject.cpp
index 7e51d2a410..5006c8c2cd 100644
--- a/src/qml/jsruntime/qv4numberobject.cpp
+++ b/src/qml/jsruntime/qv4numberobject.cpp
@@ -89,7 +89,7 @@ void NumberPrototype::init(ExecutionEngine *engine, Object *ctor)
ctor->defineReadonlyProperty(engine->id_prototype(), (o = this));
ctor->defineReadonlyProperty(engine->id_length(), Primitive::fromInt32(1));
- ctor->defineReadonlyProperty(QStringLiteral("NaN"), Primitive::fromDouble(qSNaN()));
+ ctor->defineReadonlyProperty(QStringLiteral("NaN"), Primitive::fromDouble(qQNaN()));
ctor->defineReadonlyProperty(QStringLiteral("NEGATIVE_INFINITY"), Primitive::fromDouble(-qInf()));
ctor->defineReadonlyProperty(QStringLiteral("POSITIVE_INFINITY"), Primitive::fromDouble(qInf()));
ctor->defineReadonlyProperty(QStringLiteral("MAX_VALUE"), Primitive::fromDouble(1.7976931348623158e+308));
diff --git a/src/qml/jsruntime/qv4stringobject.cpp b/src/qml/jsruntime/qv4stringobject.cpp
index 757ec6c6bf..8433582215 100644
--- a/src/qml/jsruntime/qv4stringobject.cpp
+++ b/src/qml/jsruntime/qv4stringobject.cpp
@@ -264,7 +264,7 @@ ReturnedValue StringPrototype::method_charCodeAt(CallContext *context)
if (pos >= 0 && pos < str.length())
return Encode(str.at(pos).unicode());
- return Encode(qSNaN());
+ return Encode(qQNaN());
}
ReturnedValue StringPrototype::method_concat(CallContext *context)
diff --git a/src/qml/parser/qqmljsengine_p.cpp b/src/qml/parser/qqmljsengine_p.cpp
index 1c0a70a372..7cc9096e59 100644
--- a/src/qml/parser/qqmljsengine_p.cpp
+++ b/src/qml/parser/qqmljsengine_p.cpp
@@ -56,7 +56,7 @@ static inline int toDigit(char c)
double integerFromString(const char *buf, int size, int radix)
{
if (size == 0)
- return qSNaN();
+ return qQNaN();
double sign = 1.0;
int i = 0;
@@ -95,7 +95,7 @@ double integerFromString(const char *buf, int size, int radix)
if (!qstrcmp(buf, "Infinity"))
result = qInf();
else
- result = qSNaN();
+ result = qQNaN();
} else {
result = 0;
double multiplier = 1;
diff --git a/src/quick/items/context2d/qquickcontext2d.cpp b/src/quick/items/context2d/qquickcontext2d.cpp
index 1c021e7dc6..ee880f129d 100644
--- a/src/quick/items/context2d/qquickcontext2d.cpp
+++ b/src/quick/items/context2d/qquickcontext2d.cpp
@@ -1250,7 +1250,7 @@ QV4::ReturnedValue QQuickJSContext2D::method_set_globalAlpha(QV4::CallContext *c
QV4::Scoped<QQuickJSContext2D> r(scope, ctx->thisObject().as<QQuickJSContext2D>());
CHECK_CONTEXT_SETTER(r)
- double globalAlpha = ctx->argc() ? ctx->args()[0].toNumber() : qSNaN();
+ double globalAlpha = ctx->argc() ? ctx->args()[0].toNumber() : qQNaN();
if (!qIsFinite(globalAlpha))
return QV4::Encode::undefined();
@@ -2000,7 +2000,7 @@ QV4::ReturnedValue QQuickJSContext2D::method_set_shadowOffsetX(QV4::CallContext
QV4::Scoped<QQuickJSContext2D> r(scope, ctx->thisObject());
CHECK_CONTEXT_SETTER(r)
- qreal offsetX = ctx->argc() ? ctx->args()[0].toNumber() : qSNaN();
+ qreal offsetX = ctx->argc() ? ctx->args()[0].toNumber() : qQNaN();
if (qIsFinite(offsetX) && offsetX != r->d()->context->state.shadowOffsetX) {
r->d()->context->state.shadowOffsetX = offsetX;
r->d()->context->buffer()->setShadowOffsetX(offsetX);
@@ -2028,7 +2028,7 @@ QV4::ReturnedValue QQuickJSContext2D::method_set_shadowOffsetY(QV4::CallContext
QV4::Scoped<QQuickJSContext2D> r(scope, ctx->thisObject());
CHECK_CONTEXT_SETTER(r)
- qreal offsetY = ctx->argc() ? ctx->args()[0].toNumber() : qSNaN();
+ qreal offsetY = ctx->argc() ? ctx->args()[0].toNumber() : qQNaN();
if (qIsFinite(offsetY) && offsetY != r->d()->context->state.shadowOffsetY) {
r->d()->context->state.shadowOffsetY = offsetY;
r->d()->context->buffer()->setShadowOffsetY(offsetY);
diff --git a/tests/auto/qml/qjsvalue/tst_qjsvalue.cpp b/tests/auto/qml/qjsvalue/tst_qjsvalue.cpp
index 6553baea76..0d15268d6f 100644
--- a/tests/auto/qml/qjsvalue/tst_qjsvalue.cpp
+++ b/tests/auto/qml/qjsvalue/tst_qjsvalue.cpp
@@ -540,7 +540,7 @@ void tst_QJSValue::toBoolean() // deprecated
QCOMPARE(number.toBool(), false);
QCOMPARE(qjsvalue_cast<bool>(number), false);
- QJSValue number2 = eng.toScriptValue(qSNaN());
+ QJSValue number2 = eng.toScriptValue(qQNaN());
QCOMPARE(number2.toBool(), false);
QCOMPARE(qjsvalue_cast<bool>(number2), false);
@@ -583,7 +583,7 @@ void tst_QJSValue::toBoolean() // deprecated
QCOMPARE(number.toBool(), false);
QCOMPARE(qjsvalue_cast<bool>(number), false);
- QJSValue number2 = QJSValue(qSNaN());
+ QJSValue number2 = QJSValue(qQNaN());
QCOMPARE(number2.toBool(), false);
QCOMPARE(qjsvalue_cast<bool>(number2), false);
@@ -633,7 +633,7 @@ void tst_QJSValue::toBool()
QCOMPARE(number.toBool(), false);
QCOMPARE(qjsvalue_cast<bool>(number), false);
- QJSValue number2 = eng.toScriptValue(qSNaN());
+ QJSValue number2 = eng.toScriptValue(qQNaN());
QCOMPARE(number2.toBool(), false);
QCOMPARE(qjsvalue_cast<bool>(number2), false);
@@ -676,7 +676,7 @@ void tst_QJSValue::toBool()
QCOMPARE(number.toBool(), false);
QCOMPARE(qjsvalue_cast<bool>(number), false);
- QJSValue number2 = QJSValue(qSNaN());
+ QJSValue number2 = QJSValue(qQNaN());
QCOMPARE(number2.toBool(), false);
QCOMPARE(qjsvalue_cast<bool>(number2), false);
@@ -714,7 +714,7 @@ void tst_QJSValue::toInt()
QCOMPARE(number.toInt(), 123);
QCOMPARE(qjsvalue_cast<qint32>(number), 123);
- QJSValue number2 = eng.toScriptValue(qSNaN());
+ QJSValue number2 = eng.toScriptValue(qQNaN());
QCOMPARE(number2.toInt(), 0);
QCOMPARE(qjsvalue_cast<qint32>(number2), 0);
@@ -776,7 +776,7 @@ void tst_QJSValue::toInt()
QCOMPARE(number.toInt(), 123);
QCOMPARE(qjsvalue_cast<qint32>(number), 123);
- QJSValue number2 = QJSValue(qSNaN());
+ QJSValue number2 = QJSValue(qQNaN());
QCOMPARE(number2.toInt(), 0);
QCOMPARE(qjsvalue_cast<qint32>(number2), 0);
@@ -850,7 +850,7 @@ void tst_QJSValue::toUInt()
QCOMPARE(number.toUInt(), quint32(123));
QCOMPARE(qjsvalue_cast<quint32>(number), quint32(123));
- QJSValue number2 = eng.toScriptValue(qSNaN());
+ QJSValue number2 = eng.toScriptValue(qQNaN());
QCOMPARE(number2.toUInt(), quint32(0));
QCOMPARE(qjsvalue_cast<quint32>(number2), quint32(0));
@@ -910,7 +910,7 @@ void tst_QJSValue::toUInt()
QCOMPARE(number.toUInt(), quint32(123));
QCOMPARE(qjsvalue_cast<quint32>(number), quint32(123));
- QJSValue number2 = QJSValue(qSNaN());
+ QJSValue number2 = QJSValue(qQNaN());
QCOMPARE(number2.toUInt(), quint32(0));
QCOMPARE(qjsvalue_cast<quint32>(number2), quint32(0));