From 343e848abc19f15a30e73f53117a0c001b081e7f Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Thu, 14 May 2009 16:50:17 +0200 Subject: Make QVectorTypedData inheriting from QVectorData This way the content of QVectorData is not duplicated in the code. Reviewed-by: Thiago Reviewed-by: Brad --- src/corelib/tools/qvector.h | 16 +++------------- 1 file 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 -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]; }; -- cgit v0.12