summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools/qvector.h
diff options
context:
space:
mode:
authorOlivier Goffart <ogoffart@trolltech.com>2009-05-14 16:50:17 +0200
committerOlivier Goffart <ogoffart@trolltech.com>2009-05-18 15:23:03 +0200
commit343e848abc19f15a30e73f53117a0c001b081e7f (patch)
tree4dac8ee3035944356060b371cfc09f18c76eb18b /src/corelib/tools/qvector.h
parenta07385de15636e41de51d5d9df1faeb0c76a5537 (diff)
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/tools/qvector.h')
-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 8aa61ffd1b..7bdcba0e96 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];
};