aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2020-10-30 16:00:24 +0100
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2020-10-31 11:55:27 +0100
commit963cbbaa420b12e810d23820b78f73c3eaaa15a8 (patch)
treeb9f9fd1284560b5dfaf9b3cf650c775fa1c8083a /src/qml
parent3019b82b1b9813b7d23ebc74a40e437cecd60a60 (diff)
Replace old Q_DECL statements with modern C++
Since we depend on C++17 now, all of these can go. Change-Id: I0484fd4bb99e4367ec211c29146c316453729959 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Diffstat (limited to 'src/qml')
-rw-r--r--src/qml/common/qv4calldata_p.h2
-rw-r--r--src/qml/common/qv4staticvalue_p.h14
-rw-r--r--src/qml/jsapi/qjsvalue.h2
-rw-r--r--src/qml/jsruntime/qv4managed_p.h4
-rw-r--r--src/qml/jsruntime/qv4regexp_p.h2
-rw-r--r--src/qml/jsruntime/qv4value_p.h4
-rw-r--r--src/qml/jsruntime/qv4vtable_p.h2
-rw-r--r--src/qml/memory/qv4heap_p.h4
-rw-r--r--src/qml/memory/qv4mm_p.h2
-rw-r--r--src/qml/memory/qv4mmdefs_p.h2
-rw-r--r--src/qml/memory/qv4writebarrier_p.h2
-rw-r--r--src/qml/qml/qqmlfileselector.cpp2
-rw-r--r--src/qml/qml/qqmlfileselector.h2
-rw-r--r--src/qml/types/qqmlmodelindexvaluetype_p.h8
14 files changed, 26 insertions, 26 deletions
diff --git a/src/qml/common/qv4calldata_p.h b/src/qml/common/qv4calldata_p.h
index 5a5280cb86..a02cea766e 100644
--- a/src/qml/common/qv4calldata_p.h
+++ b/src/qml/common/qv4calldata_p.h
@@ -95,7 +95,7 @@ struct CallData
StaticValue args[1];
- static Q_DECL_CONSTEXPR int HeaderSize()
+ static constexpr int HeaderSize()
{
return offsetof(CallData, args) / sizeof(QV4::StaticValue);
}
diff --git a/src/qml/common/qv4staticvalue_p.h b/src/qml/common/qv4staticvalue_p.h
index 0716f7ea20..2a44dcf607 100644
--- a/src/qml/common/qv4staticvalue_p.h
+++ b/src/qml/common/qv4staticvalue_p.h
@@ -191,9 +191,9 @@ struct StaticValue
quint64 _val;
- QV4_NEARLY_ALWAYS_INLINE Q_DECL_RELAXED_CONSTEXPR quint64 &rawValueRef() { return _val; }
- QV4_NEARLY_ALWAYS_INLINE Q_DECL_RELAXED_CONSTEXPR quint64 rawValue() const { return _val; }
- QV4_NEARLY_ALWAYS_INLINE Q_DECL_RELAXED_CONSTEXPR void setRawValue(quint64 raw) { _val = raw; }
+ QV4_NEARLY_ALWAYS_INLINE constexpr quint64 &rawValueRef() { return _val; }
+ QV4_NEARLY_ALWAYS_INLINE constexpr quint64 rawValue() const { return _val; }
+ QV4_NEARLY_ALWAYS_INLINE constexpr void setRawValue(quint64 raw) { _val = raw; }
#if Q_BYTE_ORDER == Q_LITTLE_ENDIAN
static inline int valueOffset() { return 0; }
@@ -203,22 +203,22 @@ struct StaticValue
static inline int tagOffset() { return 0; }
#endif
static inline constexpr quint64 tagValue(quint32 tag, quint32 value) { return quint64(tag) << 32 | value; }
- QV4_NEARLY_ALWAYS_INLINE Q_DECL_RELAXED_CONSTEXPR void setTagValue(quint32 tag, quint32 value) { _val = quint64(tag) << 32 | value; }
+ QV4_NEARLY_ALWAYS_INLINE constexpr void setTagValue(quint32 tag, quint32 value) { _val = quint64(tag) << 32 | value; }
QV4_NEARLY_ALWAYS_INLINE constexpr quint32 value() const { return _val & quint64(~quint32(0)); }
QV4_NEARLY_ALWAYS_INLINE constexpr quint32 tag() const { return _val >> 32; }
- QV4_NEARLY_ALWAYS_INLINE Q_DECL_RELAXED_CONSTEXPR void setTag(quint32 tag) { setTagValue(tag, value()); }
+ QV4_NEARLY_ALWAYS_INLINE constexpr void setTag(quint32 tag) { setTagValue(tag, value()); }
QV4_NEARLY_ALWAYS_INLINE constexpr int int_32() const
{
return int(value());
}
- QV4_NEARLY_ALWAYS_INLINE Q_DECL_RELAXED_CONSTEXPR void setInt_32(int i)
+ QV4_NEARLY_ALWAYS_INLINE constexpr void setInt_32(int i)
{
setTagValue(quint32(ValueTypeInternal::Integer), quint32(i));
}
QV4_NEARLY_ALWAYS_INLINE uint uint_32() const { return value(); }
- QV4_NEARLY_ALWAYS_INLINE Q_DECL_RELAXED_CONSTEXPR void setEmpty()
+ QV4_NEARLY_ALWAYS_INLINE constexpr void setEmpty()
{
setTagValue(quint32(ValueTypeInternal::Empty), 0);
}
diff --git a/src/qml/jsapi/qjsvalue.h b/src/qml/jsapi/qjsvalue.h
index c814ce14f8..8a62b974c8 100644
--- a/src/qml/jsapi/qjsvalue.h
+++ b/src/qml/jsapi/qjsvalue.h
@@ -153,7 +153,7 @@ public:
private:
friend class QJSValuePrivate;
// force compile error, prevent QJSValue(bool) to be called
- QJSValue(void *) Q_DECL_EQ_DELETE;
+ QJSValue(void *) = delete;
quint64 d;
};
diff --git a/src/qml/jsruntime/qv4managed_p.h b/src/qml/jsruntime/qv4managed_p.h
index 6db03181f9..016b3e2eea 100644
--- a/src/qml/jsruntime/qv4managed_p.h
+++ b/src/qml/jsruntime/qv4managed_p.h
@@ -92,7 +92,7 @@ inline void qYouForgotTheQ_MANAGED_Macro(T1, T2) {}
#define V4_MANAGED(DataClass, superClass) \
private: \
- DataClass() Q_DECL_EQ_DELETE; \
+ DataClass() = delete; \
Q_DISABLE_COPY(DataClass) \
V4_MANAGED_ITSELF(DataClass, superClass) \
Q_STATIC_ASSERT(std::is_trivial< QV4::Heap::DataClass >::value);
@@ -119,7 +119,7 @@ struct Q_QML_PRIVATE_EXPORT Managed : Value, VTableBase
};
private:
void *operator new(size_t);
- Managed() Q_DECL_EQ_DELETE;
+ Managed() = delete;
Q_DISABLE_COPY(Managed)
public:
diff --git a/src/qml/jsruntime/qv4regexp_p.h b/src/qml/jsruntime/qv4regexp_p.h
index ff6cc061ee..122db47008 100644
--- a/src/qml/jsruntime/qv4regexp_p.h
+++ b/src/qml/jsruntime/qv4regexp_p.h
@@ -164,7 +164,7 @@ inline RegExpCacheKey::RegExpCacheKey(const RegExp::Data *re)
, flags(re->flags)
{}
-inline size_t qHash(const RegExpCacheKey& key, size_t seed = 0) Q_DECL_NOTHROW
+inline size_t qHash(const RegExpCacheKey& key, size_t seed = 0) noexcept
{ return qHash(key.pattern, seed); }
class RegExpCache : public QHash<RegExpCacheKey, WeakValue>
diff --git a/src/qml/jsruntime/qv4value_p.h b/src/qml/jsruntime/qv4value_p.h
index 42e97b1d36..530c8eaf27 100644
--- a/src/qml/jsruntime/qv4value_p.h
+++ b/src/qml/jsruntime/qv4value_p.h
@@ -480,7 +480,7 @@ inline double Value::toInteger() const
template <size_t o>
struct HeapValue : Value {
- static Q_CONSTEXPR size_t offset = o;
+ static constexpr size_t offset = o;
HeapBasePtr base() {
HeapBasePtr base = reinterpret_cast<HeapBasePtr>(this) - (offset/sizeof(Heap::Base));
Q_ASSERT(base->inUse());
@@ -497,7 +497,7 @@ struct HeapValue : Value {
template <size_t o>
struct ValueArray {
- static Q_CONSTEXPR size_t offset = o;
+ static constexpr size_t offset = o;
uint size;
uint alloc;
Value values[1];
diff --git a/src/qml/jsruntime/qv4vtable_p.h b/src/qml/jsruntime/qv4vtable_p.h
index 9dda104cd1..588205f046 100644
--- a/src/qml/jsruntime/qv4vtable_p.h
+++ b/src/qml/jsruntime/qv4vtable_p.h
@@ -202,7 +202,7 @@ const QV4::VTable classname::static_vtbl = DEFINE_MANAGED_VTABLE_INT(classname,
#define V4_OBJECT2(DataClass, superClass) \
private: \
- DataClass() Q_DECL_EQ_DELETE; \
+ DataClass() = delete; \
Q_DISABLE_COPY(DataClass) \
public: \
Q_MANAGED_CHECK \
diff --git a/src/qml/memory/qv4heap_p.h b/src/qml/memory/qv4heap_p.h
index d9c607aea4..6e11d93f58 100644
--- a/src/qml/memory/qv4heap_p.h
+++ b/src/qml/memory/qv4heap_p.h
@@ -69,7 +69,7 @@ namespace Heap {
template <typename T, size_t o>
struct Pointer {
- static Q_CONSTEXPR size_t offset = o;
+ static constexpr size_t offset = o;
T operator->() const { return get(); }
operator T () const { return get(); }
@@ -245,7 +245,7 @@ struct QV4QPointer {
init(o);
return *this;
}
- bool isNull() const Q_DECL_NOTHROW
+ bool isNull() const noexcept
{
return d == nullptr || qObject == nullptr || d->strongref.loadRelaxed() == 0;
}
diff --git a/src/qml/memory/qv4mm_p.h b/src/qml/memory/qv4mm_p.h
index 74a760d093..881f4fd19d 100644
--- a/src/qml/memory/qv4mm_p.h
+++ b/src/qml/memory/qv4mm_p.h
@@ -156,7 +156,7 @@ public:
// TODO: this is only for 64bit (and x86 with SSE/AVX), so exend it for other architectures to be slightly more efficient (meaning, align on 8-byte boundaries).
// Note: all occurrences of "16" in alloc/dealloc are also due to the alignment.
- Q_DECL_CONSTEXPR static inline std::size_t align(std::size_t size)
+ constexpr static inline std::size_t align(std::size_t size)
{ return (size + Chunk::SlotSize - 1) & ~(Chunk::SlotSize - 1); }
template<typename ManagedType>
diff --git a/src/qml/memory/qv4mmdefs_p.h b/src/qml/memory/qv4mmdefs_p.h
index 117e8f4360..43e81e0434 100644
--- a/src/qml/memory/qv4mmdefs_p.h
+++ b/src/qml/memory/qv4mmdefs_p.h
@@ -349,7 +349,7 @@ private:
struct name##SizeStruct : base, name##OffsetStruct {}; \
struct name##Data { \
typedef base SuperClass; \
- static Q_CONSTEXPR size_t baseOffset = sizeof(name##SizeStruct) - sizeof(name##OffsetStruct); \
+ static constexpr size_t baseOffset = sizeof(name##SizeStruct) - sizeof(name##OffsetStruct); \
name##Members(name, HEAP_OBJECT_MEMBER_EXPANSION) \
}; \
Q_STATIC_ASSERT(sizeof(name##SizeStruct) == sizeof(name##Data) + name##Data::baseOffset); \
diff --git a/src/qml/memory/qv4writebarrier_p.h b/src/qml/memory/qv4writebarrier_p.h
index c65cfc0269..d2dc4521f2 100644
--- a/src/qml/memory/qv4writebarrier_p.h
+++ b/src/qml/memory/qv4writebarrier_p.h
@@ -80,7 +80,7 @@ Q_ALWAYS_INLINE void fence() {}
#if WRITEBARRIER(none)
template <NewValueType type>
-static Q_CONSTEXPR inline bool isRequired() {
+static constexpr inline bool isRequired() {
return false;
}
diff --git a/src/qml/qml/qqmlfileselector.cpp b/src/qml/qml/qqmlfileselector.cpp
index aaddfa628c..4b773adc3e 100644
--- a/src/qml/qml/qqmlfileselector.cpp
+++ b/src/qml/qml/qqmlfileselector.cpp
@@ -124,7 +124,7 @@ QQmlFileSelector::~QQmlFileSelector()
\since 5.7
Returns the QFileSelector instance used by the QQmlFileSelector.
*/
-QFileSelector *QQmlFileSelector::selector() const Q_DECL_NOTHROW
+QFileSelector *QQmlFileSelector::selector() const noexcept
{
Q_D(const QQmlFileSelector);
return d->selector;
diff --git a/src/qml/qml/qqmlfileselector.h b/src/qml/qml/qqmlfileselector.h
index 0aeea6775f..8ad565e49d 100644
--- a/src/qml/qml/qqmlfileselector.h
+++ b/src/qml/qml/qqmlfileselector.h
@@ -56,7 +56,7 @@ class Q_QML_EXPORT QQmlFileSelector : public QObject
public:
explicit QQmlFileSelector(QQmlEngine *engine, QObject *parent = nullptr);
~QQmlFileSelector() override;
- QFileSelector *selector() const Q_DECL_NOTHROW;
+ QFileSelector *selector() const noexcept;
void setSelector(QFileSelector *selector);
void setExtraSelectors(const QStringList &strings);
diff --git a/src/qml/types/qqmlmodelindexvaluetype_p.h b/src/qml/types/qqmlmodelindexvaluetype_p.h
index 59c33bf5af..dae04f6581 100644
--- a/src/qml/types/qqmlmodelindexvaluetype_p.h
+++ b/src/qml/types/qqmlmodelindexvaluetype_p.h
@@ -76,11 +76,11 @@ public:
Q_INVOKABLE QString toString() const
{ return QLatin1String("QModelIndex") + propertiesString(v); }
- inline int row() const Q_DECL_NOTHROW { return v.row(); }
- inline int column() const Q_DECL_NOTHROW { return v.column(); }
+ inline int row() const noexcept { return v.row(); }
+ inline int column() const noexcept { return v.column(); }
inline QModelIndex parent() const { return v.parent(); }
- inline bool isValid() const Q_DECL_NOTHROW { return v.isValid(); }
- inline QAbstractItemModel *model() const Q_DECL_NOTHROW
+ inline bool isValid() const noexcept { return v.isValid(); }
+ inline QAbstractItemModel *model() const noexcept
{ return const_cast<QAbstractItemModel *>(v.model()); }
quint64 internalId() const { return v.internalId(); }