forked from qt-creator/qt-creator
use QTC_ASSERT instead of Q_ASSERT
This commit is contained in:
@@ -32,6 +32,9 @@
|
||||
***************************************************************************/
|
||||
|
||||
#include "CppDocument.h"
|
||||
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
#include <Control.h>
|
||||
#include <TranslationUnit.h>
|
||||
#include <DiagnosticClient.h>
|
||||
@@ -270,7 +273,7 @@ bool Document::parse(ParseMode mode)
|
||||
|
||||
void Document::check()
|
||||
{
|
||||
Q_ASSERT(! _globalNamespace);
|
||||
QTC_ASSERT(!_globalNamespace, return);
|
||||
|
||||
Semantic semantic(_control);
|
||||
|
||||
|
||||
@@ -34,6 +34,8 @@
|
||||
#include "OverviewModel.h"
|
||||
#include "Overview.h"
|
||||
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
#include <Scope.h>
|
||||
#include <Semantic.h>
|
||||
#include <Literals.h>
|
||||
@@ -81,13 +83,13 @@ QModelIndex OverviewModel::index(int row, int column, const QModelIndex &parent)
|
||||
return createIndex(row, column, symbol);
|
||||
} else {
|
||||
Symbol *parentSymbol = static_cast<Symbol *>(parent.internalPointer());
|
||||
Q_ASSERT(parentSymbol != 0);
|
||||
QTC_ASSERT(parentSymbol, return QModelIndex());
|
||||
|
||||
ScopedSymbol *scopedSymbol = parentSymbol->asScopedSymbol();
|
||||
Q_ASSERT(scopedSymbol != 0);
|
||||
QTC_ASSERT(scopedSymbol, return QModelIndex());
|
||||
|
||||
Scope *scope = scopedSymbol->members();
|
||||
Q_ASSERT(scope != 0);
|
||||
QTC_ASSERT(scope, return QModelIndex());
|
||||
|
||||
return createIndex(row, 0, scope->symbolAt(row));
|
||||
}
|
||||
@@ -124,12 +126,12 @@ int OverviewModel::rowCount(const QModelIndex &parent) const
|
||||
if (!parent.parent().isValid() && parent.row() == 0) // account for no symbol item
|
||||
return 0;
|
||||
Symbol *parentSymbol = static_cast<Symbol *>(parent.internalPointer());
|
||||
Q_ASSERT(parentSymbol != 0);
|
||||
QTC_ASSERT(parentSymbol, return 0);
|
||||
|
||||
if (ScopedSymbol *scopedSymbol = parentSymbol->asScopedSymbol()) {
|
||||
if (!scopedSymbol->isFunction()) {
|
||||
Scope *parentScope = scopedSymbol->members();
|
||||
Q_ASSERT(parentScope != 0);
|
||||
QTC_ASSERT(parentScope, return 0);
|
||||
|
||||
return parentScope->symbolCount();
|
||||
}
|
||||
|
||||
@@ -45,12 +45,14 @@
|
||||
#include <TypeVisitor.h>
|
||||
#include <NameVisitor.h>
|
||||
|
||||
#include <QList>
|
||||
#include <QtDebug>
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
#include <QtCore/QList>
|
||||
#include <QtCore/QtDebug>
|
||||
|
||||
using namespace CPlusPlus;
|
||||
|
||||
namespace {
|
||||
namespace {
|
||||
|
||||
typedef QList< QPair<Name *, FullySpecifiedType> > Substitution;
|
||||
|
||||
@@ -98,7 +100,7 @@ protected:
|
||||
// types
|
||||
virtual void visit(PointerToMemberType * /*ty*/)
|
||||
{
|
||||
Q_ASSERT(0);
|
||||
QTC_ASSERT(false, /**/);
|
||||
}
|
||||
|
||||
virtual void visit(PointerType *ty)
|
||||
@@ -150,32 +152,32 @@ protected:
|
||||
{ /* nothing to do*/ }
|
||||
|
||||
virtual void visit(Namespace *)
|
||||
{ Q_ASSERT(0); }
|
||||
{ QTC_ASSERT(false, /**/); }
|
||||
|
||||
virtual void visit(Class *)
|
||||
{ Q_ASSERT(0); }
|
||||
{ QTC_ASSERT(false, /**/); }
|
||||
|
||||
virtual void visit(Enum *)
|
||||
{ Q_ASSERT(0); }
|
||||
{ QTC_ASSERT(false, /**/); }
|
||||
|
||||
// names
|
||||
virtual void visit(NameId *)
|
||||
{ Q_ASSERT(0); }
|
||||
{ QTC_ASSERT(false, /**/); }
|
||||
|
||||
virtual void visit(TemplateNameId *)
|
||||
{ Q_ASSERT(0); }
|
||||
{ QTC_ASSERT(false, /**/); }
|
||||
|
||||
virtual void visit(DestructorNameId *)
|
||||
{ Q_ASSERT(0); }
|
||||
{ QTC_ASSERT(false, /**/); }
|
||||
|
||||
virtual void visit(OperatorNameId *)
|
||||
{ Q_ASSERT(0); }
|
||||
{ QTC_ASSERT(false, /**/); }
|
||||
|
||||
virtual void visit(ConversionNameId *)
|
||||
{ Q_ASSERT(0); }
|
||||
{ QTC_ASSERT(false, /**/); }
|
||||
|
||||
virtual void visit(QualifiedNameId *)
|
||||
{ Q_ASSERT(0); }
|
||||
{ QTC_ASSERT(false, /**/); }
|
||||
};
|
||||
|
||||
} // end of anonymous namespace
|
||||
|
||||
@@ -52,11 +52,14 @@
|
||||
|
||||
#include "pp-environment.h"
|
||||
#include "pp.h"
|
||||
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
#include <cstring>
|
||||
|
||||
using namespace CPlusPlus;
|
||||
|
||||
Environment::Environment ()
|
||||
Environment::Environment()
|
||||
: currentLine(0),
|
||||
hide_next(false),
|
||||
_macros(0),
|
||||
@@ -67,7 +70,7 @@ Environment::Environment ()
|
||||
{
|
||||
}
|
||||
|
||||
Environment::~Environment ()
|
||||
Environment::~Environment()
|
||||
{
|
||||
if (_macros) {
|
||||
qDeleteAll(firstMacro(), lastMacro());
|
||||
@@ -78,15 +81,19 @@ Environment::~Environment ()
|
||||
free(_hash);
|
||||
}
|
||||
|
||||
unsigned Environment::macroCount () const
|
||||
{ return _macro_count + 1; }
|
||||
unsigned Environment::macroCount() const
|
||||
{
|
||||
return _macro_count + 1;
|
||||
}
|
||||
|
||||
Macro *Environment::macroAt (unsigned index) const
|
||||
{ return _macros[index]; }
|
||||
Macro *Environment::macroAt(unsigned index) const
|
||||
{
|
||||
return _macros[index];
|
||||
}
|
||||
|
||||
Macro *Environment::bind(const Macro &__macro)
|
||||
{
|
||||
Q_ASSERT(! __macro.name.isEmpty());
|
||||
QTC_ASSERT(! __macro.name.isEmpty(), return 0);
|
||||
|
||||
Macro *m = new Macro (__macro);
|
||||
m->hashcode = hash_code(m->name);
|
||||
|
||||
Reference in New Issue
Block a user