From 470716d0d0e06e4032f469f7c4c629a3d2a3b133 Mon Sep 17 00:00:00 2001 From: jasplin Date: Thu, 4 Jun 2009 10:44:06 +0200 Subject: 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 --- src/corelib/kernel/qvariant_p.h | 20 ++++++++++---------- 1 file 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 -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); + x->data.shared = copy ? new QVariantPrivateSharedEx(*static_cast(copy)) + : new QVariantPrivateSharedEx; x->is_shared = true; } else { - new (&x->data.ptr) T(t); + if (copy) + new (&x->data.ptr) T(*static_cast(copy)); + else + new (&x->data.ptr) T; } } template -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(*static_cast(copy)) - : new QVariantPrivateSharedEx; + x->data.shared = new QVariantPrivateSharedEx(t); x->is_shared = true; } else { - if (copy) - new (&x->data.ptr) T(*static_cast(copy)); - else - new (&x->data.ptr) T; + new (&x->data.ptr) T(t); } } -- cgit v0.12