From efe9bca20c2569f039f0193c6572d88dc024cd3d Mon Sep 17 00:00:00 2001 From: Leandro Melo Date: Mon, 23 Jan 2012 17:44:49 +0100 Subject: C++: Replace non-absolute-critical asserts for soft ones Change-Id: I021074a78d90929b4e83b8aff9db1ae7995e8c6a Reviewed-by: hjk --- src/plugins/cpptools/cppcodeformatter.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/plugins/cpptools/cppcodeformatter.cpp') 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 #include +#include #include #include @@ -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); -- cgit v1.2.1