Hide QVariant helper classes in a namespace.
authorJędrzej Nowacki <jedrzej.nowacki@nokia.com>
Tue, 15 Nov 2011 12:49:52 +0000 (13:49 +0100)
committerQt by Nokia <qt-info@nokia.com>
Tue, 15 Nov 2011 17:33:58 +0000 (18:33 +0100)
Moving these classes to an unnamed namespace reduced chances of
a name conflict and size of executable. GCC 4.6 in release mode produces
a 5kB smaller binary.

Change-Id: Ie1819a88180f9db1cd32cc59ea6fe268ecbd5813
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
src/corelib/kernel/qvariant.cpp
src/gui/kernel/qguivariant.cpp

index 894ebcb..0afeaa0 100644 (file)
@@ -73,6 +73,7 @@ QT_BEGIN_NAMESPACE
 #  define FLT_DIG 6
 #endif
 
+namespace {
 template<typename T>
 struct TypeDefiniton {
     static const bool IsAvailable = true;
@@ -99,6 +100,7 @@ struct CoreTypesFilter {
         static const bool IsAccepted = QTypeModuleInfo<T>::IsCore && TypeDefiniton<T>::IsAvailable;
     };
 };
+} // namspace
 
 static void construct(QVariant::Private *x, const void *copy)
 {
index 78d431f..f0baf70 100644 (file)
@@ -98,6 +98,7 @@ Q_GUI_EXPORT const QVariant::Handler *qt_widgets_variant_handler = 0;
 
 Q_CORE_EXPORT const QVariant::Handler *qcoreVariantHandler();
 
+namespace {
 template<typename T>
 struct TypeDefiniton {
     static const bool IsAvailable = true;
@@ -141,6 +142,7 @@ struct CoreAndGuiTypesFilter {
         static const bool IsAccepted = (QTypeModuleInfo<T>::IsCore || QTypeModuleInfo<T>::IsGui) && TypeDefiniton<T>::IsAvailable;
     };
 };
+} // namespace
 
 static void construct(QVariant::Private *x, const void *copy)
 {