src/corelib/kernel/qvariant.cpp
changeset 7 f7bc934e204c
parent 0 1918ee327afb
equal deleted inserted replaced
3:41300fa6a67c 7:f7bc934e204c
     1 /****************************************************************************
     1 /****************************************************************************
     2 **
     2 **
     3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
     3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     4 ** All rights reserved.
     4 ** All rights reserved.
     5 ** Contact: Nokia Corporation (qt-info@nokia.com)
     5 ** Contact: Nokia Corporation (qt-info@nokia.com)
     6 **
     6 **
     7 ** This file is part of the QtCore module of the Qt Toolkit.
     7 ** This file is part of the QtCore module of the Qt Toolkit.
     8 **
     8 **
   464 
   464 
   465     /* The reason we cannot place this test in a case branch above for the types
   465     /* The reason we cannot place this test in a case branch above for the types
   466      * QMetaType::VoidStar, QMetaType::QObjectStar and so forth, is that it wouldn't include
   466      * QMetaType::VoidStar, QMetaType::QObjectStar and so forth, is that it wouldn't include
   467      * user defined pointer types. */
   467      * user defined pointer types. */
   468     const char *const typeName = QMetaType::typeName(a->type);
   468     const char *const typeName = QMetaType::typeName(a->type);
   469     if (typeName[qstrlen(typeName) - 1] == '*')
   469     uint typeNameLen = qstrlen(typeName);
       
   470     if (typeNameLen > 0 && typeName[typeNameLen - 1] == '*')
   470         return *static_cast<void *const *>(a_ptr) == *static_cast<void *const *>(b_ptr);
   471         return *static_cast<void *const *>(a_ptr) == *static_cast<void *const *>(b_ptr);
       
   472 
       
   473     if (a->is_null && b->is_null)
       
   474         return true;
   471 
   475 
   472     return a_ptr == b_ptr;
   476     return a_ptr == b_ptr;
   473 }
   477 }
   474 
   478 
   475 /*!
   479 /*!