diff options
author | Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> | 2015-02-02 18:52:24 +0100 |
---|---|---|
committer | Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> | 2015-10-27 17:52:28 +0000 |
commit | e51acff8fa2a5f76117ff618c7ccf90e01da009c (patch) | |
tree | 03179764aca51dee77b452ba24e13f5ed0a2ec75 /src/shared/proparser/qmakeparser.cpp | |
parent | c3394ca72737a4fcb600c6f45c9c51bb9f1ae257 (diff) | |
download | qt-creator-e51acff8fa2a5f76117ff618c7ccf90e01da009c.tar.gz |
remove pointless return value from QMakeParser::read()
it always returned true nowadays.
an obvious followup effect is that the return value of parsedProBlock()
doesn't need to be null-checked any more as well.
Change-Id: I782785cab9b721a78a342a010921a73e642ebe7f
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
(cherry picked from qtbase/030c3a6197da663e5d2df48b9130ef71ee22e86c)
Diffstat (limited to 'src/shared/proparser/qmakeparser.cpp')
-rw-r--r-- | src/shared/proparser/qmakeparser.cpp | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/src/shared/proparser/qmakeparser.cpp b/src/shared/proparser/qmakeparser.cpp index 246afb1d48..03d512cf14 100644 --- a/src/shared/proparser/qmakeparser.cpp +++ b/src/shared/proparser/qmakeparser.cpp @@ -229,10 +229,7 @@ ProFile *QMakeParser::parsedProBlock( const QString &contents, const QString &name, int line, SubGrammar grammar) { ProFile *pro = new ProFile(name); - if (!read(pro, contents, line, grammar)) { - delete pro; - pro = 0; - } + read(pro, contents, line, grammar); return pro; } @@ -252,7 +249,8 @@ bool QMakeParser::read(ProFile *pro, ParseFlags flags) fL1S("Cannot read %1: %2").arg(pro->fileName(), errStr)); return false; } - return read(pro, content, 1, FullGrammar); + read(pro, content, 1, FullGrammar); + return true; } void QMakeParser::putTok(ushort *&tokPtr, ushort tok) @@ -292,7 +290,7 @@ void QMakeParser::finalizeHashStr(ushort *buf, uint len) buf[-2] = (ushort)(hash >> 16); } -bool QMakeParser::read(ProFile *pro, const QString &in, int line, SubGrammar grammar) +void QMakeParser::read(ProFile *pro, const QString &in, int line, SubGrammar grammar) { m_proFile = pro; m_lineNo = line; @@ -865,7 +863,6 @@ bool QMakeParser::read(ProFile *pro, const QString &in, int line, SubGrammar gra leaveScope(tokPtr); tokBuff.resize(tokPtr - (ushort *)tokBuff.constData()); // Reserved capacity stays *pro->itemsRef() = tokBuff; - return true; #undef FLUSH_VALUE_LIST #undef FLUSH_LITERAL |