diff options
author | Olivier Goffart <olivier.goffart@nokia.com> | 2011-01-19 15:19:51 (GMT) |
---|---|---|
committer | Olivier Goffart <olivier.goffart@nokia.com> | 2011-01-28 09:52:28 (GMT) |
commit | 5e3c4b6a82df640c15778af72384c6b27f8860b7 (patch) | |
tree | 838ea541ecb389c202c2f02e66101a402e4c2729 /src/corelib | |
parent | b65e84ab1c242116d8559aea99e46e44cefb0c1a (diff) | |
download | Qt-5e3c4b6a82df640c15778af72384c6b27f8860b7.zip Qt-5e3c4b6a82df640c15778af72384c6b27f8860b7.tar.gz Qt-5e3c4b6a82df640c15778af72384c6b27f8860b7.tar.bz2 |
Fix warning in sun compiler
Warning, nullref: Initializing const myClass& to a NULL value.
Patch inspired by the one in QTBUG-16755
Task-number: QTBUG-16755
Diffstat (limited to 'src/corelib')
-rw-r--r-- | src/corelib/kernel/qobject.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/corelib/kernel/qobject.h b/src/corelib/kernel/qobject.h index 63fdf76..bd3ef3c 100644 --- a/src/corelib/kernel/qobject.h +++ b/src/corelib/kernel/qobject.h @@ -370,18 +370,18 @@ template <class T> inline T qobject_cast(QObject *object) { #if !defined(QT_NO_QOBJECT_CHECK) - reinterpret_cast<T>(0)->qt_check_for_QOBJECT_macro(*reinterpret_cast<T>(object)); + reinterpret_cast<T>(object)->qt_check_for_QOBJECT_macro(*reinterpret_cast<T>(object)); #endif - return static_cast<T>(reinterpret_cast<T>(0)->staticMetaObject.cast(object)); + return static_cast<T>(reinterpret_cast<T>(object)->staticMetaObject.cast(object)); } template <class T> inline T qobject_cast(const QObject *object) { #if !defined(QT_NO_QOBJECT_CHECK) - reinterpret_cast<T>(0)->qt_check_for_QOBJECT_macro(*reinterpret_cast<T>(const_cast<QObject *>(object))); + reinterpret_cast<T>(object)->qt_check_for_QOBJECT_macro(*reinterpret_cast<T>(const_cast<QObject *>(object))); #endif - return static_cast<T>(reinterpret_cast<T>(0)->staticMetaObject.cast(object)); + return static_cast<T>(reinterpret_cast<T>(object)->staticMetaObject.cast(object)); } |