Commit 52574da0 authored by Orgad Shaneh's avatar Orgad Shaneh Committed by Orgad Shaneh
Browse files

QmlDebug/QmlProfiler: Fix MSVC warnings



qmlprofilertraceclient.cpp:280: warning: C4334: '<<' : result of 32-bit
shift implicitly converted to 64 bits (was 64-bit shift intended?)

qmlprofilertool.cpp:539: warning: C4554: '<<' : check operator
precedence for possible error; use parentheses to clarify precedence

Change-Id: Ifaa048d42bccf203e6587a474c197c22b0f69fec
Reviewed-by: default avatarUlf Hermann <ulf.hermann@digia.com>
parent 7aed3d3d
......@@ -277,7 +277,7 @@ void QmlProfilerTraceClient::messageReceived(const QByteArray &data)
break;
}
case RangeStart: {
if (!(d->features & (1 << featureFromRangeType(static_cast<RangeType>(subtype)))))
if (!(d->features & (1ULL << featureFromRangeType(static_cast<RangeType>(subtype)))))
break;
d->rangeStartTimes[subtype].push(time);
d->inProgressRanges |= (static_cast<qint64>(1) << subtype);
......@@ -293,7 +293,7 @@ void QmlProfilerTraceClient::messageReceived(const QByteArray &data)
break;
}
case RangeData: {
if (!(d->features & (1 << featureFromRangeType(static_cast<RangeType>(subtype)))))
if (!(d->features & (1ULL << featureFromRangeType(static_cast<RangeType>(subtype)))))
break;
QString data;
stream >> data;
......@@ -307,7 +307,7 @@ void QmlProfilerTraceClient::messageReceived(const QByteArray &data)
break;
}
case RangeLocation: {
if (!(d->features & (1 << featureFromRangeType(static_cast<RangeType>(subtype)))))
if (!(d->features & (1ULL << featureFromRangeType(static_cast<RangeType>(subtype)))))
break;
QString fileName;
int line;
......@@ -322,7 +322,7 @@ void QmlProfilerTraceClient::messageReceived(const QByteArray &data)
break;
}
case RangeEnd: {
if (!(d->features & (1 << featureFromRangeType(static_cast<RangeType>(subtype)))))
if (!(d->features & (1ULL << featureFromRangeType(static_cast<RangeType>(subtype)))))
break;
if (d->rangeCount[subtype] == 0)
break;
......
......@@ -69,7 +69,7 @@ RangeTimelineModel::RangeTimelineModel(QmlDebug::RangeType rangeType, QObject *p
quint64 RangeTimelineModel::features() const
{
Q_D(const RangeTimelineModel);
return 1 << QmlDebug::featureFromRangeType(d->rangeType);
return 1ULL << QmlDebug::featureFromRangeType(d->rangeType);
}
void RangeTimelineModel::clear()
......
......@@ -531,12 +531,12 @@ void QmlProfilerTool::clientsDisconnected()
template<QmlDebug::ProfileFeature feature>
void QmlProfilerTool::updateFeaturesMenu(quint64 features)
{
if (features & (1 << feature)) {
if (features & (1ULL << (feature))) {
QAction *action = d->m_featuresMenu->addAction(tr(QmlProfilerModelManager::featureName(
static_cast<QmlDebug::ProfileFeature>(feature))));
action->setCheckable(true);
action->setData(static_cast<uint>(feature));
action->setChecked(d->m_profilerState->recordingFeatures() & (1 << feature));
action->setChecked(d->m_profilerState->recordingFeatures() & (1ULL << (feature)));
}
updateFeaturesMenu<static_cast<QmlDebug::ProfileFeature>(feature + 1)>(features);
}
......@@ -664,10 +664,10 @@ void QmlProfilerTool::toggleRecordingFeature(QAction *action)
uint feature = action->data().toUInt();
if (action->isChecked())
d->m_profilerState->setRecordingFeatures(
d->m_profilerState->recordingFeatures() | (1 << feature));
d->m_profilerState->recordingFeatures() | (1ULL << feature));
else
d->m_profilerState->setRecordingFeatures(
d->m_profilerState->recordingFeatures() & (~(1 << feature)));
d->m_profilerState->recordingFeatures() & (~(1ULL << feature)));
// Keep the menu open to allow for more features to be toggled
d->m_recordButton->showMenu();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment