Compile fixes for clang10

Fix some warnings that are flagged as errors on clang10.

Change-Id: I906634c8b2bd94db42d74a7f3d10efb086e373cc
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
This commit is contained in:
Lars Knoll 2020-04-05 14:54:04 +02:00
parent e80544ebca
commit bc726ed5d9
8 changed files with 19 additions and 19 deletions

View File

@ -642,7 +642,7 @@ void QConcatenateTablesProxyModelPrivate::_q_slotSourceLayoutAboutToBeChanged(co
layoutChangePersistentIndexes.reserve(persistentIndexList.size()); layoutChangePersistentIndexes.reserve(persistentIndexList.size());
layoutChangeProxyIndexes.reserve(persistentIndexList.size()); layoutChangeProxyIndexes.reserve(persistentIndexList.size());
for (const QPersistentModelIndex &proxyPersistentIndex : persistentIndexList) { for (const QModelIndex &proxyPersistentIndex : persistentIndexList) {
layoutChangeProxyIndexes.append(proxyPersistentIndex); layoutChangeProxyIndexes.append(proxyPersistentIndex);
Q_ASSERT(proxyPersistentIndex.isValid()); Q_ASSERT(proxyPersistentIndex.isValid());
const QPersistentModelIndex srcPersistentIndex = q->mapToSource(proxyPersistentIndex); const QPersistentModelIndex srcPersistentIndex = q->mapToSource(proxyPersistentIndex);

View File

@ -532,7 +532,7 @@ void QIdentityProxyModelPrivate::_q_sourceLayoutAboutToBeChanged(const QList<QPe
emit q->layoutAboutToBeChanged(parents, hint); emit q->layoutAboutToBeChanged(parents, hint);
const auto proxyPersistentIndexes = q->persistentIndexList(); const auto proxyPersistentIndexes = q->persistentIndexList();
for (const QPersistentModelIndex &proxyPersistentIndex : proxyPersistentIndexes) { for (const QModelIndex &proxyPersistentIndex : proxyPersistentIndexes) {
proxyIndexes << proxyPersistentIndex; proxyIndexes << proxyPersistentIndex;
Q_ASSERT(proxyPersistentIndex.isValid()); Q_ASSERT(proxyPersistentIndex.isValid());
const QPersistentModelIndex srcPersistentIndex = q->mapToSource(proxyPersistentIndex); const QPersistentModelIndex srcPersistentIndex = q->mapToSource(proxyPersistentIndex);

View File

@ -92,7 +92,7 @@ void QTransposeProxyModelPrivate::onLayoutAboutToBeChanged(const QList<QPersiste
layoutChangePersistentIndexes.clear(); layoutChangePersistentIndexes.clear();
layoutChangeProxyIndexes.reserve(proxyPersistentIndexes.size()); layoutChangeProxyIndexes.reserve(proxyPersistentIndexes.size());
layoutChangePersistentIndexes.reserve(proxyPersistentIndexes.size()); layoutChangePersistentIndexes.reserve(proxyPersistentIndexes.size());
for (const QPersistentModelIndex &proxyPersistentIndex : proxyPersistentIndexes) { for (const QModelIndex &proxyPersistentIndex : proxyPersistentIndexes) {
layoutChangeProxyIndexes << proxyPersistentIndex; layoutChangeProxyIndexes << proxyPersistentIndex;
Q_ASSERT(proxyPersistentIndex.isValid()); Q_ASSERT(proxyPersistentIndex.isValid());
const QPersistentModelIndex srcPersistentIndex = q->mapToSource(proxyPersistentIndex); const QPersistentModelIndex srcPersistentIndex = q->mapToSource(proxyPersistentIndex);

View File

@ -4466,7 +4466,7 @@ QStringList QLocale::uiLanguages() const
if (!res.isNull()) { if (!res.isNull()) {
uiLanguages = res.toStringList(); uiLanguages = res.toStringList();
// ... but we need to include likely-adjusted forms of each of those, too: // ... but we need to include likely-adjusted forms of each of those, too:
for (const auto entry : qAsConst(uiLanguages)) for (const auto &entry : qAsConst(uiLanguages))
locales.append(QLocale(entry)); locales.append(QLocale(entry));
} }
if (locales.isEmpty()) if (locales.isEmpty())

View File

@ -2842,15 +2842,15 @@ static void QT_FASTCALL fetchTransformedBilinearARGB32PM_fast_rotate_helper(uint
fy += fdy; fy += fdy;
++b; ++b;
} }
uint *boundedEnd = end; \ uint *boundedEnd = end;
if (fdx > 0) \ if (fdx > 0)
boundedEnd = qMin(boundedEnd, b + (max_fx - fx) / fdx); \ boundedEnd = qMin(boundedEnd, b + (max_fx - fx) / fdx);
else if (fdx < 0) \ else if (fdx < 0)
boundedEnd = qMin(boundedEnd, b + (min_fx - fx) / fdx); \ boundedEnd = qMin(boundedEnd, b + (min_fx - fx) / fdx);
if (fdy > 0) \ if (fdy > 0)
boundedEnd = qMin(boundedEnd, b + (max_fy - fy) / fdy); \ boundedEnd = qMin(boundedEnd, b + (max_fy - fy) / fdy);
else if (fdy < 0) \ else if (fdy < 0)
boundedEnd = qMin(boundedEnd, b + (min_fy - fy) / fdy); \ boundedEnd = qMin(boundedEnd, b + (min_fy - fy) / fdy);
// until boundedEnd we can now have a fast middle part without boundary checks // until boundedEnd we can now have a fast middle part without boundary checks
#if defined(__SSE2__) #if defined(__SSE2__)

View File

@ -2845,7 +2845,7 @@ static bool RectInRegion(QRegionPrivate *region, int rx, int ry, uint rwidth, ui
break; break;
} }
} }
return partIn ? ((ry <= prect->bottom()) ? RectanglePart : RectangleIn) : RectangleOut; return partIn;
} }
// END OF Region.c extract // END OF Region.c extract
// START OF poly.h extract // START OF poly.h extract

View File

@ -609,10 +609,10 @@ Q_GUI_EXPORT void qt_addBitmapToPath(qreal x0, qreal y0, const uchar *image_data
// set up edges // set up edges
for (int y = 0; y <= h; ++y) { for (int y = 0; y <= h; ++y) {
for (int x = 0; x <= w; ++x) { for (int x = 0; x <= w; ++x) {
bool topLeft = (x == 0)|(y == 0) ? false : SET(x - 1, y - 1); bool topLeft = (x == 0 || y == 0) ? false : SET(x - 1, y - 1);
bool topRight = (x == w)|(y == 0) ? false : SET(x, y - 1); bool topRight = (x == w || y == 0) ? false : SET(x, y - 1);
bool bottomLeft = (x == 0)|(y == h) ? false : SET(x - 1, y); bool bottomLeft = (x == 0 || y == h) ? false : SET(x - 1, y);
bool bottomRight = (x == w)|(y == h) ? false : SET(x, y); bool bottomRight = (x == w || y == h) ? false : SET(x, y);
GRID(x, y) = 0; GRID(x, y) = 0;
if ((!topRight) & bottomRight) if ((!topRight) & bottomRight)

View File

@ -693,7 +693,7 @@ QValidator::State QDoubleValidatorPrivate::validateWithLocale(QString &input, QL
if (notation == QDoubleValidator::StandardNotation) { if (notation == QDoubleValidator::StandardNotation) {
double max = qMax(qAbs(q->b), qAbs(q->t)); double max = qMax(qAbs(q->b), qAbs(q->t));
if (max < LLONG_MAX) { if (max < double(LLONG_MAX)) {
qlonglong n = pow10(numDigits(qlonglong(max))); qlonglong n = pow10(numDigits(qlonglong(max)));
// In order to get the highest possible number in the intermediate // In order to get the highest possible number in the intermediate
// range we need to get 10 to the power of the number of digits // range we need to get 10 to the power of the number of digits