summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorAlexandru Croitor <alexandru.croitor@qt.io>2019-10-15 16:23:09 +0200
committerAlexandru Croitor <alexandru.croitor@qt.io>2019-10-15 16:23:33 +0200
commit32f10df75c789477091770ae01bb26643a66fd87 (patch)
treec81c80651a1672c24eddbe37e3df56deba23d5b4 /tools
parentb2bb5fdc0bc3ac7a20b26b1f423245548cd6a4b6 (diff)
parent8b133a964d0a7398791b6e14ad15f0f7284100dd (diff)
Merge remote-tracking branch 'origin/dev' into wip/cmake
Removed dependencies.yaml. Change-Id: I7d1b06564b6b5c71882fe058f094894af7cb3efc
Diffstat (limited to 'tools')
-rw-r--r--tools/qscxmlc/generator.cpp16
-rw-r--r--tools/qscxmlc/scxmlcppdumper.cpp4
2 files changed, 10 insertions, 10 deletions
diff --git a/tools/qscxmlc/generator.cpp b/tools/qscxmlc/generator.cpp
index ea3a066..6febf09 100644
--- a/tools/qscxmlc/generator.cpp
+++ b/tools/qscxmlc/generator.cpp
@@ -172,7 +172,7 @@ bool Generator::registerableMetaType(const QByteArray &propertyType)
#undef STREAM_SMART_POINTER
;
- foreach (const QByteArray &smartPointer, smartPointers)
+ for (const QByteArray &smartPointer : smartPointers)
if (propertyType.startsWith(smartPointer + "<") && !propertyType.endsWith("&"))
return knownQObjectClasses.contains(propertyType.mid(smartPointer.size() + 1, propertyType.size() - smartPointer.size() - 1 - 1));
@@ -181,7 +181,7 @@ bool Generator::registerableMetaType(const QByteArray &propertyType)
QT_FOR_EACH_AUTOMATIC_TEMPLATE_1ARG(STREAM_1ARG_TEMPLATE)
#undef STREAM_1ARG_TEMPLATE
;
- foreach (const QByteArray &oneArgTemplateType, oneArgTemplates)
+ for (const QByteArray &oneArgTemplateType : oneArgTemplates)
if (propertyType.startsWith(oneArgTemplateType + "<") && propertyType.endsWith(">")) {
const int argumentSize = propertyType.size() - oneArgTemplateType.size() - 1
// The closing '>'
@@ -1202,8 +1202,8 @@ void Generator::generateStaticMetacall()
fprintf(out, " case %d:\n", it.key());
fprintf(out, " switch (*reinterpret_cast<int*>(_a[1])) {\n");
fprintf(out, " default: *reinterpret_cast<int*>(_a[0]) = -1; break;\n");
- foreach (const QByteArray &key, it->uniqueKeys()) {
- foreach (int argumentID, it->values(key))
+ for (const QByteArray &key : it->uniqueKeys()) {
+ for (int argumentID : it->values(key))
fprintf(out, " case %d:\n", argumentID);
fprintf(out, " *reinterpret_cast<int*>(_a[0]) = qRegisterMetaType< %s >(); break;\n", key.constData());
}
@@ -1268,8 +1268,8 @@ void Generator::generateStaticMetacall()
fprintf(out, "if (_c == QMetaObject::RegisterPropertyMetaType) {\n");
fprintf(out, " switch (_id) {\n");
fprintf(out, " default: *reinterpret_cast<int*>(_a[0]) = -1; break;\n");
- foreach (const QByteArray &key, automaticPropertyMetaTypes.uniqueKeys()) {
- foreach (int propertyID, automaticPropertyMetaTypes.values(key))
+ for (const QByteArray &key : automaticPropertyMetaTypes.uniqueKeys()) {
+ for (int propertyID : automaticPropertyMetaTypes.values(key))
fprintf(out, " case %d:\n", propertyID);
fprintf(out, " *reinterpret_cast<int*>(_a[0]) = qRegisterMetaType< %s >(); break;\n", key.constData());
}
@@ -1593,8 +1593,8 @@ void Generator::generatePluginMetaData()
data.insert(QStringLiteral("MetaData"), cdef->pluginData.metaData.object());
// Add -M args from the command line:
- foreach (const QString &key, cdef->pluginData.metaArgs.keys())
- data.insert(key, cdef->pluginData.metaArgs.value(key));
+ for (auto it = cdef->pluginData.metaArgs.cbegin(), end = cdef->pluginData.metaArgs.cend(); it != end; ++it)
+ data.insert(it.key(), it.value());
fputs("\nQT_PLUGIN_METADATA_SECTION const uint qt_section_alignment_dummy = 42;\n\n"
"#ifdef QT_NO_DEBUG\n", out);
diff --git a/tools/qscxmlc/scxmlcppdumper.cpp b/tools/qscxmlc/scxmlcppdumper.cpp
index 6f81bd9..1aca09e 100644
--- a/tools/qscxmlc/scxmlcppdumper.cpp
+++ b/tools/qscxmlc/scxmlcppdumper.cpp
@@ -676,11 +676,11 @@ QString CppDumper::mangleIdentifier(const QString &str)
}
for (int ei = str.length(); i != ei; ++i) {
- auto c = str.at(i).unicode();
+ auto c = str.at(i);
if ((c >= QLatin1Char('0') && c <= QLatin1Char('9')) || isNonDigit(c)) {
mangled += c;
} else {
- mangled += QLatin1String("_0x") + QString::number(c, 16) + QLatin1Char('_');
+ mangled += QLatin1String("_0x") + QString::number(c.unicode(), 16) + QLatin1Char('_');
}
}