diff options
-rw-r--r-- | masm/assembler/MacroAssembler.h | 2 | ||||
-rw-r--r-- | masm/config.h | 4 | ||||
-rw-r--r-- | qmljs_math.h | 2 | ||||
-rw-r--r-- | qmljs_runtime.cpp | 12 | ||||
-rw-r--r-- | qmljs_runtime.h | 12 | ||||
-rw-r--r-- | qv4codegen.cpp | 2 | ||||
-rw-r--r-- | qv4ecmaobjects.cpp | 2 | ||||
-rw-r--r-- | qv4ir.cpp | 2 |
8 files changed, 20 insertions, 18 deletions
diff --git a/masm/assembler/MacroAssembler.h b/masm/assembler/MacroAssembler.h index 43c9b470f7..b17e19bb9d 100644 --- a/masm/assembler/MacroAssembler.h +++ b/masm/assembler/MacroAssembler.h @@ -534,7 +534,7 @@ public: bool shouldBlindDouble(double value) { // Don't trust NaN or +/-Infinity - if (!isfinite(value)) + if (!std::isfinite(value)) return true; // Try to force normalisation, and check that there's no change diff --git a/masm/config.h b/masm/config.h index 2f4d9f4925..1ced4e454c 100644 --- a/masm/config.h +++ b/masm/config.h @@ -45,8 +45,10 @@ #include <wtf/Platform.h> #ifdef __cplusplus #include <wtf/Vector.h> +#include <cmath> +#else +#include <math.h> #endif #include <limits.h> -#include <math.h> #endif // MASM_CONFIG_H diff --git a/qmljs_math.h b/qmljs_math.h index 8e4ff2c03b..89d6e28ee3 100644 --- a/qmljs_math.h +++ b/qmljs_math.h @@ -42,7 +42,7 @@ #define QMLJS_MATH_H #include <QtCore/qnumeric.h> -#include <math.h> +#include <cmath> #if 1 //CPU(X86_64) diff --git a/qmljs_runtime.cpp b/qmljs_runtime.cpp index 73391159f2..fd8d61a6ad 100644 --- a/qmljs_runtime.cpp +++ b/qmljs_runtime.cpp @@ -109,26 +109,26 @@ Value Value::fromString(Context *ctx, const QString &s) int Value::toInt32(double number) { - if (! number || isnan(number) || isinf(number)) + if (! number || std::isnan(number) || std::isinf(number)) return +0; return (int) trunc(number); // ### } unsigned int Value::toUInt32(double number) { - if (! number || isnan(number) || isinf(number)) + if (! number || std::isnan(number) || std::isinf(number)) return +0; return (uint) trunc(number); // ### } int Value::toInteger(double number) { - if (isnan(number)) + if (std::isnan(number)) return +0; - else if (! number || isinf(number)) + else if (! number || std::isinf(number)) return number; const double v = floor(fabs(number)); - return signbit(number) ? -v : v; + return std::signbit(number) ? -v : v; } int Value::toUInt16(Context *ctx) @@ -1007,7 +1007,7 @@ Value __qmljs_compare(Context *ctx, const Value x, const Value y, bool leftFirst } else { double nx = __qmljs_to_number(px, ctx); double ny = __qmljs_to_number(py, ctx); - if (isnan(nx) || isnan(ny)) { + if (std::isnan(nx) || std::isnan(ny)) { return Value::undefinedValue(); } else { return Value::fromBoolean(nx < ny); diff --git a/qmljs_runtime.h b/qmljs_runtime.h index 82becb1467..a8ea72ca9f 100644 --- a/qmljs_runtime.h +++ b/qmljs_runtime.h @@ -47,7 +47,7 @@ # include <QtCore/QDebug> #endif -#include <math.h> +#include <cmath> #include <cassert> namespace QQmlJS { @@ -733,10 +733,10 @@ inline double __qmljs_to_integer(const Value value, Context *ctx) const double number = __qmljs_to_number(value, ctx); if (qIsNaN(number)) return +0; - else if (! number || isinf(number)) + else if (! number || std::isinf(number)) return number; const double v = floor(fabs(number)); - return signbit(number) ? -v : v; + return std::signbit(number) ? -v : v; } inline int __qmljs_to_int32(const Value value, Context *ctx) @@ -749,7 +749,7 @@ inline int __qmljs_to_int32(const Value value, Context *ctx) return static_cast<int>(number); } - if (! number || qIsNaN(number) || isinf(number)) + if (! number || qIsNaN(number) || std::isinf(number)) return 0; double D32 = 4294967296.0; @@ -774,7 +774,7 @@ inline unsigned __qmljs_to_uint32(const Value value, Context *ctx) return (unsigned) value.int_32; double number = __qmljs_to_number(value, ctx); - if (! number || qIsNaN(number) || isinf(number)) + if (! number || qIsNaN(number) || std::isinf(number)) return +0; double sign = (number < 0) ? -1.0 : 1.0; @@ -792,7 +792,7 @@ inline unsigned __qmljs_to_uint32(const Value value, Context *ctx) inline unsigned short __qmljs_to_uint16(const Value value, Context *ctx) { double number = __qmljs_to_number(value, ctx); - if (! number || qIsNaN(number) || isinf(number)) + if (! number || qIsNaN(number) || std::isinf(number)) return +0; double sign = (number < 0) ? -1.0 : 1.0; diff --git a/qv4codegen.cpp b/qv4codegen.cpp index 892638fe88..69529cd695 100644 --- a/qv4codegen.cpp +++ b/qv4codegen.cpp @@ -47,7 +47,7 @@ #include <QtCore/QBitArray> #include <QtCore/QStack> #include <private/qqmljsast_p.h> -#include <math.h> +#include <cmath> #include <iostream> #include <cassert> diff --git a/qv4ecmaobjects.cpp b/qv4ecmaobjects.cpp index 54985facf7..f303f8f123 100644 --- a/qv4ecmaobjects.cpp +++ b/qv4ecmaobjects.cpp @@ -47,7 +47,7 @@ #include <QtCore/QDateTime> #include <QtCore/QStringList> #include <QtCore/QDebug> -#include <math.h> +#include <cmath> #include <qmath.h> #include <qnumeric.h> #include <cassert> @@ -44,7 +44,7 @@ #include <QtCore/qtextstream.h> #include <QtCore/qdebug.h> -#include <math.h> +#include <cmath> #include <cassert> QT_BEGIN_NAMESPACE |