From bd0158ff2b16acf8ecb0169fdea697e9ea15b58d Mon Sep 17 00:00:00 2001 From: Shawn Rutledge Date: Fri, 25 Aug 2023 16:01:03 +0200 Subject: Avoid unsigned->signed refCount conversion underflow refCount is uint; there's no reason to convert it to int, even though it's normally small enough to fit. Avoid warnings both now and in the future by using auto. Task-number: QTBUG-114953 Change-Id: I93fd50b78bcf371f9ba56c6626334b435bac0e7d Reviewed-by: Axel Spoerl (cherry picked from commit c6cda495c636a204cb6ce2a7a1af689fb618a663) Reviewed-by: Qt Cherry-pick Bot --- src/quick/util/qquickpixmapcache.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/quick/util/qquickpixmapcache.cpp b/src/quick/util/qquickpixmapcache.cpp index 0854bb764d..e6aca2de49 100644 --- a/src/quick/util/qquickpixmapcache.cpp +++ b/src/quick/util/qquickpixmapcache.cpp @@ -1287,7 +1287,7 @@ QQuickPixmapStore::~QQuickPixmapStore() // unreference all (leaked) pixmaps const auto cache = m_cache; // NOTE: intentional copy (QTBUG-65077); releasing items from the cache modifies m_cache. for (auto *pixmap : cache) { - int currRefCount = pixmap->refCount; + auto currRefCount = pixmap->refCount; if (currRefCount) { #ifndef QT_NO_DEBUG leakedPixmaps++; -- cgit v1.2.3