summaryrefslogtreecommitdiffstats
path: root/src/corelib
diff options
context:
space:
mode:
authorHarald Fernengel <harald@trolltech.com>2009-06-26 11:35:16 +0200
committerJason Barron <jbarron@trolltech.com>2009-06-29 14:07:00 +0200
commitf1d3ed3a4adc2f1859102afb03b5c794d569940c (patch)
treea27602762705501c80fe689aac23c376612aa77e /src/corelib
parentdb8f05e257019694f5e8076845626008f2adc3dd (diff)
Manually fix bad merges and make sure everything compiles with 4.6.
Diffstat (limited to 'src/corelib')
-rw-r--r--src/corelib/statemachine/qstatemachine.cpp2
-rw-r--r--src/corelib/thread/qthread_p.h15
-rw-r--r--src/corelib/tools/qvector.h20
3 files changed, 26 insertions, 11 deletions
diff --git a/src/corelib/statemachine/qstatemachine.cpp b/src/corelib/statemachine/qstatemachine.cpp
index 64b33ace8c..31aeaea364 100644
--- a/src/corelib/statemachine/qstatemachine.cpp
+++ b/src/corelib/statemachine/qstatemachine.cpp
@@ -2074,7 +2074,7 @@ int QSignalEventGenerator::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
switch (_id) {
case 0: {
// ### in Qt 4.6 we can use QObject::senderSignalIndex()
- QObjectPrivate *d = static_cast<QObjectPrivate *>(d_ptr);
+ QObjectPrivate *d = static_cast<QObjectPrivate *>(d_ptr.data());
int signalIndex = -1;
QObject *sender = this->sender();
if (sender && d->currentSender)
diff --git a/src/corelib/thread/qthread_p.h b/src/corelib/thread/qthread_p.h
index c57500553b..0735746b9f 100644
--- a/src/corelib/thread/qthread_p.h
+++ b/src/corelib/thread/qthread_p.h
@@ -211,6 +211,21 @@ public:
# endif
};
+// thread wrapper for the main() thread
+class QAdoptedThread : public QThread
+{
+ Q_DECLARE_PRIVATE(QThread)
+
+public:
+ QAdoptedThread(QThreadData *data = 0);
+ ~QAdoptedThread();
+ void init();
+
+ static QThread *createThreadForAdoption();
+private:
+ void run();
+};
+
QT_END_NAMESPACE
#endif // QTHREAD_P_H
diff --git a/src/corelib/tools/qvector.h b/src/corelib/tools/qvector.h
index d9fad3aa28..c83e833562 100644
--- a/src/corelib/tools/qvector.h
+++ b/src/corelib/tools/qvector.h
@@ -436,8 +436,8 @@ void QVector<T>::realloc(int asize, int aalloc)
if (QTypeInfo<T>::isComplex && asize < d->size && d->ref == 1 ) {
// call the destructor on all objects that need to be
// destroyed when shrinking
- pOld = d->array + d->size;
- pNew = d->array + asize;
+ pOld = p->array + d->size;
+ pNew = p->array + asize;
while (asize < d->size) {
(--pOld)->~T();
d->size--;
@@ -447,23 +447,23 @@ void QVector<T>::realloc(int asize, int aalloc)
if (aalloc != d->alloc || d->ref != 1) {
// (re)allocate memory
if (QTypeInfo<T>::isStatic) {
- x.p = malloc(aalloc);
+ x.d = malloc(aalloc);
Q_CHECK_PTR(x.p);
x.d->size = 0;
} else if (d->ref != 1) {
- x.p = malloc(aalloc);
+ x.d = malloc(aalloc);
Q_CHECK_PTR(x.p);
if (QTypeInfo<T>::isComplex) {
x.d->size = 0;
} else {
- ::memcpy(x.p, p, sizeOfTypedData() + (qMin(aalloc, p->alloc) - 1) * sizeof(T));
+ ::memcpy(x.p, p, sizeOfTypedData() + (qMin(aalloc, d->alloc) - 1) * sizeof(T));
x.d->size = d->size;
}
} else {
QT_TRY {
QVectorData *mem = static_cast<QVectorData *>(qRealloc(p, sizeOfTypedData() + (aalloc - 1) * sizeof(T)));
Q_CHECK_PTR(mem);
- x.p = p = mem;
+ x.d = d = mem;
x.d->size = d->size;
} QT_CATCH (const std::bad_alloc &) {
if (aalloc > d->alloc) // ignore the error in case we are just shrinking.
@@ -478,8 +478,8 @@ void QVector<T>::realloc(int asize, int aalloc)
if (QTypeInfo<T>::isComplex) {
QT_TRY {
- pOld = d->array + x.d->size;
- pNew = x.d->array + x.d->size;
+ pOld = p->array + x.d->size;
+ pNew = x.p->array + x.d->size;
// copy objects from the old array into the new array
while (x.d->size < qMin(asize, d->size)) {
new (pNew++) T(*pOld++);
@@ -491,13 +491,13 @@ void QVector<T>::realloc(int asize, int aalloc)
x.d->size++;
}
} QT_CATCH (...) {
- free(x.d);
+ free(x.p);
QT_RETHROW;
}
} else if (asize > x.d->size) {
// initialize newly allocated memory to 0
- qMemSet(x.d->array + x.d->size, 0, (asize - x.d->size) * sizeof(T));
+ qMemSet(x.p->array + x.d->size, 0, (asize - x.d->size) * sizeof(T));
}
x.d->size = asize;