From 52574da03198bc252a6b4e164839d1938dda3502 Mon Sep 17 00:00:00 2001 From: Orgad Shaneh Date: Wed, 24 Sep 2014 07:59:13 +0300 Subject: [PATCH] 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: Ulf Hermann --- src/libs/qmldebug/qmlprofilertraceclient.cpp | 8 ++++---- src/plugins/qmlprofiler/qmlprofilertimelinemodelproxy.cpp | 2 +- src/plugins/qmlprofiler/qmlprofilertool.cpp | 8 ++++---- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/libs/qmldebug/qmlprofilertraceclient.cpp b/src/libs/qmldebug/qmlprofilertraceclient.cpp index 018bd1a356f..207d72ad40d 100644 --- a/src/libs/qmldebug/qmlprofilertraceclient.cpp +++ b/src/libs/qmldebug/qmlprofilertraceclient.cpp @@ -277,7 +277,7 @@ void QmlProfilerTraceClient::messageReceived(const QByteArray &data) break; } case RangeStart: { - if (!(d->features & (1 << featureFromRangeType(static_cast(subtype))))) + if (!(d->features & (1ULL << featureFromRangeType(static_cast(subtype))))) break; d->rangeStartTimes[subtype].push(time); d->inProgressRanges |= (static_cast(1) << subtype); @@ -293,7 +293,7 @@ void QmlProfilerTraceClient::messageReceived(const QByteArray &data) break; } case RangeData: { - if (!(d->features & (1 << featureFromRangeType(static_cast(subtype))))) + if (!(d->features & (1ULL << featureFromRangeType(static_cast(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(subtype))))) + if (!(d->features & (1ULL << featureFromRangeType(static_cast(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(subtype))))) + if (!(d->features & (1ULL << featureFromRangeType(static_cast(subtype))))) break; if (d->rangeCount[subtype] == 0) break; diff --git a/src/plugins/qmlprofiler/qmlprofilertimelinemodelproxy.cpp b/src/plugins/qmlprofiler/qmlprofilertimelinemodelproxy.cpp index 3ecf3bac349..a5b29f870d3 100644 --- a/src/plugins/qmlprofiler/qmlprofilertimelinemodelproxy.cpp +++ b/src/plugins/qmlprofiler/qmlprofilertimelinemodelproxy.cpp @@ -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() diff --git a/src/plugins/qmlprofiler/qmlprofilertool.cpp b/src/plugins/qmlprofiler/qmlprofilertool.cpp index 7d3d2cf7a2e..5e4c97ba045 100644 --- a/src/plugins/qmlprofiler/qmlprofilertool.cpp +++ b/src/plugins/qmlprofiler/qmlprofilertool.cpp @@ -531,12 +531,12 @@ void QmlProfilerTool::clientsDisconnected() template void QmlProfilerTool::updateFeaturesMenu(quint64 features) { - if (features & (1 << feature)) { + if (features & (1ULL << (feature))) { QAction *action = d->m_featuresMenu->addAction(tr(QmlProfilerModelManager::featureName( static_cast(feature)))); action->setCheckable(true); action->setData(static_cast(feature)); - action->setChecked(d->m_profilerState->recordingFeatures() & (1 << feature)); + action->setChecked(d->m_profilerState->recordingFeatures() & (1ULL << (feature))); } updateFeaturesMenu(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();