From 23e89956c184caaa3789be9ac52f85c30d830d34 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Wed, 11 Sep 2013 22:46:09 -0700 Subject: [PATCH] Fix new warnings under Clang 3.3 Probably added by a1898f4466518bf3e1b6e9154eec05ecf9d909e3. qmetatype.h:70:29: error: inline function 'qMetaTypeId' is not defined [-Werror,-Wundefined-inline] qmetatype.h:1363:30: note: used here const int toId = qMetaTypeId(); qmetatype.h:70:29: error: inline function 'qMetaTypeId' is not defined [-Werror,-Wundefined-inline] qmetatype.h:1386:30: note: used here const int toId = qMetaTypeId(); Change-Id: I9afe1a3d50ab23eb701797e28b259966dc95a147 Reviewed-by: Stephen Kelly --- src/corelib/kernel/qmetatype.h | 70 +++++++++++++++++----------------- 1 file changed, 36 insertions(+), 34 deletions(-) diff --git a/src/corelib/kernel/qmetatype.h b/src/corelib/kernel/qmetatype.h index 2d9133dbae..0c8f273887 100644 --- a/src/corelib/kernel/qmetatype.h +++ b/src/corelib/kernel/qmetatype.h @@ -1358,23 +1358,6 @@ namespace QtPrivate } }; - template - struct ValueTypeIsMetaType - { - static bool registerConverter(int id) - { - const int toId = qMetaTypeId(); - if (!QMetaType::hasRegisteredConverterFunction(id, toId)) { - static const QtMetaTypePrivate::QSequentialIterableConvertFunctor o; - static const QtPrivate::ConverterFunctor > f(o); - return QMetaType::registerConverterFunction(&f, id, toId); - } - return true; - } - }; - template struct SequentialContainerConverterHelper : ValueTypeIsMetaType { @@ -1398,23 +1381,6 @@ namespace QtPrivate } }; - template - struct AssociativeValueTypeIsMetaType - { - static bool registerConverter(int id) - { - const int toId = qMetaTypeId(); - if (!QMetaType::hasRegisteredConverterFunction(id, toId)) { - static const QtMetaTypePrivate::QAssociativeIterableConvertFunctor o; - static const QtPrivate::ConverterFunctor > f(o); - return QMetaType::registerConverterFunction(&f, id, toId); - } - return true; - } - }; - template::Defined> struct KeyAndValueTypeIsMetaType { @@ -2057,6 +2023,42 @@ inline bool QtPrivate::IsMetaTypePair::registerConverter(int id) return true; } +namespace QtPrivate { + template + struct ValueTypeIsMetaType + { + static bool registerConverter(int id) + { + const int toId = qMetaTypeId(); + if (!QMetaType::hasRegisteredConverterFunction(id, toId)) { + static const QtMetaTypePrivate::QSequentialIterableConvertFunctor o; + static const QtPrivate::ConverterFunctor > f(o); + return QMetaType::registerConverterFunction(&f, id, toId); + } + return true; + } + }; + + template + struct AssociativeValueTypeIsMetaType + { + static bool registerConverter(int id) + { + const int toId = qMetaTypeId(); + if (!QMetaType::hasRegisteredConverterFunction(id, toId)) { + static const QtMetaTypePrivate::QAssociativeIterableConvertFunctor o; + static const QtPrivate::ConverterFunctor > f(o); + return QMetaType::registerConverterFunction(&f, id, toId); + } + return true; + } + }; +} + QT_END_NAMESPACE #endif // QMETATYPE_H