From e8b4c49efddb87f4195c74668b5026119eccea56 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Thu, 17 Nov 2011 15:52:53 +0100 Subject: qtbase tests: Fix some warnings - Fix warnings about QAtomicPointer/Int usage - Fix some gcc 4.6 warnings about assigned/unused variables Change-Id: Ib4dbf9110f0dad93ad48e97278310f05fad3a82a Reviewed-by: Rohan McGovern --- tests/auto/corelib/thread/qmutex/tst_qmutex.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'tests/auto/corelib/thread') diff --git a/tests/auto/corelib/thread/qmutex/tst_qmutex.cpp b/tests/auto/corelib/thread/qmutex/tst_qmutex.cpp index cc36af8b56..82b0c98522 100644 --- a/tests/auto/corelib/thread/qmutex/tst_qmutex.cpp +++ b/tests/auto/corelib/thread/qmutex/tst_qmutex.cpp @@ -576,28 +576,28 @@ public: quint64 i = 0; while (t.elapsed() < one_minute) { i++; - uint nb = (i * 9 + lockCount * 13) % threadCount; + uint nb = (i * 9 + lockCount.load() * 13) % threadCount; QMutexLocker locker(&mutex[nb]); - if (sentinel[nb]) errorCount.ref(); + if (sentinel[nb].load()) errorCount.ref(); if (sentinel[nb].fetchAndAddRelaxed(5)) errorCount.ref(); if (!sentinel[nb].testAndSetRelaxed(5, 0)) errorCount.ref(); - if (sentinel[nb]) errorCount.ref(); + if (sentinel[nb].load()) errorCount.ref(); lockCount.ref(); - nb = (nb * 17 + i * 5 + lockCount * 3) % threadCount; + nb = (nb * 17 + i * 5 + lockCount.load() * 3) % threadCount; if (mutex[nb].tryLock()) { - if (sentinel[nb]) errorCount.ref(); + if (sentinel[nb].load()) errorCount.ref(); if (sentinel[nb].fetchAndAddRelaxed(16)) errorCount.ref(); if (!sentinel[nb].testAndSetRelaxed(16, 0)) errorCount.ref(); - if (sentinel[nb]) errorCount.ref(); + if (sentinel[nb].load()) errorCount.ref(); lockCount.ref(); mutex[nb].unlock(); } - nb = (nb * 15 + i * 47 + lockCount * 31) % threadCount; + nb = (nb * 15 + i * 47 + lockCount.load() * 31) % threadCount; if (mutex[nb].tryLock(2)) { - if (sentinel[nb]) errorCount.ref(); + if (sentinel[nb].load()) errorCount.ref(); if (sentinel[nb].fetchAndAddRelaxed(53)) errorCount.ref(); if (!sentinel[nb].testAndSetRelaxed(53, 0)) errorCount.ref(); - if (sentinel[nb]) errorCount.ref(); + if (sentinel[nb].load()) errorCount.ref(); lockCount.ref(); mutex[nb].unlock(); } -- cgit v1.2.3