summaryrefslogtreecommitdiffstats
path: root/qmake/generators/mac/pbuilder_pbx.cpp
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@qt.io>2022-09-30 14:09:04 +0200
committerMarc Mutz <marc.mutz@qt.io>2022-11-03 14:59:24 +0100
commit1c6bf3e09ea9722717caedcfcceaaf3d607615cf (patch)
treecad1814e104667a84ba7b5f403bbda015413e058 /qmake/generators/mac/pbuilder_pbx.cpp
parent43cda7807b98552e9292ac09a1f6612d432a8b13 (diff)
Port from container::count() and length() to size() - V5
This is a semantic patch using ClangTidyTransformator as in qtbase/df9d882d41b741fef7c5beeddb0abe9d904443d8, but extended to handle typedefs and accesses through pointers, too: const std::string o = "object"; auto hasTypeIgnoringPointer = [](auto type) { return anyOf(hasType(type), hasType(pointsTo(type))); }; auto derivedFromAnyOfClasses = [&](ArrayRef<StringRef> classes) { auto exprOfDeclaredType = [&](auto decl) { return expr(hasTypeIgnoringPointer(hasUnqualifiedDesugaredType(recordType(hasDeclaration(decl))))).bind(o); }; return exprOfDeclaredType(cxxRecordDecl(isSameOrDerivedFrom(hasAnyName(classes)))); }; auto renameMethod = [&] (ArrayRef<StringRef> classes, StringRef from, StringRef to) { return makeRule(cxxMemberCallExpr(on(derivedFromAnyOfClasses(classes)), callee(cxxMethodDecl(hasName(from), parameterCountIs(0)))), changeTo(cat(access(o, cat(to)), "()")), cat("use '", to, "' instead of '", from, "'")); }; renameMethod(<classes>, "count", "size"); renameMethod(<classes>, "length", "size"); except that the on() matcher has been replaced by one that doesn't ignoreParens(). a.k.a qt-port-to-std-compatible-api V5 with config Scope: 'Container'. Added two NOLINTNEXTLINEs in tst_qbitarray and tst_qcontiguouscache, to avoid porting calls that explicitly test count(). Change-Id: Icfb8808c2ff4a30187e9935a51cad26987451c22 Reviewed-by: Ivan Solovev <ivan.solovev@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Diffstat (limited to 'qmake/generators/mac/pbuilder_pbx.cpp')
-rw-r--r--qmake/generators/mac/pbuilder_pbx.cpp26
1 files changed, 13 insertions, 13 deletions
diff --git a/qmake/generators/mac/pbuilder_pbx.cpp b/qmake/generators/mac/pbuilder_pbx.cpp
index f5f0d2619c..9e36cad887 100644
--- a/qmake/generators/mac/pbuilder_pbx.cpp
+++ b/qmake/generators/mac/pbuilder_pbx.cpp
@@ -87,7 +87,7 @@ ProjectBuilderMakefileGenerator::writeSubDirs(QTextStream &t)
for(int pb_subdir = 0; pb_subdir < pb_subdirs.size(); ++pb_subdir) {
ProjectBuilderSubDirs *pb = pb_subdirs[pb_subdir];
const ProStringList &subdirs = pb->project->values("SUBDIRS");
- for(int subdir = 0; subdir < subdirs.count(); subdir++) {
+ for(int subdir = 0; subdir < subdirs.size(); subdir++) {
ProString tmpk = subdirs[subdir];
const ProKey fkey(tmpk + ".file");
if (!pb->project->isEmpty(fkey)) {
@@ -329,7 +329,7 @@ ProjectBuilderMakefileGenerator::writeSubDirs(QTextStream &t)
t << "\t\t\tprojectReferences = (\n";
{
const ProStringList &qmake_subdirs = project->values("QMAKE_PBX_SUBDIRS");
- for(int i = 0; i < qmake_subdirs.count(); i++) {
+ for(int i = 0; i < qmake_subdirs.size(); i++) {
const ProString &subdir = qmake_subdirs[i];
t << "\t\t\t\t{\n"
<< "\t\t\t\t\t" << writeSettings("ProductGroup", keyFor(subdir + "_PRODUCTGROUP")) << ";\n"
@@ -658,7 +658,7 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
const QStringList &files = fileFixify(sources.at(source).files(project),
FileFixifyFromOutdir | FileFixifyAbsolute);
- for(int f = 0; f < files.count(); ++f) {
+ for(int f = 0; f < files.size(); ++f) {
QString file = files[f];
if(!sources.at(source).compilerName().isNull() &&
!verifyExtraCompiler(sources.at(source).compilerName(), file))
@@ -873,7 +873,7 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
"QMAKE_LIBS", "QMAKE_LIBS_PRIVATE", nullptr };
for (int i = 0; libs[i]; i++) {
tmp = project->values(libs[i]);
- for(int x = 0; x < tmp.count();) {
+ for(int x = 0; x < tmp.size();) {
bool libSuffixReplaced = false;
bool remove = false;
QString library, name;
@@ -912,7 +912,7 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
if(opt.size() > 2) {
r = opt.mid(2).toQString();
} else {
- if(x == tmp.count()-1)
+ if(x == tmp.size()-1)
break;
r = tmp[++x].toQString();
}
@@ -921,12 +921,12 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
frameworkdirs.append(r);
}
} else if(opt == "-framework") {
- if(x == tmp.count()-1)
+ if(x == tmp.size()-1)
break;
const ProString &framework = tmp[x+1];
ProStringList fdirs = frameworkdirs;
fdirs << "/System/Library/Frameworks/" << "/Library/Frameworks/";
- for(int fdir = 0; fdir < fdirs.count(); fdir++) {
+ for(int fdir = 0; fdir < fdirs.size(); fdir++) {
if(exists(fdirs[fdir] + QDir::separator() + framework + ".framework")) {
remove = true;
library = fdirs[fdir] + Option::dir_sep + framework + ".framework";
@@ -1008,12 +1008,12 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
mkt << "SUBLIBS= ";
// ### This is missing the parametrization found in unixmake2.cpp
tmp = project->values("SUBLIBS");
- for(int i = 0; i < tmp.count(); i++)
+ for(int i = 0; i < tmp.size(); i++)
t << escapeFilePath("tmp/lib" + tmp[i] + ".a") << ' ';
t << Qt::endl << Qt::endl;
mkt << "sublibs: $(SUBLIBS)\n\n";
tmp = project->values("SUBLIBS");
- for(int i = 0; i < tmp.count(); i++)
+ for(int i = 0; i < tmp.size(); i++)
t << escapeFilePath("tmp/lib" + tmp[i] + ".a") + ":\n\t"
<< var(ProKey("MAKELIB" + tmp[i])) << Qt::endl << Qt::endl;
mkt.flush();
@@ -1148,7 +1148,7 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
//all bundle data
const ProStringList &bundle_data = project->values("QMAKE_BUNDLE_DATA");
- for(int i = 0; i < bundle_data.count(); i++) {
+ for(int i = 0; i < bundle_data.size(); i++) {
ProStringList bundle_files;
ProString path = project->first(ProKey(bundle_data[i] + ".path"));
const bool isEmbeddedFramework = ((!osx && path == QLatin1String("Frameworks"))
@@ -1158,7 +1158,7 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
//all files
const ProStringList &files = project->values(ProKey(bundle_data[i] + ".files"));
- for(int file = 0; file < files.count(); file++) {
+ for(int file = 0; file < files.size(); file++) {
QString fn = fileFixify(files[file].toQString(), FileFixifyAbsolute);
QString name = fn.split(Option::dir_sep).back();
QString file_ref_key = keyFor("QMAKE_PBX_BUNDLE_DATA_FILE_REF." + bundle_data[i] + "-" + fn);
@@ -1684,7 +1684,7 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
t << "\t\t\t\t" << writeSettings("CODE_SIGN_IDENTITY", project->first("QMAKE_XCODE_CODE_SIGN_IDENTITY")) << ";\n";
tmp = project->values("QMAKE_PBX_VARS");
- for (int i = 0; i < tmp.count(); i++) {
+ for (int i = 0; i < tmp.size(); i++) {
QString var = tmp[i].toQString(), val = QString::fromLocal8Bit(qgetenv(var.toLatin1().constData()));
if (val.isEmpty() && var == "TB")
val = "/usr/bin/";
@@ -1888,7 +1888,7 @@ ProStringList
ProjectBuilderMakefileGenerator::fixListForOutput(const ProStringList &l)
{
ProStringList ret;
- for(int i = 0; i < l.count(); i++)
+ for(int i = 0; i < l.size(); i++)
ret += fixForOutput(l[i].toQString());
return ret;
}