forked from qt-creator/qt-creator
Avoid size_t to (u)int warnings with auto, where it is possible
Change-Id: I1ec7454ebce59d99bc828bfd5086907eb0905632 Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
This commit is contained in:
@@ -92,7 +92,7 @@ struct ResponseHandler
|
||||
using ResponseHandlers = std::function<void(const MessageId &, const QByteArray &, QTextCodec *)>;
|
||||
using MethodHandler = std::function<void(const QString &, const MessageId &, const IContent *)>;
|
||||
|
||||
inline uint qHash(const LanguageServerProtocol::MessageId &id)
|
||||
inline auto qHash(const LanguageServerProtocol::MessageId &id)
|
||||
{
|
||||
if (Utils::holds_alternative<int>(id))
|
||||
return QT_PREPEND_NAMESPACE(qHash(Utils::get<int>(id)));
|
||||
|
@@ -55,7 +55,7 @@ private:
|
||||
QUuid m_uuid;
|
||||
};
|
||||
|
||||
inline uint qHash(const Uid &uid)
|
||||
inline auto qHash(const Uid &uid)
|
||||
{
|
||||
return qHash(uid.get());
|
||||
}
|
||||
|
@@ -151,15 +151,15 @@ private:
|
||||
QColor m_color;
|
||||
};
|
||||
|
||||
inline uint qHash(CustomRelation::Relationship relationship) {
|
||||
inline auto qHash(CustomRelation::Relationship relationship) {
|
||||
return ::qHash(static_cast<int>(relationship));
|
||||
}
|
||||
|
||||
inline uint qHash(CustomRelation::ShaftPattern pattern) {
|
||||
inline auto qHash(CustomRelation::ShaftPattern pattern) {
|
||||
return ::qHash(static_cast<int>(pattern));
|
||||
}
|
||||
|
||||
inline uint qHash(CustomRelation::Head head) {
|
||||
inline auto qHash(CustomRelation::Head head) {
|
||||
return ::qHash(static_cast<int>(head));
|
||||
}
|
||||
|
||||
|
@@ -77,7 +77,7 @@ bool operator==(const IconKey &lhs, const IconKey &rhs) {
|
||||
&& lhs.m_lineWidth == rhs.m_lineWidth;
|
||||
}
|
||||
|
||||
uint qHash(const IconKey &key) {
|
||||
auto qHash(const IconKey &key) {
|
||||
return ::qHash(key.m_element) + qHash(key.m_stereotypes) + qHash(key.m_defaultIconPath)
|
||||
+ qHash(key.m_styleUid) + ::qHash(key.m_size.width()) + ::qHash(key.m_size.height());
|
||||
}
|
||||
|
@@ -302,7 +302,7 @@ public:
|
||||
return datastream;
|
||||
}
|
||||
|
||||
friend uint qHash(const Utf8String &utf8String)
|
||||
friend auto qHash(const Utf8String &utf8String)
|
||||
{
|
||||
return qHash(utf8String.byteArray);
|
||||
}
|
||||
|
@@ -120,7 +120,7 @@ protected:
|
||||
QExplicitlySharedDataPointer<Internal::MimeTypePrivate> d;
|
||||
};
|
||||
|
||||
inline uint qHash(const MimeType &mime) { return qHash(mime.name()); }
|
||||
inline auto qHash(const MimeType &mime) { return qHash(mime.name()); }
|
||||
|
||||
} // Utils
|
||||
|
||||
|
@@ -75,7 +75,7 @@ enum class ResultType {
|
||||
LAST_TYPE = Invalid
|
||||
};
|
||||
|
||||
inline uint qHash(const ResultType &result)
|
||||
inline auto qHash(const ResultType &result)
|
||||
{
|
||||
return QT_PREPEND_NAMESPACE(qHash(int(result)));
|
||||
}
|
||||
|
@@ -46,7 +46,7 @@ public:
|
||||
inline const QString &name() const { return m_name; }
|
||||
inline const QString &type() const { return m_type; }
|
||||
inline int iconType() const { return m_iconType; }
|
||||
inline uint hash() const { return m_hash; }
|
||||
inline auto hash() const { return m_hash; }
|
||||
inline bool operator==(const SymbolInformation &other) const
|
||||
{
|
||||
return hash() == other.hash() && iconType() == other.iconType() && name() == other.name()
|
||||
@@ -64,7 +64,7 @@ private:
|
||||
};
|
||||
|
||||
//! qHash overload for QHash/QSet
|
||||
inline uint qHash(const SymbolInformation &information)
|
||||
inline auto qHash(const SymbolInformation &information)
|
||||
{
|
||||
return information.hash();
|
||||
}
|
||||
|
@@ -55,7 +55,7 @@ public:
|
||||
};
|
||||
|
||||
|
||||
inline uint qHash(SearchResultColor::Style style)
|
||||
inline auto qHash(SearchResultColor::Style style)
|
||||
{
|
||||
return QT_PREPEND_NAMESPACE(qHash(int(style)));
|
||||
}
|
||||
|
@@ -223,9 +223,9 @@ using SubBreakpoints = const QList<SubBreakpoint>;
|
||||
using BreakHandlerModel = Utils::TreeModel<Utils::TypedTreeItem<BreakpointItem>, BreakpointItem, SubBreakpointItem>;
|
||||
using BreakpointManagerModel = Utils::TreeModel<Utils::TypedTreeItem<GlobalBreakpointItem>, GlobalBreakpointItem>;
|
||||
|
||||
inline uint qHash(const Debugger::Internal::SubBreakpoint &b) { return qHash(b.data()); }
|
||||
inline uint qHash(const Debugger::Internal::Breakpoint &b) { return qHash(b.data()); }
|
||||
inline uint qHash(const Debugger::Internal::GlobalBreakpoint &b) { return qHash(b.data()); }
|
||||
inline auto qHash(const Debugger::Internal::SubBreakpoint &b) { return qHash(b.data()); }
|
||||
inline auto qHash(const Debugger::Internal::Breakpoint &b) { return qHash(b.data()); }
|
||||
inline auto qHash(const Debugger::Internal::GlobalBreakpoint &b) { return qHash(b.data()); }
|
||||
|
||||
class BreakHandler : public BreakHandlerModel
|
||||
{
|
||||
|
@@ -193,7 +193,7 @@ private:
|
||||
QString m_param;
|
||||
};
|
||||
|
||||
inline int qHash(const ProjectExplorer::Abi &abi)
|
||||
inline auto qHash(const ProjectExplorer::Abi &abi)
|
||||
{
|
||||
int h = abi.architecture()
|
||||
+ (abi.os() << 3)
|
||||
|
@@ -70,7 +70,7 @@ inline bool operator!=(const BuildTargetInfo &ti1, const BuildTargetInfo &ti2)
|
||||
return !(ti1 == ti2);
|
||||
}
|
||||
|
||||
inline uint qHash(const BuildTargetInfo &ti)
|
||||
inline auto qHash(const BuildTargetInfo &ti)
|
||||
{
|
||||
return qHash(ti.displayName) ^ qHash(ti.buildKey);
|
||||
}
|
||||
|
@@ -59,7 +59,7 @@ public:
|
||||
HeaderPathType type = HeaderPathType::User;
|
||||
};
|
||||
|
||||
inline uint qHash(const HeaderPath &key, uint seed = 0)
|
||||
inline auto qHash(const HeaderPath &key, uint seed = 0)
|
||||
{
|
||||
return ((qHash(key.path) << 2) | uint(key.type)) ^ seed;
|
||||
}
|
||||
|
@@ -85,7 +85,7 @@ private:
|
||||
};
|
||||
|
||||
inline
|
||||
uint qHash(const Macro ¯o)
|
||||
auto qHash(const Macro ¯o)
|
||||
{
|
||||
using QT_PREPEND_NAMESPACE(qHash);
|
||||
return qHash(macro.key) ^ qHash(macro.value) ^ qHash(int(macro.type));
|
||||
|
@@ -76,7 +76,7 @@ inline bool operator!=(const QmlEventLocation &location1, const QmlEventLocation
|
||||
return !(location1 == location2);
|
||||
}
|
||||
|
||||
inline uint qHash(const QmlEventLocation &location)
|
||||
inline auto qHash(const QmlEventLocation &location)
|
||||
{
|
||||
return qHash(location.filename())
|
||||
^ ((location.line() & 0xfff) // 12 bits of line number
|
||||
|
Reference in New Issue
Block a user