aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@digia.com>2013-12-13 09:42:24 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-01-03 17:09:17 +0100
commitaf87f45a98b5e2b405438f0164ec3a27b2343c2d (patch)
treea39baa40eaf4a3ece3990b0ecf9b3fef1326af54
parent40fd9ff0ffcf72fb1f27d011dfe07fea764fcff2 (diff)
Fix compiler warning about wrong reinterpret_cast
No need to use reinterpret_cast's in the type checking for the Managed casting. A static cast works just as well (as it's actually used two lines further down). Change-Id: Ie531098eddddda7e9f151eaedc136cbeab14f473 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
-rw-r--r--src/qml/jsruntime/qv4managed_p.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/qml/jsruntime/qv4managed_p.h b/src/qml/jsruntime/qv4managed_p.h
index afb6bb56d7..75621edeee 100644
--- a/src/qml/jsruntime/qv4managed_p.h
+++ b/src/qml/jsruntime/qv4managed_p.h
@@ -53,8 +53,8 @@ QT_BEGIN_NAMESPACE
namespace QV4 {
#define Q_MANAGED_CHECK \
- template <typename T> inline void qt_check_for_QMANAGED_macro(const T &_q_argument) const \
- { int i = qYouForgotTheQ_MANAGED_Macro(this, &_q_argument); i = i + 1; }
+ template <typename T> inline void qt_check_for_QMANAGED_macro(const T *_q_argument) const \
+ { int i = qYouForgotTheQ_MANAGED_Macro(this, _q_argument); i = i + 1; }
template <typename T>
inline int qYouForgotTheQ_MANAGED_Macro(T, T) { return 0; }
@@ -263,7 +263,7 @@ public:
if (!this || !internalClass)
return 0;
#if !defined(QT_NO_QOBJECT_CHECK)
- reinterpret_cast<T *>(this)->qt_check_for_QMANAGED_macro(*reinterpret_cast<T *>(this));
+ static_cast<T *>(this)->qt_check_for_QMANAGED_macro(static_cast<T *>(this));
#endif
return internalClass->vtable == &T::static_vtbl ? static_cast<T *>(this) : 0;
}
@@ -273,7 +273,7 @@ public:
if (!this)
return 0;
#if !defined(QT_NO_QOBJECT_CHECK)
- reinterpret_cast<T *>(this)->qt_check_for_QMANAGED_macro(*reinterpret_cast<T *>(const_cast<Managed *>(this)));
+ static_cast<T *>(this)->qt_check_for_QMANAGED_macro(static_cast<T *>(const_cast<Managed *>(this)));
#endif
return internalClass->vtable == &T::static_vtbl ? static_cast<const T *>(this) : 0;
}