Metatype: Silence MSVC warnings about unused variables.

Turn around if's.

Change-Id: Ica6f7f54098a567816ce3918f6fe5d8d2c072e01
Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
This commit is contained in:
Friedemann Kleint 2011-10-19 15:51:34 +02:00 committed by Qt by Nokia
parent 6c4aa14ecc
commit 0b6d4a2d65

View File

@ -152,24 +152,24 @@ void qMetaTypeDeleteHelper(T *t)
template <typename T>
void *qMetaTypeCreateHelper(const T *t)
{
if (!t)
return new T();
return new T(*static_cast<const T*>(t));
if (t)
return new T(*static_cast<const T*>(t));
return new T();
}
template <typename T>
void qMetaTypeDestructHelper(T *t)
{
Q_UNUSED(t) // Silence MSVC that warns for POD types.
t->~T();
}
template <typename T>
void *qMetaTypeConstructHelper(void *where, const T *t)
{
if (!t)
return new (where) T;
else
if (t)
return new (where) T(*static_cast<const T*>(t));
return new (where) T;
}
#ifndef QT_NO_DATASTREAM