summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjasplin <qt-info@nokia.com>2009-06-04 08:44:06 (GMT)
committerjasplin <qt-info@nokia.com>2009-06-04 08:47:17 (GMT)
commit470716d0d0e06e4032f469f7c4c629a3d2a3b133 (patch)
treeaa4d75c368e2a40aba4f9676a524469856d96a4a
parentc116ffaa7abb26373475921db7410503a79b4207 (diff)
downloadQt-470716d0d0e06e4032f469f7c4c629a3d2a3b133.zip
Qt-470716d0d0e06e4032f469f7c4c629a3d2a3b133.tar.gz
Qt-470716d0d0e06e4032f469f7c4c629a3d2a3b133.tar.bz2
Fixed build error with Sun CC 5.5..
Note that the fix is simply to swap the order of the two v_construct() overloads. Sun CC 5.5 requires the version with the default argument to occur first. Reviewed-by: TrustMe
-rw-r--r--src/corelib/kernel/qvariant_p.h20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/corelib/kernel/qvariant_p.h b/src/corelib/kernel/qvariant_p.h
index 033b760..02b507e 100644
--- a/src/corelib/kernel/qvariant_p.h
+++ b/src/corelib/kernel/qvariant_p.h
@@ -105,28 +105,28 @@ private:
// constructs a new variant if copy is 0, otherwise copy-constructs
template <class T>
-inline void v_construct(QVariant::Private *x, const T &t)
+inline void v_construct(QVariant::Private *x, const void *copy, T * = 0)
{
if (sizeof(T) > sizeof(QVariant::Private::Data)) {
- x->data.shared = new QVariantPrivateSharedEx<T>(t);
+ x->data.shared = copy ? new QVariantPrivateSharedEx<T>(*static_cast<const T *>(copy))
+ : new QVariantPrivateSharedEx<T>;
x->is_shared = true;
} else {
- new (&x->data.ptr) T(t);
+ if (copy)
+ new (&x->data.ptr) T(*static_cast<const T *>(copy));
+ else
+ new (&x->data.ptr) T;
}
}
template <class T>
-inline void v_construct(QVariant::Private *x, const void *copy, T * = 0)
+inline void v_construct(QVariant::Private *x, const T &t)
{
if (sizeof(T) > sizeof(QVariant::Private::Data)) {
- x->data.shared = copy ? new QVariantPrivateSharedEx<T>(*static_cast<const T *>(copy))
- : new QVariantPrivateSharedEx<T>;
+ x->data.shared = new QVariantPrivateSharedEx<T>(t);
x->is_shared = true;
} else {
- if (copy)
- new (&x->data.ptr) T(*static_cast<const T *>(copy));
- else
- new (&x->data.ptr) T;
+ new (&x->data.ptr) T(t);
}
}