summaryrefslogtreecommitdiffstats
path: root/qmake/library
diff options
context:
space:
mode:
Diffstat (limited to 'qmake/library')
-rw-r--r--qmake/library/proitems.cpp4
-rw-r--r--qmake/library/proitems.h6
-rw-r--r--qmake/library/qmakeevaluator.cpp43
-rw-r--r--qmake/library/qmakeparser.cpp2
-rw-r--r--qmake/library/qmakeparser.h1
5 files changed, 22 insertions, 34 deletions
diff --git a/qmake/library/proitems.cpp b/qmake/library/proitems.cpp
index 41bed69f00..9330c2b1bf 100644
--- a/qmake/library/proitems.cpp
+++ b/qmake/library/proitems.cpp
@@ -238,7 +238,7 @@ ProString &ProString::append(const ProString &other, bool *pending)
QChar *ptr;
if (pending && !*pending) {
ptr = prepareExtend(1 + other.m_length, 0, m_length);
- *ptr++ = 32;
+ *ptr++ = QLatin1Char(' ');
} else {
ptr = prepareExtend(other.m_length, 0, m_length);
}
@@ -276,7 +276,7 @@ ProString &ProString::append(const ProStringList &other, bool *pending, bool ski
QChar *ptr = prepareExtend(totalLength, 0, m_length);
for (int i = startIdx; i < sz; ++i) {
if (putSpace)
- *ptr++ = 32;
+ *ptr++ = QLatin1Char(' ');
else
putSpace = true;
const ProString &str = other.at(i);
diff --git a/qmake/library/proitems.h b/qmake/library/proitems.h
index cc65421556..4569d7c3ff 100644
--- a/qmake/library/proitems.h
+++ b/qmake/library/proitems.h
@@ -68,6 +68,7 @@ class ProString {
public:
ProString();
ProString(const ProString &other);
+ ProString &operator=(const ProString &) = default;
PROITEM_EXPLICIT ProString(const QString &str);
PROITEM_EXPLICIT ProString(const QStringRef &str);
PROITEM_EXPLICIT ProString(const char *str);
@@ -432,11 +433,12 @@ public:
ProFunctionDef(const ProFunctionDef &o) : m_pro(o.m_pro), m_offset(o.m_offset) { m_pro->ref(); }
ProFunctionDef(ProFunctionDef &&other) noexcept
: m_pro(other.m_pro), m_offset(other.m_offset) { other.m_pro = nullptr; }
- ~ProFunctionDef() { m_pro->deref(); }
+ ~ProFunctionDef() { if (m_pro) m_pro->deref(); }
ProFunctionDef &operator=(const ProFunctionDef &o)
{
if (this != &o) {
- m_pro->deref();
+ if (m_pro)
+ m_pro->deref();
m_pro = o.m_pro;
m_pro->ref();
m_offset = o.m_offset;
diff --git a/qmake/library/qmakeevaluator.cpp b/qmake/library/qmakeevaluator.cpp
index ba617932ce..70897214b2 100644
--- a/qmake/library/qmakeevaluator.cpp
+++ b/qmake/library/qmakeevaluator.cpp
@@ -1130,48 +1130,35 @@ bool QMakeEvaluator::prepareProject(const QString &inDir)
}
superdir = qdfi.path();
}
+ QString sdir = inDir;
QString dir = m_outputDir;
forever {
+ conffile = sdir + QLatin1String("/.qmake.conf");
+ if (!m_vfs->exists(conffile, flags))
+ conffile.clear();
cachefile = dir + QLatin1String("/.qmake.cache");
if (!m_vfs->exists(cachefile, flags))
cachefile.clear();
- if (!cachefile.isEmpty()) {
+ if (!conffile.isEmpty() || !cachefile.isEmpty()) {
+ if (dir != sdir)
+ m_sourceRoot = sdir;
m_buildRoot = dir;
break;
}
if (dir == superdir)
goto no_cache;
- QFileInfo qdfi(dir);
- if (qdfi.isRoot()) {
- cachefile.clear();
- break;
- }
- dir = qdfi.path();
- }
- QString sdir = inDir;
- forever {
- conffile = sdir + QLatin1String("/.qmake.conf");
- if (!m_vfs->exists(conffile, flags))
- conffile.clear();
- if (!conffile.isEmpty()) {
- if (sdir != m_buildRoot)
- m_sourceRoot = sdir;
- break;
- }
QFileInfo qsdfi(sdir);
- if (qsdfi.isRoot()) {
- conffile.clear();
- break;
- }
+ QFileInfo qdfi(dir);
+ if (qsdfi.isRoot() || qdfi.isRoot())
+ goto no_cache;
sdir = qsdfi.path();
+ dir = qdfi.path();
}
} else {
m_buildRoot = QFileInfo(cachefile).path();
}
- if (!conffile.isEmpty())
- m_conffile = QDir::cleanPath(conffile);
- if (!cachefile.isEmpty())
- m_cachefile = QDir::cleanPath(cachefile);
+ m_conffile = QDir::cleanPath(conffile);
+ m_cachefile = QDir::cleanPath(cachefile);
}
no_cache:
@@ -1583,8 +1570,8 @@ void QMakeEvaluator::updateFeaturePaths()
}
for (int i = 0; i < feature_roots.count(); ++i)
- if (!feature_roots.at(i).endsWith((ushort)'/'))
- feature_roots[i].append((ushort)'/');
+ if (!feature_roots.at(i).endsWith(QLatin1Char('/')))
+ feature_roots[i].append(QLatin1Char('/'));
feature_roots.removeDuplicates();
diff --git a/qmake/library/qmakeparser.cpp b/qmake/library/qmakeparser.cpp
index 4c8360b459..ffe90ebda7 100644
--- a/qmake/library/qmakeparser.cpp
+++ b/qmake/library/qmakeparser.cpp
@@ -621,7 +621,7 @@ void QMakeParser::read(ProFile *pro, const QStringRef &in, int line, SubGrammar
if (c != term) {
parseError(fL1S("Missing %1 terminator [found %2]")
.arg(QChar(term))
- .arg(c ? QString(c) : QString::fromLatin1("end-of-line")));
+ .arg(c ? QString(QChar(c)) : QString::fromLatin1("end-of-line")));
m_inError = true;
// Just parse on, as if there was a terminator ...
} else {
diff --git a/qmake/library/qmakeparser.h b/qmake/library/qmakeparser.h
index 7b96d4e88f..c8c5c7718e 100644
--- a/qmake/library/qmakeparser.h
+++ b/qmake/library/qmakeparser.h
@@ -111,7 +111,6 @@ private:
struct BlockScope {
BlockScope() : start(nullptr), braceLevel(0), special(false), inBranch(false), nest(NestNone) {}
- BlockScope(const BlockScope &other) { *this = other; }
ushort *start; // Where this block started; store length here
int braceLevel; // Nesting of braces in scope
bool special; // Single-line conditionals inside loops, etc. cannot have else branches