summaryrefslogtreecommitdiff
path: root/src/plugins/cpptools/cppcodeformatter.cpp
diff options
context:
space:
mode:
authorLeandro Melo <leandro.melo@nokia.com>2012-01-23 17:44:49 +0100
committerhjk <qthjk@ovi.com>2012-01-24 09:58:59 +0100
commitefe9bca20c2569f039f0193c6572d88dc024cd3d (patch)
tree3f5173f35c94a6f93f0df32c46478c861b3fcf33 /src/plugins/cpptools/cppcodeformatter.cpp
parent918131b6e7d8f6db583a8c056749efa675761111 (diff)
downloadqt-creator-efe9bca20c2569f039f0193c6572d88dc024cd3d.tar.gz
C++: Replace non-absolute-critical asserts for soft ones
Change-Id: I021074a78d90929b4e83b8aff9db1ae7995e8c6a Reviewed-by: hjk <qthjk@ovi.com>
Diffstat (limited to 'src/plugins/cpptools/cppcodeformatter.cpp')
-rw-r--r--src/plugins/cpptools/cppcodeformatter.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/plugins/cpptools/cppcodeformatter.cpp b/src/plugins/cpptools/cppcodeformatter.cpp
index 74d63e6256..50df0e1be6 100644
--- a/src/plugins/cpptools/cppcodeformatter.cpp
+++ b/src/plugins/cpptools/cppcodeformatter.cpp
@@ -37,6 +37,7 @@
#include <texteditor/basetextdocumentlayout.h>
#include <texteditor/tabsettings.h>
+#include <utils/qtcassert.h>
#include <QtCore/QDebug>
#include <QtCore/QMetaEnum>
@@ -319,14 +320,14 @@ void CodeFormatter::recalculateStateAfter(const QTextBlock &block)
case else_clause:
// ### shouldn't happen
dump();
- Q_ASSERT(false);
+ QTC_CHECK(false);
leave(true);
break;
case do_statement:
// ### shouldn't happen
dump();
- Q_ASSERT(false);
+ QTC_CHECK(false);
leave(true);
break;
@@ -649,7 +650,7 @@ void CodeFormatter::enter(int newState)
void CodeFormatter::leave(bool statementDone)
{
- Q_ASSERT(m_currentState.size() > 1);
+ QTC_ASSERT(m_currentState.size() > 1, return);
if (m_currentState.top().type == topmost_intro)
return;
@@ -688,7 +689,7 @@ void CodeFormatter::leave(bool statementDone)
void CodeFormatter::correctIndentation(const QTextBlock &block)
{
const int lexerState = tokenizeBlock(block);
- Q_ASSERT(m_currentState.size() >= 1);
+ QTC_ASSERT(m_currentState.size() >= 1, return);
adjustIndent(m_tokens, lexerState, &m_indentDepth, &m_paddingDepth);
}
@@ -979,7 +980,7 @@ int CodeFormatter::tokenizeBlock(const QTextBlock &block, bool *endedJoined)
int startState = loadLexerState(block.previous());
if (block.blockNumber() == 0)
startState = 0;
- Q_ASSERT(startState != -1);
+ QTC_ASSERT(startState != -1, return 0);
SimpleLexer tokenize;
tokenize.setQtMocRunEnabled(true);