aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/common
diff options
context:
space:
mode:
Diffstat (limited to 'src/qml/common')
-rw-r--r--src/qml/common/qjsnumbercoercion.h4
-rw-r--r--src/qml/common/qv4compileddata_p.h6
2 files changed, 7 insertions, 3 deletions
diff --git a/src/qml/common/qjsnumbercoercion.h b/src/qml/common/qjsnumbercoercion.h
index 2517442bb6..0e233747ff 100644
--- a/src/qml/common/qjsnumbercoercion.h
+++ b/src/qml/common/qjsnumbercoercion.h
@@ -48,6 +48,10 @@ QT_BEGIN_NAMESPACE
class QJSNumberCoercion
{
public:
+ static constexpr bool isInteger(double d) {
+ return equals(d, d) && equals(static_cast<int>(d), d);
+ }
+
static constexpr int toInteger(double d) {
if (!equals(d, d))
return 0;
diff --git a/src/qml/common/qv4compileddata_p.h b/src/qml/common/qv4compileddata_p.h
index b14e523ab2..35119364d9 100644
--- a/src/qml/common/qv4compileddata_p.h
+++ b/src/qml/common/qv4compileddata_p.h
@@ -129,7 +129,7 @@ struct TableIterator
struct Location
{
Location() : m_data(QSpecialIntegerBitfieldZero) {}
- Location(quint32 l, quint32 c)
+ Location(quint32 l, quint32 c) : Location()
{
m_data.set<LineField>(l);
m_data.set<ColumnField>(c);
@@ -182,7 +182,7 @@ struct RegExp
};
RegExp() : m_data(QSpecialIntegerBitfieldZero) {}
- RegExp(quint32 flags, quint32 stringIndex)
+ RegExp(quint32 flags, quint32 stringIndex) : RegExp()
{
m_data.set<FlagsField>(flags);
m_data.set<StringIndexField>(stringIndex);
@@ -211,7 +211,7 @@ struct Lookup
quint32 nameIndex() const { return m_data.get<NameIndexField>(); }
Lookup() : m_data(QSpecialIntegerBitfieldZero) {}
- Lookup(Type type, quint32 nameIndex)
+ Lookup(Type type, quint32 nameIndex) : Lookup()
{
m_data.set<TypeAndFlagsField>(type);
m_data.set<NameIndexField>(nameIndex);