src/declarative/qml/qdeclarativeprivate.h
changeset 37 758a864f9613
parent 33 3e2da88830cd
--- a/src/declarative/qml/qdeclarativeprivate.h	Fri Sep 17 08:34:18 2010 +0300
+++ b/src/declarative/qml/qdeclarativeprivate.h	Mon Oct 04 01:19:32 2010 +0300
@@ -105,7 +105,7 @@
     template<class From, class To>
     struct StaticCastSelectorClass<From, To, sizeof(int)>
     {
-        static inline int cast() { return (int)((intptr_t)static_cast<To *>((From *)0x10000000)) - 0x10000000; }
+        static inline int cast() { return int(reinterpret_cast<intptr_t>(static_cast<To *>(reinterpret_cast<From *>(0x10000000)))) - 0x10000000; }
     };
 
     template<class From, class To>
@@ -119,7 +119,7 @@
 
         static inline int cast()
         {
-            return StaticCastSelectorClass<From, To, sizeof(check((From *)0))>::cast();
+            return StaticCastSelectorClass<From, To, sizeof(check(reinterpret_cast<From *>(0)))>::cast();
         }
     };
 
@@ -132,6 +132,7 @@
     template <typename T, bool hasMember>
     class has_attachedPropertiesMethod 
     {
+    public:
         typedef int yes_type;
         typedef char no_type;
 
@@ -139,7 +140,6 @@
         static yes_type check(ReturnType *(*)(QObject *));
         static no_type check(...);
 
-    public:
         static bool const value = sizeof(check(&T::qmlAttachedProperties)) == sizeof(yes_type);
     };