diff options
author | Miikka Heikkinen <miikka.heikkinen@qt.io> | 2019-06-04 11:48:46 +0300 |
---|---|---|
committer | Miikka Heikkinen <miikka.heikkinen@qt.io> | 2019-06-04 11:48:46 +0300 |
commit | 0cc10ec7d2c15f8c7ce531bee23ad9ca7e0557cc (patch) | |
tree | 4884e793cbe5d9870d84196c1e4a9882be68697c | |
parent | 7a269685bdd72f075deb9a4262cbfb8fda0ce631 (diff) |
Fix compile warnings
Change-Id: I1f5264b7e5395d5b27c0bfc3a52fc4c4bc0b04d0
Reviewed-by: Antti Määttä <antti.maatta@qt.io>
Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
-rw-r--r-- | src/Runtime/ogl-runtime/src/foundation/StringTable.h | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/Runtime/ogl-runtime/src/foundation/StringTable.h b/src/Runtime/ogl-runtime/src/foundation/StringTable.h index aa57857a..d46c111f 100644 --- a/src/Runtime/ogl-runtime/src/foundation/StringTable.h +++ b/src/Runtime/ogl-runtime/src/foundation/StringTable.h @@ -50,6 +50,7 @@ #include "foundation/Qt3DSOption.h" #include <QtCore/qstring.h> +#include <QtCore/qhashfunctions.h> namespace qt3ds { namespace foundation { @@ -73,7 +74,7 @@ namespace foundation { public: CStrTableOrDataRef() - : m_StrTable(NULL) + : m_StrTable(nullptr) { } CStrTableOrDataRef(NVDataRef<QT3DSU8> inData) @@ -95,7 +96,7 @@ namespace foundation { m_StrTable = inOther.m_StrTable; return *this; } - bool HasStrTable() const { return m_StrTable != NULL; } + bool HasStrTable() const { return m_StrTable != nullptr; } bool HasDataRef() const { return m_DataRef.hasValue(); } NVDataRef<QT3DSU8> GetDataRef() const { return *m_DataRef; } IStringTable *GetStringTable() const @@ -180,7 +181,10 @@ namespace foundation { inline uint qHash(const CRegisteredString &rString) { - return eastl::hash<uint>()(reinterpret_cast<size_t>(rString.c_str())); + // Note that we are intentionally hashing a pointer to the string rather than its content, + // as CRegisteredString strings reside in the string table, which guarantees two instances + // with same string point to same string table string. + return QT_PREPEND_NAMESPACE(qHash(rString.c_str())); } class IStringTable; |