summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorVolker Hilsheimer <volker.hilsheimer@qt.io>2021-05-06 11:16:46 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2021-05-06 20:30:54 +0000
commit25bd96eb80ce06073b70f7594262b70ffe31a3fb (patch)
treef4605ddc4ce993ac3e14d05949df49998efea5ba /src
parentca4d48595bb6ac46e7c99598bdaa870c5d350815 (diff)
Silence MSVC warning about int/size_t mismatch
Warning was qmetaobjectbuilder.cpp(1439): warning C4267: '+=': conversion from 'size_t' to 'int', possible loss of data Instead of adding another cast in that line, fix the warning by making the size variable a qsizetype, and remove the now unnecessary static_cast to int. Change-Id: Ieff9330501f5a07c4bbe1e851a3ef211f8bf2d24 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 718d1f88d7089d6792eea4dcb56875734a09a742) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'src')
-rw-r--r--src/corelib/kernel/qmetaobjectbuilder.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/corelib/kernel/qmetaobjectbuilder.cpp b/src/corelib/kernel/qmetaobjectbuilder.cpp
index c842cd68b9..341a1ca53b 100644
--- a/src/corelib/kernel/qmetaobjectbuilder.cpp
+++ b/src/corelib/kernel/qmetaobjectbuilder.cpp
@@ -1173,7 +1173,7 @@ static int buildMetaObject(QMetaObjectBuilderPrivate *d, char *buf,
{
Q_UNUSED(expectedSize); // Avoid warning in release mode
Q_UNUSED(buf);
- int size = 0;
+ qsizetype size = 0;
int dataIndex;
int paramsIndex;
int enumIndex;
@@ -1467,7 +1467,7 @@ static int buildMetaObject(QMetaObjectBuilderPrivate *d, char *buf,
}
}
// parameterMetaTypesIndex is equal to the total number of metatypes
- size += static_cast<int>(sizeof(QMetaType) * parameterMetaTypesIndex);
+ size += sizeof(QMetaType) * parameterMetaTypesIndex;
}
// Align the final size and return it.