aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmlpropertycache_p.h
diff options
context:
space:
mode:
authorFabian Kosmale <fabian.kosmale@qt.io>2022-10-17 12:23:32 +0200
committerFabian Kosmale <fabian.kosmale@qt.io>2022-10-31 15:10:52 +0200
commit7f5b7617bf62e25d050a593edebd1d3f82e57832 (patch)
tree49b2033263183ebbdf5d492822d5b9d2b8622a81 /src/qml/qml/qqmlpropertycache_p.h
parentab7f354df2d4381a4bf9aaa7e1f8d89c076d3806 (diff)
qqmlpropertycache_p.h: Explicitly cast size to int
The number of properties, methods and enums are already limited by what QMetaObject supports (which is at most INT_MAX, but realistically much less). Therefore, we know that the containers will never contain more than INT_MAX many elements, and we can cast size() to int to avoid a -Wshorten-64-to-32 warning. Task-number: QTBUG-105055 Change-Id: Ieea970984e41e95ae3dccecf8656591f959645ec Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'src/qml/qml/qqmlpropertycache_p.h')
-rw-r--r--src/qml/qml/qqmlpropertycache_p.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/qml/qml/qqmlpropertycache_p.h b/src/qml/qml/qqmlpropertycache_p.h
index 1ba23a15e3..5827a59f13 100644
--- a/src/qml/qml/qqmlpropertycache_p.h
+++ b/src/qml/qml/qqmlpropertycache_p.h
@@ -434,7 +434,7 @@ bool QQmlPropertyCache::isAllowedInRevision(const QQmlPropertyData *data) const
int QQmlPropertyCache::propertyCount() const
{
- return propertyIndexCacheStart + propertyIndexCache.size();
+ return propertyIndexCacheStart + int(propertyIndexCache.size());
}
int QQmlPropertyCache::propertyOffset() const
@@ -444,7 +444,7 @@ int QQmlPropertyCache::propertyOffset() const
int QQmlPropertyCache::methodCount() const
{
- return methodIndexCacheStart + methodIndexCache.size();
+ return methodIndexCacheStart + int(methodIndexCache.size());
}
int QQmlPropertyCache::methodOffset() const
@@ -454,7 +454,7 @@ int QQmlPropertyCache::methodOffset() const
int QQmlPropertyCache::signalCount() const
{
- return signalHandlerIndexCacheStart + signalHandlerIndexCache.size();
+ return signalHandlerIndexCacheStart + int(signalHandlerIndexCache.size());
}
int QQmlPropertyCache::signalOffset() const
@@ -464,7 +464,7 @@ int QQmlPropertyCache::signalOffset() const
int QQmlPropertyCache::qmlEnumCount() const
{
- return enumCache.size();
+ return int(enumCache.size());
}
bool QQmlPropertyCache::callJSFactoryMethod(QObject *object, void **args) const