From 2bf186a2e598a4bccdc4979085e8e4d963a3819d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Abecasis?= Date: Wed, 25 Jan 2012 17:40:24 +0100 Subject: Allow function types to be registered without workarounds MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Commit 4b8ceb41aed352f10d36db5284453f425dbc5f3f added the requirement that pointed-to types need to be registered when registering pointer types. Unfortunately, the implementation also affects function pointer types. This change whitelists 0, 1, 2 and 3 argument functions as not deriving from QObject, forgoing the need to workaround details of the type registration implementation when registering those function pointer types. Change-Id: I4d855e9d70a8179a6e31b84623ad5bf063e0d6d8 Reviewed-by: Jędrzej Nowacki Reviewed-by: Olivier Goffart Reviewed-by: Stephen Kelly --- tests/benchmarks/corelib/tools/qstring/main.cpp | 15 --------------- 1 file changed, 15 deletions(-) (limited to 'tests/benchmarks/corelib/tools') diff --git a/tests/benchmarks/corelib/tools/qstring/main.cpp b/tests/benchmarks/corelib/tools/qstring/main.cpp index ca72a9b013..9d5c43c290 100644 --- a/tests/benchmarks/corelib/tools/qstring/main.cpp +++ b/tests/benchmarks/corelib/tools/qstring/main.cpp @@ -1298,11 +1298,6 @@ static int ucstrncmp_ssse3_aligning2(const ushort *a, const ushort *b, int len) #endif typedef int (* UcstrncmpFunction)(const ushort *, const ushort *, int); -QT_BEGIN_NAMESPACE namespace QtPrivate { -template <> struct IsPointerToTypeDerivedFromQObject { - enum { Value = false }; -}; -} QT_END_NAMESPACE Q_DECLARE_METATYPE(UcstrncmpFunction) void tst_QString::ucstrncmp_data() const @@ -1462,11 +1457,6 @@ void tst_QString::fromLatin1() const } typedef void (* FromLatin1Function)(ushort *, const char *, int); -QT_BEGIN_NAMESPACE namespace QtPrivate { -template <> struct IsPointerToTypeDerivedFromQObject { - enum { Value = false }; -}; -} QT_END_NAMESPACE Q_DECLARE_METATYPE(FromLatin1Function) void fromLatin1_regular(ushort *dst, const char *str, int size) @@ -1917,11 +1907,6 @@ void tst_QString::fromLatin1Alternatives() const } typedef int (* FromUtf8Function)(ushort *, const char *, int); -QT_BEGIN_NAMESPACE namespace QtPrivate { -template <> struct IsPointerToTypeDerivedFromQObject { - enum { Value = false }; -}; -} QT_END_NAMESPACE Q_DECLARE_METATYPE(FromUtf8Function) extern QTextCodec::ConverterState *state; -- cgit v1.2.3