diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2010-05-28 09:15:41 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2010-05-28 09:15:41 (GMT) |
commit | ddff256949b93171d4428aaa037051bb5f1fca02 (patch) | |
tree | bb900bade37c45210e229bb4cd976c5fc7814cc2 /src/corelib | |
parent | 369f899e69362b2156800f8c90dfb0bdbe5f2598 (diff) | |
parent | 85fa83ac89367bf4f3a85d038ef64a362aa8377e (diff) | |
download | Qt-ddff256949b93171d4428aaa037051bb5f1fca02.zip Qt-ddff256949b93171d4428aaa037051bb5f1fca02.tar.gz Qt-ddff256949b93171d4428aaa037051bb5f1fca02.tar.bz2 |
Merge branch 'qt-4.7-from-4.6' of scm.dev.nokia.troll.no:qt/qt-integration into 4.7-integration
* 'qt-4.7-from-4.6' of scm.dev.nokia.troll.no:qt/qt-integration:
Added some changes for 4.6.3
Fix compilation for tst_qtextcodec with QT_NO_CONCURRENT defined.
Allow auto-test to compile when using namespaces
Fix regression in QVarLengthArray::operator=
Removed unnecessary PlatSec capabilities from spectrum demo DLL
Make test work with shadow builds again.
Added missing PlatSec capabilities to spectrum demo DLL
My 4.6.3 changes
Tidy changes file for 4.6.3.
My 4.6.3 changes
My 4.6.3 changes
Fix the compilation for tst_qabstractprintdialog and tst_qprinter on symbian.
Build fix for spectrum demo when -qtnamespace is used
Fixed license headers in spectrum demo
Qt app draws background incorrectly when animated wallpaper is used
Don't use QAtomicInt in statics because they are non-POD.
QTBUG-5955: Qt fails to build on alpha architecture
Diffstat (limited to 'src/corelib')
-rw-r--r-- | src/corelib/arch/qatomic_alpha.h | 12 | ||||
-rw-r--r-- | src/corelib/tools/qvarlengtharray.h | 15 |
2 files changed, 13 insertions, 14 deletions
diff --git a/src/corelib/arch/qatomic_alpha.h b/src/corelib/arch/qatomic_alpha.h index 5d0b2b6..6989c25 100644 --- a/src/corelib/arch/qatomic_alpha.h +++ b/src/corelib/arch/qatomic_alpha.h @@ -367,7 +367,7 @@ Q_INLINE_TEMPLATE bool QBasicAtomicPointer<T>::testAndSetRelease(T *expectedValu template <typename T> Q_INLINE_TEMPLATE T *QBasicAtomicPointer<T>::fetchAndStoreRelaxed(T *newValue) { - register void *old, *tmp; + register T *old, *tmp; asm volatile("1:\n" "ldq_l %0,%2\n" /* old=*ptr; */ "mov %3,%1\n" /* tmp=newval; */ @@ -385,7 +385,7 @@ Q_INLINE_TEMPLATE T *QBasicAtomicPointer<T>::fetchAndStoreRelaxed(T *newValue) template <typename T> Q_INLINE_TEMPLATE T *QBasicAtomicPointer<T>::fetchAndStoreAcquire(T *newValue) { - register void *old, *tmp; + register T *old, *tmp; asm volatile("1:\n" "ldq_l %0,%2\n" /* old=*ptr; */ "mov %3,%1\n" /* tmp=newval; */ @@ -404,7 +404,7 @@ Q_INLINE_TEMPLATE T *QBasicAtomicPointer<T>::fetchAndStoreAcquire(T *newValue) template <typename T> Q_INLINE_TEMPLATE T *QBasicAtomicPointer<T>::fetchAndStoreRelease(T *newValue) { - register void *old, *tmp; + register T *old, *tmp; asm volatile("mb\n" "1:\n" "ldq_l %0,%2\n" /* old=*ptr; */ @@ -423,7 +423,7 @@ Q_INLINE_TEMPLATE T *QBasicAtomicPointer<T>::fetchAndStoreRelease(T *newValue) template <typename T> Q_INLINE_TEMPLATE T *QBasicAtomicPointer<T>::fetchAndAddRelaxed(qptrdiff valueToAdd) { - register void *old, *tmp; + register T *old, *tmp; asm volatile("1:\n" "ldq_l %0,%2\n" /* old=*ptr; */ "addq %0,%3,%1\n"/* tmp=old+value; */ @@ -441,7 +441,7 @@ Q_INLINE_TEMPLATE T *QBasicAtomicPointer<T>::fetchAndAddRelaxed(qptrdiff valueTo template <typename T> Q_INLINE_TEMPLATE T *QBasicAtomicPointer<T>::fetchAndAddAcquire(qptrdiff valueToAdd) { - register void *old, *tmp; + register T *old, *tmp; asm volatile("1:\n" "ldq_l %0,%2\n" /* old=*ptr; */ "addq %0,%3,%1\n"/* tmp=old+value; */ @@ -460,7 +460,7 @@ Q_INLINE_TEMPLATE T *QBasicAtomicPointer<T>::fetchAndAddAcquire(qptrdiff valueTo template <typename T> Q_INLINE_TEMPLATE T *QBasicAtomicPointer<T>::fetchAndAddRelease(qptrdiff valueToAdd) { - register void *old, *tmp; + register T *old, *tmp; asm volatile("mb\n" "1:\n" "ldq_l %0,%2\n" /* old=*ptr; */ diff --git a/src/corelib/tools/qvarlengtharray.h b/src/corelib/tools/qvarlengtharray.h index 9773d4b..bfede94 100644 --- a/src/corelib/tools/qvarlengtharray.h +++ b/src/corelib/tools/qvarlengtharray.h @@ -132,9 +132,9 @@ private: friend class QPodList<T, Prealloc>; void realloc(int size, int alloc); - int a; - int s; - T *ptr; + int a; // capacity + int s; // size + T *ptr; // data union { // ### Qt 5: Use 'Prealloc * sizeof(T)' as array size char array[sizeof(qint64) * (((Prealloc * sizeof(T)) / sizeof(qint64)) + 1)]; @@ -197,8 +197,8 @@ Q_OUTOFLINE_TEMPLATE void QVarLengthArray<T, Prealloc>::realloc(int asize, int a Q_ASSERT(aalloc >= asize); T *oldPtr = ptr; int osize = s; - // s = asize; + const int copySize = qMin(asize, osize); if (aalloc != a) { ptr = reinterpret_cast<T *>(qMalloc(aalloc * sizeof(T))); Q_CHECK_PTR(ptr); @@ -209,7 +209,6 @@ Q_OUTOFLINE_TEMPLATE void QVarLengthArray<T, Prealloc>::realloc(int asize, int a if (QTypeInfo<T>::isStatic) { QT_TRY { // copy all the old elements - const int copySize = qMin(asize, osize); while (s < copySize) { new (ptr+s) T(*(oldPtr+s)); (oldPtr+s)->~T(); @@ -225,19 +224,19 @@ Q_OUTOFLINE_TEMPLATE void QVarLengthArray<T, Prealloc>::realloc(int asize, int a QT_RETHROW; } } else { - qMemCopy(ptr, oldPtr, qMin(asize, osize) * sizeof(T)); + qMemCopy(ptr, oldPtr, copySize * sizeof(T)); } } else { ptr = oldPtr; return; } } + s = copySize; if (QTypeInfo<T>::isComplex) { + // destroy remaining old objects while (osize > asize) (oldPtr+(--osize))->~T(); - if (!QTypeInfo<T>::isStatic) - s = osize; } if (oldPtr != reinterpret_cast<T *>(array) && oldPtr != ptr) |