diff options
Diffstat (limited to 'src/tools')
-rw-r--r-- | src/tools/bootstrap/bootstrap.pro | 8 | ||||
-rw-r--r-- | src/tools/moc/moc.cpp | 8 | ||||
-rw-r--r-- | src/tools/moc/preprocessor.cpp | 6 |
3 files changed, 14 insertions, 8 deletions
diff --git a/src/tools/bootstrap/bootstrap.pro b/src/tools/bootstrap/bootstrap.pro index 5fbabe8fe4..a43105297f 100644 --- a/src/tools/bootstrap/bootstrap.pro +++ b/src/tools/bootstrap/bootstrap.pro @@ -134,8 +134,12 @@ macx { ../../corelib/io/qstandardpaths_win.cpp } -if(contains(QT_CONFIG, zlib)|cross_compile):include(../../3rdparty/zlib.pri) -else:include(../../3rdparty/zlib_dependency.pri) +contains(QT_CONFIG, zlib)|cross_compile { + include(../../3rdparty/zlib.pri) +} else { + CONFIG += no_core_dep + include(../../3rdparty/zlib_dependency.pri) +} win32:LIBS += -luser32 -lole32 -ladvapi32 -lshell32 diff --git a/src/tools/moc/moc.cpp b/src/tools/moc/moc.cpp index eb365b293c..f2efcadad7 100644 --- a/src/tools/moc/moc.cpp +++ b/src/tools/moc/moc.cpp @@ -373,8 +373,8 @@ bool Moc::parseFunction(FunctionDef *def, bool inMacro) def->isVirtual = false; def->isStatic = false; //skip modifiers and attributes - while (test(INLINE) || (test(STATIC) && (def->isStatic = true)) || - (test(VIRTUAL) && (def->isVirtual = true)) //mark as virtual + while (test(INLINE) || (test(STATIC) && (def->isStatic = true) == true) || + (test(VIRTUAL) && (def->isVirtual = true) == true) //mark as virtual || testFunctionAttribute(def) || testFunctionRevision(def)) {} bool templateFunction = (lookup() == TEMPLATE); def->type = parseType(); @@ -467,8 +467,8 @@ bool Moc::parseMaybeFunction(const ClassDef *cdef, FunctionDef *def) def->isVirtual = false; def->isStatic = false; //skip modifiers and attributes - while (test(EXPLICIT) || test(INLINE) || (test(STATIC) && (def->isStatic = true)) || - (test(VIRTUAL) && (def->isVirtual = true)) //mark as virtual + while (test(EXPLICIT) || test(INLINE) || (test(STATIC) && (def->isStatic = true) == true) || + (test(VIRTUAL) && (def->isVirtual = true) == true) //mark as virtual || testFunctionAttribute(def) || testFunctionRevision(def)) {} bool tilde = test(TILDE); def->type = parseType(); diff --git a/src/tools/moc/preprocessor.cpp b/src/tools/moc/preprocessor.cpp index 59611ca597..6ae785f417 100644 --- a/src/tools/moc/preprocessor.cpp +++ b/src/tools/moc/preprocessor.cpp @@ -45,7 +45,7 @@ QT_BEGIN_NAMESPACE static QByteArray cleaned(const QByteArray &input) { QByteArray result; - result.reserve(input.size()); + result.resize(input.size()); const char *data = input.constData(); const char *end = input.constData() + input.size(); char *output = result.data(); @@ -73,13 +73,15 @@ static QByteArray cleaned(const QByteArray &input) if (data != end && (*(data + 1) == '\n' || (*data) == '\r')) { ++newlines; data += 1; - if (*data != '\r') + if (data != end && *data != '\r') data += 1; continue; } } else if (*data == '\r' && *(data + 1) == '\n') { // reduce \r\n to \n ++data; } + if (data == end) + break; char ch = *data; if (ch == '\r') // os9: replace \r with \n |