Fix Clang warnings

This commit is contained in:
Mat Sutcliffe
2020-11-03 22:52:38 +00:00
parent 49611b7f44
commit f461f60635
11 changed files with 33 additions and 33 deletions

View File

@@ -166,7 +166,7 @@ namespace BlackMisc
CUpdateInfo result;
result.m_distributions = { alphaDistribution, betaDistribution };
for (const QJsonValue &release : QJsonDocument::fromJson(jsonData).array())
for (const QJsonValue release : QJsonDocument::fromJson(jsonData).array())
{
QString version = release[QLatin1String("tag_name")].toString();
if (version.isEmpty() || version[0] != 'v') { continue; }
@@ -176,7 +176,7 @@ namespace BlackMisc
bool existing = !release[QLatin1String("draft")].toBool();
bool alpha = release[QLatin1String("prerelease")].toBool();
for (const QJsonValue &asset : release[QLatin1String("assets")].toArray())
for (const QJsonValue asset : release[QLatin1String("assets")].toArray())
{
QString name = asset[QLatin1String("name")].toString();
QString filename = QStringLiteral("v%1/%2").arg(version, name);

View File

@@ -64,7 +64,7 @@ namespace BlackMisc
{
if (client != this) { channels.unite(client->m_subscriptions.keys().toSet()); }
}
for (const auto channel : channels)
for (const auto &channel : channels)
{
requestPeerSubscriptions(channel);
}

View File

@@ -222,7 +222,7 @@ namespace BlackMisc
{
QString result;
// QChar c (NOT QChar &c), see https://discordapp.com/channels/539048679160676382/539925070550794240/686321311076581440
for (const QChar c : s)
for (const QChar &c : s)
{
if (c.decompositionTag() == QChar::NoDecomposition)
{
@@ -230,7 +230,7 @@ namespace BlackMisc
}
else
{
for (const QChar dc : c.decomposition())
for (const QChar &dc : c.decomposition())
{
if (!dc.isMark()) { result.push_back(dc); }
}

View File

@@ -173,7 +173,7 @@ namespace BlackMisc
//! Properties by index
enum ColumnIndex
{
IndexOffsetMs = CPropertyIndexRef::GlobalIndexITimestampBased + ITimestampBased::IndexMSecsSinceEpoch + 1,
IndexOffsetMs = static_cast<int>(CPropertyIndexRef::GlobalIndexITimestampBased) + ITimestampBased::IndexMSecsSinceEpoch + 1,
IndexAdjustedMsWithOffset,
IndexOffsetWithUnit // keep this as last item
};