Fix qHash-related size compatibility warnings by MSVC

Change-Id: I3b7981ce78b67db4b996f99682284a0b911d8cd7
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
Orgad Shaneh
2021-10-14 22:27:08 +03:00
committed by Orgad Shaneh
parent 11c73adbe0
commit 3871e40f43
58 changed files with 126 additions and 85 deletions

View File

@@ -38,6 +38,7 @@
#include <cplusplus/Control.h>
#include <utils/algorithm.h>
#include <utils/porting.h>
#include <QStack>
#include <QHash>
@@ -150,9 +151,9 @@ bool operator==(const FullyQualifiedName &left, const FullyQualifiedName &right)
return compareFullyQualifiedName(left.fqn, right.fqn);
}
uint qHash(const FullyQualifiedName &fullyQualifiedName)
Utils::QHashValueType qHash(const FullyQualifiedName &fullyQualifiedName)
{
uint h = 0;
Utils::QHashValueType h = 0;
for (int i = 0; i < fullyQualifiedName.fqn.size(); ++i) {
if (const Name *n = fullyQualifiedName.fqn.at(i)) {
if (const Identifier *id = n->identifier()) {

View File

@@ -33,10 +33,10 @@
using namespace CPlusPlus;
uint CPlusPlus::qHash(const LookupItem &key)
Utils::QHashValueType CPlusPlus::qHash(const LookupItem &key)
{
const uint h1 = QT_PREPEND_NAMESPACE(qHash)(key.type().type());
const uint h2 = QT_PREPEND_NAMESPACE(qHash)(key.scope());
const Utils::QHashValueType h1 = QT_PREPEND_NAMESPACE(qHash)(key.type().type());
const Utils::QHashValueType h2 = QT_PREPEND_NAMESPACE(qHash)(key.scope());
return ((h1 << 16) | (h1 >> 16)) ^ h2;
}

View File

@@ -26,6 +26,7 @@
#pragma once
#include <cplusplus/FullySpecifiedType.h>
#include <utils/porting.h>
#include <QHash>
@@ -70,6 +71,6 @@ private:
ClassOrNamespace *_binding;
};
uint qHash(const CPlusPlus::LookupItem &result);
Utils::QHashValueType qHash(const CPlusPlus::LookupItem &result);
} // namespace CPlusPlus