aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@kdab.com>2016-05-11 14:39:05 +0200
committerMarc Mutz <marc.mutz@kdab.com>2016-05-11 20:25:04 +0000
commit50b12610a701e14c315839cd091e0f654c52f019 (patch)
tree9d97822e7178ddb86f6fdf680748d44b4bbc817a /src
parent28128f2dc6c5eb63d52658ede840e02b06f9ac2c (diff)
Eradicate Q_FOREACH loops from headers
They may prevent use of QT_NO_FOREACH in other Qt modules. Change-Id: Iafc04a73579a90492f3ff303978b78b71eec4e55 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
Diffstat (limited to 'src')
-rw-r--r--src/plugins/qmltooling/shared/qqmlconfigurabledebugservice.h2
-rw-r--r--src/qml/compiler/qv4ssa_p.h2
-rw-r--r--src/qml/jit/qv4targetplatform_p.h3
-rw-r--r--src/qml/parser/qqmljsparser_p.h2
4 files changed, 5 insertions, 4 deletions
diff --git a/src/plugins/qmltooling/shared/qqmlconfigurabledebugservice.h b/src/plugins/qmltooling/shared/qqmlconfigurabledebugservice.h
index 668ce2558d..85ff9b182f 100644
--- a/src/plugins/qmltooling/shared/qqmlconfigurabledebugservice.h
+++ b/src/plugins/qmltooling/shared/qqmlconfigurabledebugservice.h
@@ -72,7 +72,7 @@ protected:
{
QMutexLocker lock(&m_configMutex);
m_waitingForConfiguration = false;
- foreach (QJSEngine *engine, m_waitingEngines)
+ for (QJSEngine *engine : qAsConst(m_waitingEngines))
emit Base::attachedToEngine(engine);
m_waitingEngines.clear();
}
diff --git a/src/qml/compiler/qv4ssa_p.h b/src/qml/compiler/qv4ssa_p.h
index 86f812bc41..e608c08591 100644
--- a/src/qml/compiler/qv4ssa_p.h
+++ b/src/qml/compiler/qv4ssa_p.h
@@ -135,7 +135,7 @@ public:
// Validate the new range
if (_end != InvalidPosition) {
Q_ASSERT(!_ranges.isEmpty());
- foreach (const Range &range, _ranges) {
+ for (const Range &range : qAsConst(_ranges)) {
Q_ASSERT(range.start >= 0);
Q_ASSERT(range.end >= 0);
Q_ASSERT(range.start <= range.end);
diff --git a/src/qml/jit/qv4targetplatform_p.h b/src/qml/jit/qv4targetplatform_p.h
index 80a18a7f5b..54b17c4f07 100644
--- a/src/qml/jit/qv4targetplatform_p.h
+++ b/src/qml/jit/qv4targetplatform_p.h
@@ -134,7 +134,8 @@ public:
static int ebxIdx = -1;
if (ebxIdx == -1) {
int calleeSaves = 0;
- foreach (const RegisterInfo &info, getRegisterInfo()) {
+ const auto infos = getRegisterInfo();
+ for (const RegisterInfo &info : infos) {
if (info.reg<JSC::X86Registers::RegisterID>() == JSC::X86Registers::ebx) {
ebxIdx = calleeSaves;
break;
diff --git a/src/qml/parser/qqmljsparser_p.h b/src/qml/parser/qqmljsparser_p.h
index 02dbe7d323..00ffb6aca3 100644
--- a/src/qml/parser/qqmljsparser_p.h
+++ b/src/qml/parser/qqmljsparser_p.h
@@ -174,7 +174,7 @@ public:
inline DiagnosticMessage diagnosticMessage() const
{
- foreach (const DiagnosticMessage &d, diagnostic_messages) {
+ for (const DiagnosticMessage &d : diagnostic_messages) {
if (d.kind != DiagnosticMessage::Warning)
return d;
}