summaryrefslogtreecommitdiffstats
path: root/src/corelib
diff options
context:
space:
mode:
authorOlivier Goffart <ogoffart@trolltech.com>2009-05-14 14:50:17 (GMT)
committerOlivier Goffart <ogoffart@trolltech.com>2009-05-18 13:23:03 (GMT)
commit343e848abc19f15a30e73f53117a0c001b081e7f (patch)
tree4dac8ee3035944356060b371cfc09f18c76eb18b /src/corelib
parenta07385de15636e41de51d5d9df1faeb0c76a5537 (diff)
downloadQt-343e848abc19f15a30e73f53117a0c001b081e7f.zip
Qt-343e848abc19f15a30e73f53117a0c001b081e7f.tar.gz
Qt-343e848abc19f15a30e73f53117a0c001b081e7f.tar.bz2
Make QVectorTypedData inheriting from QVectorData
This way the content of QVectorData is not duplicated in the code. Reviewed-by: Thiago Reviewed-by: Brad
Diffstat (limited to 'src/corelib')
-rw-r--r--src/corelib/tools/qvector.h16
1 files changed, 3 insertions, 13 deletions
diff --git a/src/corelib/tools/qvector.h b/src/corelib/tools/qvector.h
index 8aa61ff..7bdcba0 100644
--- a/src/corelib/tools/qvector.h
+++ b/src/corelib/tools/qvector.h
@@ -82,19 +82,9 @@ struct Q_CORE_EXPORT QVectorData
};
template <typename T>
-struct QVectorTypedData
-{
- QBasicAtomicInt ref;
- int alloc;
- int size;
-#if defined(QT_ARCH_SPARC) && defined(Q_CC_GNU) && defined(__LP64__) && defined(QT_BOOTSTRAPPED)
- // workaround for bug in gcc 3.4.2
- uint sharable;
- uint capacity;
-#else
- uint sharable : 1;
- uint capacity : 1;
-#endif
+struct QVectorTypedData : private QVectorData
+{ // private inheritance as we must not access QVectorData member thought QVectorTypedData
+ // as this would break strict aliasing rules. (in the case of shared_null)
T array[1];
};