diff options
author | Liang Qi <liang.qi@qt.io> | 2016-05-20 13:46:21 +0200 |
---|---|---|
committer | Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> | 2016-05-23 21:09:46 +0200 |
commit | 56d6e000f7487c59172330ebd23a718268c508f1 (patch) | |
tree | 1494432583b1569816075091a8075b31d795f77c /src/tools/moc | |
parent | 9fd407fc6a29c94b4568dd042a05c208255179e0 (diff) | |
parent | c276aa51303b7c6f8e4cd854aadf8344a906e50f (diff) |
Merge remote-tracking branch 'origin/5.7' into dev
Conflicts:
mkspecs/wince80colibri-armv7-msvc2012/qmake.conf
qmake/generators/win32/msvc_vcproj.cpp
src/corelib/global/qnamespace.h
src/corelib/global/qnamespace.qdoc
src/corelib/io/qfsfileengine_win.cpp
src/corelib/tools/tools.pri
src/network/ssl/qsslconfiguration_p.h
src/plugins/platforms/linuxfb/qlinuxfbscreen.cpp
src/plugins/platforms/windows/windows.pri
src/src.pro
src/tools/bootstrap/bootstrap.pro
src/tools/uic/cpp/cppwriteinitialization.cpp
src/widgets/dialogs/qfilesystemmodel.cpp
tests/auto/testlib/selftests/expected_cmptest.teamcity
tests/auto/testlib/selftests/expected_cmptest.txt
Change-Id: I4d2ac78f0dcc97f008186bbbc769c6fe588ab0e5
Diffstat (limited to 'src/tools/moc')
-rw-r--r-- | src/tools/moc/moc.cpp | 8 | ||||
-rw-r--r-- | src/tools/moc/moc.pro | 7 | ||||
-rw-r--r-- | src/tools/moc/preprocessor.cpp | 6 |
3 files changed, 14 insertions, 7 deletions
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/moc.pro b/src/tools/moc/moc.pro index d39749a318..ccd29341d0 100644 --- a/src/tools/moc/moc.pro +++ b/src/tools/moc/moc.pro @@ -1,7 +1,12 @@ option(host_build) CONFIG += force_bootstrap -DEFINES += QT_MOC QT_NO_CAST_FROM_ASCII QT_NO_CAST_FROM_BYTEARRAY QT_NO_COMPRESS +DEFINES += \ + QT_MOC \ + QT_NO_CAST_FROM_ASCII \ + QT_NO_CAST_FROM_BYTEARRAY \ + QT_NO_COMPRESS \ + QT_NO_FOREACH include(moc.pri) HEADERS += qdatetime_p.h 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 |