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. Pick-to: 6.1 Change-Id: Ieff9330501f5a07c4bbe1e851a3ef211f8bf2d24 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>bb10
parent
e3b2b12a91
commit
718d1f88d7
|
|
@ -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;
|
||||
|
|
@ -1472,7 +1472,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.
|
||||
|
|
|
|||
Loading…
Reference in New Issue