Some clang-tidy -use-modernize-nullptr

Change-Id: I1bed5e85a5b7948d08502a72a10f80baa075c204
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
This commit is contained in:
hjk
2019-07-31 17:21:41 +02:00
parent 630385751a
commit 2e14df7561
180 changed files with 1312 additions and 1312 deletions

View File

@@ -72,9 +72,9 @@ namespace QmlDesigner {
NodeInstanceClientProxy::NodeInstanceClientProxy(QObject *parent)
: QObject(parent),
m_inputIoDevice(0),
m_outputIoDevice(0),
m_nodeInstanceServer(0),
m_inputIoDevice(nullptr),
m_outputIoDevice(nullptr),
m_nodeInstanceServer(nullptr),
m_writeCommandCounter(0),
m_synchronizeId(-1)
{

View File

@@ -63,7 +63,7 @@ class NodeInstanceClientProxy : public QObject, public NodeInstanceClientInterfa
Q_OBJECT
public:
NodeInstanceClientProxy(QObject *parent = 0);
NodeInstanceClientProxy(QObject *parent = nullptr);
void informationChanged(const InformationChangedCommand &command) override;
void valuesChanged(const ValuesChangedCommand &command) override;

View File

@@ -38,7 +38,7 @@ class DummyContextObject : public QObject
Q_PROPERTY(bool runningInDesigner READ runningInDesigner FINAL)
public:
explicit DummyContextObject(QObject *parent = 0);
explicit DummyContextObject(QObject *parent = nullptr);
QObject *parentDummy() const;
void setParentDummy(QObject *parentDummy);

View File

@@ -137,7 +137,7 @@ void ObjectNodeInstance::initialize(const ObjectNodeInstance::Pointer &objectNod
void ObjectNodeInstance::setId(const QString &id)
{
if (!m_id.isEmpty() && context()) {
context()->engine()->rootContext()->setContextProperty(m_id, 0);
context()->engine()->rootContext()->setContextProperty(m_id, nullptr);
}
if (!id.isEmpty() && context()) {
@@ -324,7 +324,7 @@ void ObjectNodeInstance::removeFromOldProperty(QObject *object, QObject *oldPare
}
if (object && object->parent())
object->setParent(0);
object->setParent(nullptr);
}
void ObjectNodeInstance::addToNewProperty(QObject *object, QObject *newParent, const PropertyName &newParentProperty)
@@ -649,14 +649,14 @@ QObject *ObjectNodeInstance::createPrimitive(const QString &typeName, int majorN
QObject *ObjectNodeInstance::createPrimitiveFromSource(const QString &typeName, int majorNumber, int minorNumber, QQmlContext *context)
{
if (typeName.isEmpty())
return 0;
return nullptr;
QStringList parts = typeName.split("/");
const QString unqualifiedTypeName = parts.last();
parts.removeLast();
if (parts.isEmpty())
return 0;
return nullptr;
QString importString = parts.join(".") + " " + QString::number(majorNumber) + "." + QString::number(minorNumber);
if (importString == "QtQuick 1.0") /* Workaround for implicit QQml import */
@@ -772,12 +772,12 @@ QObject *ObjectNodeInstance::object() const
{
if (!m_object.isNull() && !QmlPrivateGate::objectWasDeleted(m_object.data()))
return m_object.data();
return 0;
return nullptr;
}
QQuickItem *ObjectNodeInstance::contentItem() const
{
return 0;
return nullptr;
}
bool ObjectNodeInstance::hasContent() const
@@ -819,7 +819,7 @@ QQmlContext *ObjectNodeInstance::context() const
return nodeInstanceServer()->context();
qWarning() << "Error: No NodeInstanceServer";
return 0;
return nullptr;
}
QQmlEngine *ObjectNodeInstance::engine() const
@@ -867,7 +867,7 @@ QImage ObjectNodeInstance::renderPreviewImage(const QSize & /*previewImageSize*/
QObject *ObjectNodeInstance::parent() const
{
if (!object())
return 0;
return nullptr;
return object()->parent();
}

View File

@@ -33,7 +33,7 @@ class Qt5NodeInstanceClientProxy : public NodeInstanceClientProxy
{
Q_OBJECT
public:
explicit Qt5NodeInstanceClientProxy(QObject *parent = 0);
explicit Qt5NodeInstanceClientProxy(QObject *parent = nullptr);
};
} // namespace QmlDesigner

View File

@@ -77,7 +77,7 @@ void Qt5NodeInstanceServer::initializeView()
QQmlView *Qt5NodeInstanceServer::declarativeView() const
{
return 0;
return nullptr;
}
QQmlEngine *Qt5NodeInstanceServer::engine() const
@@ -85,7 +85,7 @@ QQmlEngine *Qt5NodeInstanceServer::engine() const
if (quickView())
return quickView()->engine();
return 0;
return nullptr;
}
void Qt5NodeInstanceServer::resizeCanvasSizeToRootItemSize()

View File

@@ -95,7 +95,7 @@ QTransform QuickItemNodeInstance::transform() const
QObject *QuickItemNodeInstance::parent() const
{
if (!quickItem() || !quickItem()->parentItem())
return 0;
return nullptr;
return quickItem()->parentItem();
}
@@ -799,8 +799,8 @@ bool QuickItemNodeInstance::isAnchoredBySibling() const
QQuickItem *QuickItemNodeInstance::quickItem() const
{
if (object() == 0)
return 0;
if (object() == nullptr)
return nullptr;
return static_cast<QQuickItem*>(object());
}

View File

@@ -160,7 +160,7 @@ Internal::ObjectNodeInstance::Pointer ServerNodeInstance::createInstance(QObject
{
Internal::ObjectNodeInstance::Pointer instance;
if (objectToBeWrapped == 0)
if (objectToBeWrapped == nullptr)
instance = Internal::DummyNodeInstance::create();
else if (isSubclassOf(objectToBeWrapped, "Q3DSPresentationItem"))
instance = Internal::Qt3DPresentationNodeInstance::create(objectToBeWrapped);
@@ -198,28 +198,28 @@ ServerNodeInstance ServerNodeInstance::create(NodeInstanceServer *nodeInstanceSe
Q_ASSERT(instanceContainer.instanceId() != -1);
Q_ASSERT(nodeInstanceServer);
QObject *object = 0;
QObject *object = nullptr;
if (componentWrap == WrapAsComponent) {
object = Internal::ObjectNodeInstance::createComponentWrap(instanceContainer.nodeSource(), nodeInstanceServer->importCode(), nodeInstanceServer->context());
} else if (!instanceContainer.nodeSource().isEmpty()) {
object = Internal::ObjectNodeInstance::createCustomParserObject(instanceContainer.nodeSource(), nodeInstanceServer->importCode(), nodeInstanceServer->context());
if (object == 0)
if (object == nullptr)
nodeInstanceServer->sendDebugOutput(DebugOutputCommand::ErrorType, QLatin1String("Custom parser object could not be created."), instanceContainer.instanceId());
} else if (!instanceContainer.componentPath().isEmpty()) {
object = Internal::ObjectNodeInstance::createComponent(instanceContainer.componentPath(), nodeInstanceServer->context());
if (object == 0)
if (object == nullptr)
nodeInstanceServer->sendDebugOutput(DebugOutputCommand::ErrorType, QString("Component with path %1 could not be created.").arg(instanceContainer.componentPath()), instanceContainer.instanceId());
} else {
object = Internal::ObjectNodeInstance::createPrimitive(QString::fromUtf8(instanceContainer.type()), instanceContainer.majorNumber(), instanceContainer.minorNumber(), nodeInstanceServer->context());
if (object == 0)
if (object == nullptr)
nodeInstanceServer->sendDebugOutput(DebugOutputCommand::ErrorType, QLatin1String("Item could not be created."), instanceContainer.instanceId());
}
if (object == 0) {
if (object == nullptr) {
if (instanceContainer.metaType() == InstanceContainer::ItemMetaType) { //If we cannot instanciate the object but we know it has to be an Ttem, we create an Item instead.
object = Internal::ObjectNodeInstance::createPrimitive("QtQuick/Item", 2, 0, nodeInstanceServer->context());
if (object == 0)
if (object == nullptr)
object = new QQuickItem;
} else {
object = Internal::ObjectNodeInstance::createPrimitive("QtQml/QtObject", 2, 0, nodeInstanceServer->context());
@@ -549,7 +549,7 @@ void ServerNodeInstance::paintUpdate()
QObject *ServerNodeInstance::internalObject() const
{
if (m_nodeInstance.isNull())
return 0;
return nullptr;
return m_nodeInstance->object();
}

View File

@@ -123,7 +123,7 @@ public:
PropertyNameList propertyNames() const;
bool hasBindingForProperty(const PropertyName &name, bool *hasChanged = 0) const;
bool hasBindingForProperty(const PropertyName &name, bool *hasChanged = nullptr) const;
bool isValid() const;
void makeInvalid();

View File

@@ -70,10 +70,10 @@ public:
bool isPropertyBlackListed(const QmlDesigner::PropertyName &propertyName);
PropertyNameList propertyNameListForWritableProperties(QObject *object,
const PropertyName &baseName = PropertyName(),
QObjectList *inspectedObjects = 0);
QObjectList *inspectedObjects = nullptr);
PropertyNameList allPropertyNames(QObject *object,
const PropertyName &baseName = PropertyName(),
QObjectList *inspectedObjects = 0);
QObjectList *inspectedObjects = nullptr);
bool hasFullImplementedListInterface(const QQmlListReference &list);
void registerCustomData(QObject *object);

View File

@@ -129,7 +129,7 @@ static void displayHelpText(const QString &t)
static void displayError(const QString &t)
{
if (Utils::HostOsInfo::isWindowsHost() && qApp)
QMessageBox::critical(0, QLatin1String(Core::Constants::IDE_DISPLAY_NAME), t);
QMessageBox::critical(nullptr, QLatin1String(Core::Constants::IDE_DISPLAY_NAME), t);
else
qCritical("%s", qPrintable(t));
}
@@ -154,7 +154,7 @@ static void printHelp(const QString &a0)
displayHelpText(help);
}
QString applicationDirPath(char *arg = 0)
QString applicationDirPath(char *arg = nullptr)
{
static QString dir;
@@ -179,7 +179,7 @@ static inline QString msgCoreLoadFailure(const QString &why)
static inline int askMsgSendFailed()
{
return QMessageBox::question(0, QApplication::translate("Application","Could not send message"),
return QMessageBox::question(nullptr, QApplication::translate("Application","Could not send message"),
QCoreApplication::translate("Application", "Unable to send command line arguments "
"to the already running instance. It does not appear to "
"be responding. Do you want to start a new instance of "
@@ -549,7 +549,7 @@ int main(int argc, char **argv)
}
const PluginSpecSet plugins = PluginManager::plugins();
PluginSpec *coreplugin = 0;
PluginSpec *coreplugin = nullptr;
foreach (PluginSpec *spec, plugins) {
if (spec->name() == QLatin1String(corePluginNameC)) {
coreplugin = spec;

View File

@@ -44,7 +44,7 @@ ObjCSelectorAST *ObjCSelectorAST::clone(MemoryPool *pool) const
ObjCSelectorAST *ast = new (pool) ObjCSelectorAST;
for (ObjCSelectorArgumentListAST *iter = selector_argument_list, **ast_iter = &ast->selector_argument_list;
iter; iter = iter->next, ast_iter = &(*ast_iter)->next)
*ast_iter = new (pool) ObjCSelectorArgumentListAST((iter->value) ? iter->value->clone(pool) : 0);
*ast_iter = new (pool) ObjCSelectorArgumentListAST((iter->value) ? iter->value->clone(pool) : nullptr);
return ast;
}
@@ -75,7 +75,7 @@ GnuAttributeSpecifierAST *GnuAttributeSpecifierAST::clone(MemoryPool *pool) cons
ast->second_lparen_token = second_lparen_token;
for (GnuAttributeListAST *iter = attribute_list, **ast_iter = &ast->attribute_list;
iter; iter = iter->next, ast_iter = &(*ast_iter)->next)
*ast_iter = new (pool) GnuAttributeListAST((iter->value) ? iter->value->clone(pool) : 0);
*ast_iter = new (pool) GnuAttributeListAST((iter->value) ? iter->value->clone(pool) : nullptr);
ast->first_rparen_token = first_rparen_token;
ast->second_rparen_token = second_rparen_token;
return ast;
@@ -89,7 +89,7 @@ GnuAttributeAST *GnuAttributeAST::clone(MemoryPool *pool) const
ast->tag_token = tag_token;
for (ExpressionListAST *iter = expression_list, **ast_iter = &ast->expression_list;
iter; iter = iter->next, ast_iter = &(*ast_iter)->next)
*ast_iter = new (pool) ExpressionListAST((iter->value) ? iter->value->clone(pool) : 0);
*ast_iter = new (pool) ExpressionListAST((iter->value) ? iter->value->clone(pool) : nullptr);
ast->rparen_token = rparen_token;
return ast;
}
@@ -121,18 +121,18 @@ DeclaratorAST *DeclaratorAST::clone(MemoryPool *pool) const
DeclaratorAST *ast = new (pool) DeclaratorAST;
for (SpecifierListAST *iter = attribute_list, **ast_iter = &ast->attribute_list;
iter; iter = iter->next, ast_iter = &(*ast_iter)->next)
*ast_iter = new (pool) SpecifierListAST((iter->value) ? iter->value->clone(pool) : 0);
*ast_iter = new (pool) SpecifierListAST((iter->value) ? iter->value->clone(pool) : nullptr);
for (PtrOperatorListAST *iter = ptr_operator_list, **ast_iter = &ast->ptr_operator_list;
iter; iter = iter->next, ast_iter = &(*ast_iter)->next)
*ast_iter = new (pool) PtrOperatorListAST((iter->value) ? iter->value->clone(pool) : 0);
*ast_iter = new (pool) PtrOperatorListAST((iter->value) ? iter->value->clone(pool) : nullptr);
if (core_declarator)
ast->core_declarator = core_declarator->clone(pool);
for (PostfixDeclaratorListAST *iter = postfix_declarator_list, **ast_iter = &ast->postfix_declarator_list;
iter; iter = iter->next, ast_iter = &(*ast_iter)->next)
*ast_iter = new (pool) PostfixDeclaratorListAST((iter->value) ? iter->value->clone(pool) : 0);
*ast_iter = new (pool) PostfixDeclaratorListAST((iter->value) ? iter->value->clone(pool) : nullptr);
for (SpecifierListAST *iter = post_attribute_list, **ast_iter = &ast->post_attribute_list;
iter; iter = iter->next, ast_iter = &(*ast_iter)->next)
*ast_iter = new (pool) SpecifierListAST((iter->value) ? iter->value->clone(pool) : 0);
*ast_iter = new (pool) SpecifierListAST((iter->value) ? iter->value->clone(pool) : nullptr);
ast->equal_token = equal_token;
if (initializer)
ast->initializer = initializer->clone(pool);
@@ -145,10 +145,10 @@ SimpleDeclarationAST *SimpleDeclarationAST::clone(MemoryPool *pool) const
ast->qt_invokable_token = qt_invokable_token;
for (SpecifierListAST *iter = decl_specifier_list, **ast_iter = &ast->decl_specifier_list;
iter; iter = iter->next, ast_iter = &(*ast_iter)->next)
*ast_iter = new (pool) SpecifierListAST((iter->value) ? iter->value->clone(pool) : 0);
*ast_iter = new (pool) SpecifierListAST((iter->value) ? iter->value->clone(pool) : nullptr);
for (DeclaratorListAST *iter = declarator_list, **ast_iter = &ast->declarator_list;
iter; iter = iter->next, ast_iter = &(*ast_iter)->next)
*ast_iter = new (pool) DeclaratorListAST((iter->value) ? iter->value->clone(pool) : 0);
*ast_iter = new (pool) DeclaratorListAST((iter->value) ? iter->value->clone(pool) : nullptr);
ast->semicolon_token = semicolon_token;
return ast;
}
@@ -187,7 +187,7 @@ QtPrivateSlotAST *QtPrivateSlotAST::clone(MemoryPool *pool) const
ast->comma_token = comma_token;
for (SpecifierListAST *iter = type_specifier_list, **ast_iter = &ast->type_specifier_list;
iter; iter = iter->next, ast_iter = &(*ast_iter)->next)
*ast_iter = new (pool) SpecifierListAST((iter->value) ? iter->value->clone(pool) : 0);
*ast_iter = new (pool) SpecifierListAST((iter->value) ? iter->value->clone(pool) : nullptr);
if (declarator)
ast->declarator = declarator->clone(pool);
ast->rparen_token = rparen_token;
@@ -217,7 +217,7 @@ QtPropertyDeclarationAST *QtPropertyDeclarationAST::clone(MemoryPool *pool) cons
ast->property_name = property_name->clone(pool);
for (QtPropertyDeclarationItemListAST *iter = property_declaration_item_list, **ast_iter = &ast->property_declaration_item_list;
iter; iter = iter->next, ast_iter = &(*ast_iter)->next)
*ast_iter = new (pool) QtPropertyDeclarationItemListAST((iter->value) ? iter->value->clone(pool) : 0);
*ast_iter = new (pool) QtPropertyDeclarationItemListAST((iter->value) ? iter->value->clone(pool) : nullptr);
ast->rparen_token = rparen_token;
return ast;
}
@@ -229,7 +229,7 @@ QtEnumDeclarationAST *QtEnumDeclarationAST::clone(MemoryPool *pool) const
ast->lparen_token = lparen_token;
for (NameListAST *iter = enumerator_list, **ast_iter = &ast->enumerator_list;
iter; iter = iter->next, ast_iter = &(*ast_iter)->next)
*ast_iter = new (pool) NameListAST((iter->value) ? iter->value->clone(pool) : 0);
*ast_iter = new (pool) NameListAST((iter->value) ? iter->value->clone(pool) : nullptr);
ast->rparen_token = rparen_token;
return ast;
}
@@ -241,7 +241,7 @@ QtFlagsDeclarationAST *QtFlagsDeclarationAST::clone(MemoryPool *pool) const
ast->lparen_token = lparen_token;
for (NameListAST *iter = flag_enums_list, **ast_iter = &ast->flag_enums_list;
iter; iter = iter->next, ast_iter = &(*ast_iter)->next)
*ast_iter = new (pool) NameListAST((iter->value) ? iter->value->clone(pool) : 0);
*ast_iter = new (pool) NameListAST((iter->value) ? iter->value->clone(pool) : nullptr);
ast->rparen_token = rparen_token;
return ast;
}
@@ -253,7 +253,7 @@ QtInterfaceNameAST *QtInterfaceNameAST::clone(MemoryPool *pool) const
ast->interface_name = interface_name->clone(pool);
for (NameListAST *iter = constraint_list, **ast_iter = &ast->constraint_list;
iter; iter = iter->next, ast_iter = &(*ast_iter)->next)
*ast_iter = new (pool) NameListAST((iter->value) ? iter->value->clone(pool) : 0);
*ast_iter = new (pool) NameListAST((iter->value) ? iter->value->clone(pool) : nullptr);
return ast;
}
@@ -264,7 +264,7 @@ QtInterfacesDeclarationAST *QtInterfacesDeclarationAST::clone(MemoryPool *pool)
ast->lparen_token = lparen_token;
for (QtInterfaceNameListAST *iter = interface_name_list, **ast_iter = &ast->interface_name_list;
iter; iter = iter->next, ast_iter = &(*ast_iter)->next)
*ast_iter = new (pool) QtInterfaceNameListAST((iter->value) ? iter->value->clone(pool) : 0);
*ast_iter = new (pool) QtInterfaceNameListAST((iter->value) ? iter->value->clone(pool) : nullptr);
ast->rparen_token = rparen_token;
return ast;
}
@@ -372,19 +372,19 @@ ClassSpecifierAST *ClassSpecifierAST::clone(MemoryPool *pool) const
ast->classkey_token = classkey_token;
for (SpecifierListAST *iter = attribute_list, **ast_iter = &ast->attribute_list;
iter; iter = iter->next, ast_iter = &(*ast_iter)->next)
*ast_iter = new (pool) SpecifierListAST((iter->value) ? iter->value->clone(pool) : 0);
*ast_iter = new (pool) SpecifierListAST((iter->value) ? iter->value->clone(pool) : nullptr);
if (name)
ast->name = name->clone(pool);
ast->final_token = final_token;
ast->colon_token = colon_token;
for (BaseSpecifierListAST *iter = base_clause_list, **ast_iter = &ast->base_clause_list;
iter; iter = iter->next, ast_iter = &(*ast_iter)->next)
*ast_iter = new (pool) BaseSpecifierListAST((iter->value) ? iter->value->clone(pool) : 0);
*ast_iter = new (pool) BaseSpecifierListAST((iter->value) ? iter->value->clone(pool) : nullptr);
ast->dot_dot_dot_token = dot_dot_dot_token;
ast->lbrace_token = lbrace_token;
for (DeclarationListAST *iter = member_specifier_list, **ast_iter = &ast->member_specifier_list;
iter; iter = iter->next, ast_iter = &(*ast_iter)->next)
*ast_iter = new (pool) DeclarationListAST((iter->value) ? iter->value->clone(pool) : 0);
*ast_iter = new (pool) DeclarationListAST((iter->value) ? iter->value->clone(pool) : nullptr);
ast->rbrace_token = rbrace_token;
return ast;
}
@@ -407,7 +407,7 @@ CompoundStatementAST *CompoundStatementAST::clone(MemoryPool *pool) const
ast->lbrace_token = lbrace_token;
for (StatementListAST *iter = statement_list, **ast_iter = &ast->statement_list;
iter; iter = iter->next, ast_iter = &(*ast_iter)->next)
*ast_iter = new (pool) StatementListAST((iter->value) ? iter->value->clone(pool) : 0);
*ast_iter = new (pool) StatementListAST((iter->value) ? iter->value->clone(pool) : nullptr);
ast->rbrace_token = rbrace_token;
return ast;
}
@@ -417,7 +417,7 @@ ConditionAST *ConditionAST::clone(MemoryPool *pool) const
ConditionAST *ast = new (pool) ConditionAST;
for (SpecifierListAST *iter = type_specifier_list, **ast_iter = &ast->type_specifier_list;
iter; iter = iter->next, ast_iter = &(*ast_iter)->next)
*ast_iter = new (pool) SpecifierListAST((iter->value) ? iter->value->clone(pool) : 0);
*ast_iter = new (pool) SpecifierListAST((iter->value) ? iter->value->clone(pool) : nullptr);
if (declarator)
ast->declarator = declarator->clone(pool);
return ast;
@@ -458,7 +458,7 @@ CtorInitializerAST *CtorInitializerAST::clone(MemoryPool *pool) const
ast->colon_token = colon_token;
for (MemInitializerListAST *iter = member_initializer_list, **ast_iter = &ast->member_initializer_list;
iter; iter = iter->next, ast_iter = &(*ast_iter)->next)
*ast_iter = new (pool) MemInitializerListAST((iter->value) ? iter->value->clone(pool) : 0);
*ast_iter = new (pool) MemInitializerListAST((iter->value) ? iter->value->clone(pool) : nullptr);
ast->dot_dot_dot_token = dot_dot_dot_token;
return ast;
}
@@ -499,7 +499,7 @@ FunctionDeclaratorAST *FunctionDeclaratorAST::clone(MemoryPool *pool) const
ast->rparen_token = rparen_token;
for (SpecifierListAST *iter = cv_qualifier_list, **ast_iter = &ast->cv_qualifier_list;
iter; iter = iter->next, ast_iter = &(*ast_iter)->next)
*ast_iter = new (pool) SpecifierListAST((iter->value) ? iter->value->clone(pool) : 0);
*ast_iter = new (pool) SpecifierListAST((iter->value) ? iter->value->clone(pool) : nullptr);
ast->ref_qualifier_token = ref_qualifier_token;
if (exception_specification)
ast->exception_specification = exception_specification->clone(pool);
@@ -561,7 +561,7 @@ ElaboratedTypeSpecifierAST *ElaboratedTypeSpecifierAST::clone(MemoryPool *pool)
ast->classkey_token = classkey_token;
for (SpecifierListAST *iter = attribute_list, **ast_iter = &ast->attribute_list;
iter; iter = iter->next, ast_iter = &(*ast_iter)->next)
*ast_iter = new (pool) SpecifierListAST((iter->value) ? iter->value->clone(pool) : 0);
*ast_iter = new (pool) SpecifierListAST((iter->value) ? iter->value->clone(pool) : nullptr);
if (name)
ast->name = name->clone(pool);
return ast;
@@ -577,11 +577,11 @@ EnumSpecifierAST *EnumSpecifierAST::clone(MemoryPool *pool) const
ast->colon_token = colon_token;
for (SpecifierListAST *iter = type_specifier_list, **ast_iter = &ast->type_specifier_list;
iter; iter = iter->next, ast_iter = &(*ast_iter)->next)
*ast_iter = new (pool) SpecifierListAST((iter->value) ? iter->value->clone(pool) : 0);
*ast_iter = new (pool) SpecifierListAST((iter->value) ? iter->value->clone(pool) : nullptr);
ast->lbrace_token = lbrace_token;
for (EnumeratorListAST *iter = enumerator_list, **ast_iter = &ast->enumerator_list;
iter; iter = iter->next, ast_iter = &(*ast_iter)->next)
*ast_iter = new (pool) EnumeratorListAST((iter->value) ? iter->value->clone(pool) : 0);
*ast_iter = new (pool) EnumeratorListAST((iter->value) ? iter->value->clone(pool) : nullptr);
ast->stray_comma_token = stray_comma_token;
ast->rbrace_token = rbrace_token;
return ast;
@@ -602,7 +602,7 @@ ExceptionDeclarationAST *ExceptionDeclarationAST::clone(MemoryPool *pool) const
ExceptionDeclarationAST *ast = new (pool) ExceptionDeclarationAST;
for (SpecifierListAST *iter = type_specifier_list, **ast_iter = &ast->type_specifier_list;
iter; iter = iter->next, ast_iter = &(*ast_iter)->next)
*ast_iter = new (pool) SpecifierListAST((iter->value) ? iter->value->clone(pool) : 0);
*ast_iter = new (pool) SpecifierListAST((iter->value) ? iter->value->clone(pool) : nullptr);
if (declarator)
ast->declarator = declarator->clone(pool);
ast->dot_dot_dot_token = dot_dot_dot_token;
@@ -617,7 +617,7 @@ DynamicExceptionSpecificationAST *DynamicExceptionSpecificationAST::clone(Memory
ast->dot_dot_dot_token = dot_dot_dot_token;
for (ExpressionListAST *iter = type_id_list, **ast_iter = &ast->type_id_list;
iter; iter = iter->next, ast_iter = &(*ast_iter)->next)
*ast_iter = new (pool) ExpressionListAST((iter->value) ? iter->value->clone(pool) : 0);
*ast_iter = new (pool) ExpressionListAST((iter->value) ? iter->value->clone(pool) : nullptr);
ast->rparen_token = rparen_token;
return ast;
}
@@ -658,7 +658,7 @@ FunctionDefinitionAST *FunctionDefinitionAST::clone(MemoryPool *pool) const
ast->qt_invokable_token = qt_invokable_token;
for (SpecifierListAST *iter = decl_specifier_list, **ast_iter = &ast->decl_specifier_list;
iter; iter = iter->next, ast_iter = &(*ast_iter)->next)
*ast_iter = new (pool) SpecifierListAST((iter->value) ? iter->value->clone(pool) : 0);
*ast_iter = new (pool) SpecifierListAST((iter->value) ? iter->value->clone(pool) : nullptr);
if (declarator)
ast->declarator = declarator->clone(pool);
if (ctor_initializer)
@@ -675,7 +675,7 @@ ForeachStatementAST *ForeachStatementAST::clone(MemoryPool *pool) const
ast->lparen_token = lparen_token;
for (SpecifierListAST *iter = type_specifier_list, **ast_iter = &ast->type_specifier_list;
iter; iter = iter->next, ast_iter = &(*ast_iter)->next)
*ast_iter = new (pool) SpecifierListAST((iter->value) ? iter->value->clone(pool) : 0);
*ast_iter = new (pool) SpecifierListAST((iter->value) ? iter->value->clone(pool) : nullptr);
if (declarator)
ast->declarator = declarator->clone(pool);
if (initializer)
@@ -696,7 +696,7 @@ RangeBasedForStatementAST *RangeBasedForStatementAST::clone(MemoryPool *pool) co
ast->lparen_token = lparen_token;
for (SpecifierListAST *iter = type_specifier_list, **ast_iter = &ast->type_specifier_list;
iter; iter = iter->next, ast_iter = &(*ast_iter)->next)
*ast_iter = new (pool) SpecifierListAST((iter->value) ? iter->value->clone(pool) : 0);
*ast_iter = new (pool) SpecifierListAST((iter->value) ? iter->value->clone(pool) : nullptr);
if (declarator)
ast->declarator = declarator->clone(pool);
ast->colon_token = colon_token;
@@ -748,7 +748,7 @@ ArrayInitializerAST *ArrayInitializerAST::clone(MemoryPool *pool) const
ast->lbrace_token = lbrace_token;
for (ExpressionListAST *iter = expression_list, **ast_iter = &ast->expression_list;
iter; iter = iter->next, ast_iter = &(*ast_iter)->next)
*ast_iter = new (pool) ExpressionListAST((iter->value) ? iter->value->clone(pool) : 0);
*ast_iter = new (pool) ExpressionListAST((iter->value) ? iter->value->clone(pool) : nullptr);
ast->rbrace_token = rbrace_token;
return ast;
}
@@ -769,7 +769,7 @@ LinkageBodyAST *LinkageBodyAST::clone(MemoryPool *pool) const
ast->lbrace_token = lbrace_token;
for (DeclarationListAST *iter = declaration_list, **ast_iter = &ast->declaration_list;
iter; iter = iter->next, ast_iter = &(*ast_iter)->next)
*ast_iter = new (pool) DeclarationListAST((iter->value) ? iter->value->clone(pool) : 0);
*ast_iter = new (pool) DeclarationListAST((iter->value) ? iter->value->clone(pool) : nullptr);
ast->rbrace_token = rbrace_token;
return ast;
}
@@ -809,7 +809,7 @@ QualifiedNameAST *QualifiedNameAST::clone(MemoryPool *pool) const
ast->global_scope_token = global_scope_token;
for (NestedNameSpecifierListAST *iter = nested_name_specifier_list, **ast_iter = &ast->nested_name_specifier_list;
iter; iter = iter->next, ast_iter = &(*ast_iter)->next)
*ast_iter = new (pool) NestedNameSpecifierListAST((iter->value) ? iter->value->clone(pool) : 0);
*ast_iter = new (pool) NestedNameSpecifierListAST((iter->value) ? iter->value->clone(pool) : nullptr);
if (unqualified_name)
ast->unqualified_name = unqualified_name->clone(pool);
return ast;
@@ -830,10 +830,10 @@ ConversionFunctionIdAST *ConversionFunctionIdAST::clone(MemoryPool *pool) const
ast->operator_token = operator_token;
for (SpecifierListAST *iter = type_specifier_list, **ast_iter = &ast->type_specifier_list;
iter; iter = iter->next, ast_iter = &(*ast_iter)->next)
*ast_iter = new (pool) SpecifierListAST((iter->value) ? iter->value->clone(pool) : 0);
*ast_iter = new (pool) SpecifierListAST((iter->value) ? iter->value->clone(pool) : nullptr);
for (PtrOperatorListAST *iter = ptr_operator_list, **ast_iter = &ast->ptr_operator_list;
iter; iter = iter->next, ast_iter = &(*ast_iter)->next)
*ast_iter = new (pool) PtrOperatorListAST((iter->value) ? iter->value->clone(pool) : 0);
*ast_iter = new (pool) PtrOperatorListAST((iter->value) ? iter->value->clone(pool) : nullptr);
return ast;
}
@@ -868,7 +868,7 @@ TemplateIdAST *TemplateIdAST::clone(MemoryPool *pool) const
ast->less_token = less_token;
for (ExpressionListAST *iter = template_argument_list, **ast_iter = &ast->template_argument_list;
iter; iter = iter->next, ast_iter = &(*ast_iter)->next)
*ast_iter = new (pool) ExpressionListAST((iter->value) ? iter->value->clone(pool) : 0);
*ast_iter = new (pool) ExpressionListAST((iter->value) ? iter->value->clone(pool) : nullptr);
ast->greater_token = greater_token;
return ast;
}
@@ -881,7 +881,7 @@ NamespaceAST *NamespaceAST::clone(MemoryPool *pool) const
ast->identifier_token = identifier_token;
for (SpecifierListAST *iter = attribute_list, **ast_iter = &ast->attribute_list;
iter; iter = iter->next, ast_iter = &(*ast_iter)->next)
*ast_iter = new (pool) SpecifierListAST((iter->value) ? iter->value->clone(pool) : 0);
*ast_iter = new (pool) SpecifierListAST((iter->value) ? iter->value->clone(pool) : nullptr);
if (linkage_body)
ast->linkage_body = linkage_body->clone(pool);
return ast;
@@ -918,7 +918,7 @@ ExpressionListParenAST *ExpressionListParenAST::clone(MemoryPool *pool) const
ast->lparen_token = lparen_token;
for (ExpressionListAST *iter = expression_list, **ast_iter = &ast->expression_list;
iter; iter = iter->next, ast_iter = &(*ast_iter)->next)
*ast_iter = new (pool) ExpressionListAST((iter->value) ? iter->value->clone(pool) : 0);
*ast_iter = new (pool) ExpressionListAST((iter->value) ? iter->value->clone(pool) : nullptr);
ast->rparen_token = rparen_token;
return ast;
}
@@ -956,13 +956,13 @@ NewTypeIdAST *NewTypeIdAST::clone(MemoryPool *pool) const
NewTypeIdAST *ast = new (pool) NewTypeIdAST;
for (SpecifierListAST *iter = type_specifier_list, **ast_iter = &ast->type_specifier_list;
iter; iter = iter->next, ast_iter = &(*ast_iter)->next)
*ast_iter = new (pool) SpecifierListAST((iter->value) ? iter->value->clone(pool) : 0);
*ast_iter = new (pool) SpecifierListAST((iter->value) ? iter->value->clone(pool) : nullptr);
for (PtrOperatorListAST *iter = ptr_operator_list, **ast_iter = &ast->ptr_operator_list;
iter; iter = iter->next, ast_iter = &(*ast_iter)->next)
*ast_iter = new (pool) PtrOperatorListAST((iter->value) ? iter->value->clone(pool) : 0);
*ast_iter = new (pool) PtrOperatorListAST((iter->value) ? iter->value->clone(pool) : nullptr);
for (NewArrayDeclaratorListAST *iter = new_array_declarator_list, **ast_iter = &ast->new_array_declarator_list;
iter; iter = iter->next, ast_iter = &(*ast_iter)->next)
*ast_iter = new (pool) NewArrayDeclaratorListAST((iter->value) ? iter->value->clone(pool) : 0);
*ast_iter = new (pool) NewArrayDeclaratorListAST((iter->value) ? iter->value->clone(pool) : nullptr);
return ast;
}
@@ -980,7 +980,7 @@ ParameterDeclarationAST *ParameterDeclarationAST::clone(MemoryPool *pool) const
ParameterDeclarationAST *ast = new (pool) ParameterDeclarationAST;
for (SpecifierListAST *iter = type_specifier_list, **ast_iter = &ast->type_specifier_list;
iter; iter = iter->next, ast_iter = &(*ast_iter)->next)
*ast_iter = new (pool) SpecifierListAST((iter->value) ? iter->value->clone(pool) : 0);
*ast_iter = new (pool) SpecifierListAST((iter->value) ? iter->value->clone(pool) : nullptr);
if (declarator)
ast->declarator = declarator->clone(pool);
ast->equal_token = equal_token;
@@ -994,7 +994,7 @@ ParameterDeclarationClauseAST *ParameterDeclarationClauseAST::clone(MemoryPool *
ParameterDeclarationClauseAST *ast = new (pool) ParameterDeclarationClauseAST;
for (ParameterDeclarationListAST *iter = parameter_declaration_list, **ast_iter = &ast->parameter_declaration_list;
iter; iter = iter->next, ast_iter = &(*ast_iter)->next)
*ast_iter = new (pool) ParameterDeclarationListAST((iter->value) ? iter->value->clone(pool) : 0);
*ast_iter = new (pool) ParameterDeclarationListAST((iter->value) ? iter->value->clone(pool) : nullptr);
ast->dot_dot_dot_token = dot_dot_dot_token;
return ast;
}
@@ -1007,7 +1007,7 @@ CallAST *CallAST::clone(MemoryPool *pool) const
ast->lparen_token = lparen_token;
for (ExpressionListAST *iter = expression_list, **ast_iter = &ast->expression_list;
iter; iter = iter->next, ast_iter = &(*ast_iter)->next)
*ast_iter = new (pool) ExpressionListAST((iter->value) ? iter->value->clone(pool) : 0);
*ast_iter = new (pool) ExpressionListAST((iter->value) ? iter->value->clone(pool) : nullptr);
ast->rparen_token = rparen_token;
return ast;
}
@@ -1072,7 +1072,7 @@ TypeConstructorCallAST *TypeConstructorCallAST::clone(MemoryPool *pool) const
TypeConstructorCallAST *ast = new (pool) TypeConstructorCallAST;
for (SpecifierListAST *iter = type_specifier_list, **ast_iter = &ast->type_specifier_list;
iter; iter = iter->next, ast_iter = &(*ast_iter)->next)
*ast_iter = new (pool) SpecifierListAST((iter->value) ? iter->value->clone(pool) : 0);
*ast_iter = new (pool) SpecifierListAST((iter->value) ? iter->value->clone(pool) : nullptr);
if (expression)
ast->expression = expression->clone(pool);
return ast;
@@ -1084,11 +1084,11 @@ PointerToMemberAST *PointerToMemberAST::clone(MemoryPool *pool) const
ast->global_scope_token = global_scope_token;
for (NestedNameSpecifierListAST *iter = nested_name_specifier_list, **ast_iter = &ast->nested_name_specifier_list;
iter; iter = iter->next, ast_iter = &(*ast_iter)->next)
*ast_iter = new (pool) NestedNameSpecifierListAST((iter->value) ? iter->value->clone(pool) : 0);
*ast_iter = new (pool) NestedNameSpecifierListAST((iter->value) ? iter->value->clone(pool) : nullptr);
ast->star_token = star_token;
for (SpecifierListAST *iter = cv_qualifier_list, **ast_iter = &ast->cv_qualifier_list;
iter; iter = iter->next, ast_iter = &(*ast_iter)->next)
*ast_iter = new (pool) SpecifierListAST((iter->value) ? iter->value->clone(pool) : 0);
*ast_iter = new (pool) SpecifierListAST((iter->value) ? iter->value->clone(pool) : nullptr);
ast->ref_qualifier_token = ref_qualifier_token;
return ast;
}
@@ -1099,7 +1099,7 @@ PointerAST *PointerAST::clone(MemoryPool *pool) const
ast->star_token = star_token;
for (SpecifierListAST *iter = cv_qualifier_list, **ast_iter = &ast->cv_qualifier_list;
iter; iter = iter->next, ast_iter = &(*ast_iter)->next)
*ast_iter = new (pool) SpecifierListAST((iter->value) ? iter->value->clone(pool) : 0);
*ast_iter = new (pool) SpecifierListAST((iter->value) ? iter->value->clone(pool) : nullptr);
return ast;
}
@@ -1251,7 +1251,7 @@ TemplateDeclarationAST *TemplateDeclarationAST::clone(MemoryPool *pool) const
ast->less_token = less_token;
for (DeclarationListAST *iter = template_parameter_list, **ast_iter = &ast->template_parameter_list;
iter; iter = iter->next, ast_iter = &(*ast_iter)->next)
*ast_iter = new (pool) DeclarationListAST((iter->value) ? iter->value->clone(pool) : 0);
*ast_iter = new (pool) DeclarationListAST((iter->value) ? iter->value->clone(pool) : nullptr);
ast->greater_token = greater_token;
if (declaration)
ast->declaration = declaration->clone(pool);
@@ -1281,7 +1281,7 @@ TranslationUnitAST *TranslationUnitAST::clone(MemoryPool *pool) const
TranslationUnitAST *ast = new (pool) TranslationUnitAST;
for (DeclarationListAST *iter = declaration_list, **ast_iter = &ast->declaration_list;
iter; iter = iter->next, ast_iter = &(*ast_iter)->next)
*ast_iter = new (pool) DeclarationListAST((iter->value) ? iter->value->clone(pool) : 0);
*ast_iter = new (pool) DeclarationListAST((iter->value) ? iter->value->clone(pool) : nullptr);
return ast;
}
@@ -1293,7 +1293,7 @@ TryBlockStatementAST *TryBlockStatementAST::clone(MemoryPool *pool) const
ast->statement = statement->clone(pool);
for (CatchClauseListAST *iter = catch_clause_list, **ast_iter = &ast->catch_clause_list;
iter; iter = iter->next, ast_iter = &(*ast_iter)->next)
*ast_iter = new (pool) CatchClauseListAST((iter->value) ? iter->value->clone(pool) : 0);
*ast_iter = new (pool) CatchClauseListAST((iter->value) ? iter->value->clone(pool) : nullptr);
return ast;
}
@@ -1315,7 +1315,7 @@ TypeIdAST *TypeIdAST::clone(MemoryPool *pool) const
TypeIdAST *ast = new (pool) TypeIdAST;
for (SpecifierListAST *iter = type_specifier_list, **ast_iter = &ast->type_specifier_list;
iter; iter = iter->next, ast_iter = &(*ast_iter)->next)
*ast_iter = new (pool) SpecifierListAST((iter->value) ? iter->value->clone(pool) : 0);
*ast_iter = new (pool) SpecifierListAST((iter->value) ? iter->value->clone(pool) : nullptr);
if (declarator)
ast->declarator = declarator->clone(pool);
return ast;
@@ -1341,7 +1341,7 @@ TemplateTypeParameterAST *TemplateTypeParameterAST::clone(MemoryPool *pool) cons
ast->less_token = less_token;
for (DeclarationListAST *iter = template_parameter_list, **ast_iter = &ast->template_parameter_list;
iter; iter = iter->next, ast_iter = &(*ast_iter)->next)
*ast_iter = new (pool) DeclarationListAST((iter->value) ? iter->value->clone(pool) : 0);
*ast_iter = new (pool) DeclarationListAST((iter->value) ? iter->value->clone(pool) : nullptr);
ast->greater_token = greater_token;
ast->class_token = class_token;
ast->dot_dot_dot_token = dot_dot_dot_token;
@@ -1402,11 +1402,11 @@ ObjCClassForwardDeclarationAST *ObjCClassForwardDeclarationAST::clone(MemoryPool
ObjCClassForwardDeclarationAST *ast = new (pool) ObjCClassForwardDeclarationAST;
for (SpecifierListAST *iter = attribute_list, **ast_iter = &ast->attribute_list;
iter; iter = iter->next, ast_iter = &(*ast_iter)->next)
*ast_iter = new (pool) SpecifierListAST((iter->value) ? iter->value->clone(pool) : 0);
*ast_iter = new (pool) SpecifierListAST((iter->value) ? iter->value->clone(pool) : nullptr);
ast->class_token = class_token;
for (NameListAST *iter = identifier_list, **ast_iter = &ast->identifier_list;
iter; iter = iter->next, ast_iter = &(*ast_iter)->next)
*ast_iter = new (pool) NameListAST((iter->value) ? iter->value->clone(pool) : 0);
*ast_iter = new (pool) NameListAST((iter->value) ? iter->value->clone(pool) : nullptr);
ast->semicolon_token = semicolon_token;
return ast;
}
@@ -1416,7 +1416,7 @@ ObjCClassDeclarationAST *ObjCClassDeclarationAST::clone(MemoryPool *pool) const
ObjCClassDeclarationAST *ast = new (pool) ObjCClassDeclarationAST;
for (SpecifierListAST *iter = attribute_list, **ast_iter = &ast->attribute_list;
iter; iter = iter->next, ast_iter = &(*ast_iter)->next)
*ast_iter = new (pool) SpecifierListAST((iter->value) ? iter->value->clone(pool) : 0);
*ast_iter = new (pool) SpecifierListAST((iter->value) ? iter->value->clone(pool) : nullptr);
ast->interface_token = interface_token;
ast->implementation_token = implementation_token;
if (class_name)
@@ -1434,7 +1434,7 @@ ObjCClassDeclarationAST *ObjCClassDeclarationAST::clone(MemoryPool *pool) const
ast->inst_vars_decl = inst_vars_decl->clone(pool);
for (DeclarationListAST *iter = member_declaration_list, **ast_iter = &ast->member_declaration_list;
iter; iter = iter->next, ast_iter = &(*ast_iter)->next)
*ast_iter = new (pool) DeclarationListAST((iter->value) ? iter->value->clone(pool) : 0);
*ast_iter = new (pool) DeclarationListAST((iter->value) ? iter->value->clone(pool) : nullptr);
ast->end_token = end_token;
return ast;
}
@@ -1444,11 +1444,11 @@ ObjCProtocolForwardDeclarationAST *ObjCProtocolForwardDeclarationAST::clone(Memo
ObjCProtocolForwardDeclarationAST *ast = new (pool) ObjCProtocolForwardDeclarationAST;
for (SpecifierListAST *iter = attribute_list, **ast_iter = &ast->attribute_list;
iter; iter = iter->next, ast_iter = &(*ast_iter)->next)
*ast_iter = new (pool) SpecifierListAST((iter->value) ? iter->value->clone(pool) : 0);
*ast_iter = new (pool) SpecifierListAST((iter->value) ? iter->value->clone(pool) : nullptr);
ast->protocol_token = protocol_token;
for (NameListAST *iter = identifier_list, **ast_iter = &ast->identifier_list;
iter; iter = iter->next, ast_iter = &(*ast_iter)->next)
*ast_iter = new (pool) NameListAST((iter->value) ? iter->value->clone(pool) : 0);
*ast_iter = new (pool) NameListAST((iter->value) ? iter->value->clone(pool) : nullptr);
ast->semicolon_token = semicolon_token;
return ast;
}
@@ -1458,7 +1458,7 @@ ObjCProtocolDeclarationAST *ObjCProtocolDeclarationAST::clone(MemoryPool *pool)
ObjCProtocolDeclarationAST *ast = new (pool) ObjCProtocolDeclarationAST;
for (SpecifierListAST *iter = attribute_list, **ast_iter = &ast->attribute_list;
iter; iter = iter->next, ast_iter = &(*ast_iter)->next)
*ast_iter = new (pool) SpecifierListAST((iter->value) ? iter->value->clone(pool) : 0);
*ast_iter = new (pool) SpecifierListAST((iter->value) ? iter->value->clone(pool) : nullptr);
ast->protocol_token = protocol_token;
if (name)
ast->name = name->clone(pool);
@@ -1466,7 +1466,7 @@ ObjCProtocolDeclarationAST *ObjCProtocolDeclarationAST::clone(MemoryPool *pool)
ast->protocol_refs = protocol_refs->clone(pool);
for (DeclarationListAST *iter = member_declaration_list, **ast_iter = &ast->member_declaration_list;
iter; iter = iter->next, ast_iter = &(*ast_iter)->next)
*ast_iter = new (pool) DeclarationListAST((iter->value) ? iter->value->clone(pool) : 0);
*ast_iter = new (pool) DeclarationListAST((iter->value) ? iter->value->clone(pool) : nullptr);
ast->end_token = end_token;
return ast;
}
@@ -1477,7 +1477,7 @@ ObjCProtocolRefsAST *ObjCProtocolRefsAST::clone(MemoryPool *pool) const
ast->less_token = less_token;
for (NameListAST *iter = identifier_list, **ast_iter = &ast->identifier_list;
iter; iter = iter->next, ast_iter = &(*ast_iter)->next)
*ast_iter = new (pool) NameListAST((iter->value) ? iter->value->clone(pool) : 0);
*ast_iter = new (pool) NameListAST((iter->value) ? iter->value->clone(pool) : nullptr);
ast->greater_token = greater_token;
return ast;
}
@@ -1500,7 +1500,7 @@ ObjCMessageExpressionAST *ObjCMessageExpressionAST::clone(MemoryPool *pool) cons
ast->selector = selector->clone(pool);
for (ObjCMessageArgumentListAST *iter = argument_list, **ast_iter = &ast->argument_list;
iter; iter = iter->next, ast_iter = &(*ast_iter)->next)
*ast_iter = new (pool) ObjCMessageArgumentListAST((iter->value) ? iter->value->clone(pool) : 0);
*ast_iter = new (pool) ObjCMessageArgumentListAST((iter->value) ? iter->value->clone(pool) : nullptr);
ast->rbracket_token = rbracket_token;
return ast;
}
@@ -1552,7 +1552,7 @@ ObjCInstanceVariablesDeclarationAST *ObjCInstanceVariablesDeclarationAST::clone(
ast->lbrace_token = lbrace_token;
for (DeclarationListAST *iter = instance_variable_list, **ast_iter = &ast->instance_variable_list;
iter; iter = iter->next, ast_iter = &(*ast_iter)->next)
*ast_iter = new (pool) DeclarationListAST((iter->value) ? iter->value->clone(pool) : 0);
*ast_iter = new (pool) DeclarationListAST((iter->value) ? iter->value->clone(pool) : nullptr);
ast->rbrace_token = rbrace_token;
return ast;
}
@@ -1579,12 +1579,12 @@ ObjCPropertyDeclarationAST *ObjCPropertyDeclarationAST::clone(MemoryPool *pool)
ObjCPropertyDeclarationAST *ast = new (pool) ObjCPropertyDeclarationAST;
for (SpecifierListAST *iter = attribute_list, **ast_iter = &ast->attribute_list;
iter; iter = iter->next, ast_iter = &(*ast_iter)->next)
*ast_iter = new (pool) SpecifierListAST((iter->value) ? iter->value->clone(pool) : 0);
*ast_iter = new (pool) SpecifierListAST((iter->value) ? iter->value->clone(pool) : nullptr);
ast->property_token = property_token;
ast->lparen_token = lparen_token;
for (ObjCPropertyAttributeListAST *iter = property_attribute_list, **ast_iter = &ast->property_attribute_list;
iter; iter = iter->next, ast_iter = &(*ast_iter)->next)
*ast_iter = new (pool) ObjCPropertyAttributeListAST((iter->value) ? iter->value->clone(pool) : 0);
*ast_iter = new (pool) ObjCPropertyAttributeListAST((iter->value) ? iter->value->clone(pool) : nullptr);
ast->rparen_token = rparen_token;
if (simple_declaration)
ast->simple_declaration = simple_declaration->clone(pool);
@@ -1598,7 +1598,7 @@ ObjCMessageArgumentDeclarationAST *ObjCMessageArgumentDeclarationAST::clone(Memo
ast->type_name = type_name->clone(pool);
for (SpecifierListAST *iter = attribute_list, **ast_iter = &ast->attribute_list;
iter; iter = iter->next, ast_iter = &(*ast_iter)->next)
*ast_iter = new (pool) SpecifierListAST((iter->value) ? iter->value->clone(pool) : 0);
*ast_iter = new (pool) SpecifierListAST((iter->value) ? iter->value->clone(pool) : nullptr);
if (param_name)
ast->param_name = param_name->clone(pool);
return ast;
@@ -1614,11 +1614,11 @@ ObjCMethodPrototypeAST *ObjCMethodPrototypeAST::clone(MemoryPool *pool) const
ast->selector = selector->clone(pool);
for (ObjCMessageArgumentDeclarationListAST *iter = argument_list, **ast_iter = &ast->argument_list;
iter; iter = iter->next, ast_iter = &(*ast_iter)->next)
*ast_iter = new (pool) ObjCMessageArgumentDeclarationListAST((iter->value) ? iter->value->clone(pool) : 0);
*ast_iter = new (pool) ObjCMessageArgumentDeclarationListAST((iter->value) ? iter->value->clone(pool) : nullptr);
ast->dot_dot_dot_token = dot_dot_dot_token;
for (SpecifierListAST *iter = attribute_list, **ast_iter = &ast->attribute_list;
iter; iter = iter->next, ast_iter = &(*ast_iter)->next)
*ast_iter = new (pool) SpecifierListAST((iter->value) ? iter->value->clone(pool) : 0);
*ast_iter = new (pool) SpecifierListAST((iter->value) ? iter->value->clone(pool) : nullptr);
return ast;
}
@@ -1648,7 +1648,7 @@ ObjCSynthesizedPropertiesDeclarationAST *ObjCSynthesizedPropertiesDeclarationAST
ast->synthesized_token = synthesized_token;
for (ObjCSynthesizedPropertyListAST *iter = property_identifier_list, **ast_iter = &ast->property_identifier_list;
iter; iter = iter->next, ast_iter = &(*ast_iter)->next)
*ast_iter = new (pool) ObjCSynthesizedPropertyListAST((iter->value) ? iter->value->clone(pool) : 0);
*ast_iter = new (pool) ObjCSynthesizedPropertyListAST((iter->value) ? iter->value->clone(pool) : nullptr);
ast->semicolon_token = semicolon_token;
return ast;
}
@@ -1659,7 +1659,7 @@ ObjCDynamicPropertiesDeclarationAST *ObjCDynamicPropertiesDeclarationAST::clone(
ast->dynamic_token = dynamic_token;
for (NameListAST *iter = property_identifier_list, **ast_iter = &ast->property_identifier_list;
iter; iter = iter->next, ast_iter = &(*ast_iter)->next)
*ast_iter = new (pool) NameListAST((iter->value) ? iter->value->clone(pool) : 0);
*ast_iter = new (pool) NameListAST((iter->value) ? iter->value->clone(pool) : nullptr);
ast->semicolon_token = semicolon_token;
return ast;
}
@@ -1671,7 +1671,7 @@ ObjCFastEnumerationAST *ObjCFastEnumerationAST::clone(MemoryPool *pool) const
ast->lparen_token = lparen_token;
for (SpecifierListAST *iter = type_specifier_list, **ast_iter = &ast->type_specifier_list;
iter; iter = iter->next, ast_iter = &(*ast_iter)->next)
*ast_iter = new (pool) SpecifierListAST((iter->value) ? iter->value->clone(pool) : 0);
*ast_iter = new (pool) SpecifierListAST((iter->value) ? iter->value->clone(pool) : nullptr);
if (declarator)
ast->declarator = declarator->clone(pool);
if (initializer)
@@ -1726,7 +1726,7 @@ LambdaCaptureAST *LambdaCaptureAST::clone(MemoryPool *pool) const
ast->default_capture_token = default_capture_token;
for (CaptureListAST *iter = capture_list, **ast_iter = &ast->capture_list;
iter; iter = iter->next, ast_iter = &(*ast_iter)->next)
*ast_iter = new (pool) CaptureListAST((iter->value) ? iter->value->clone(pool) : 0);
*ast_iter = new (pool) CaptureListAST((iter->value) ? iter->value->clone(pool) : nullptr);
return ast;
}
@@ -1748,7 +1748,7 @@ LambdaDeclaratorAST *LambdaDeclaratorAST::clone(MemoryPool *pool) const
ast->rparen_token = rparen_token;
for (SpecifierListAST *iter = attributes, **ast_iter = &ast->attributes;
iter; iter = iter->next, ast_iter = &(*ast_iter)->next)
*ast_iter = new (pool) SpecifierListAST((iter->value) ? iter->value->clone(pool) : 0);
*ast_iter = new (pool) SpecifierListAST((iter->value) ? iter->value->clone(pool) : nullptr);
ast->mutable_token = mutable_token;
if (exception_specification)
ast->exception_specification = exception_specification->clone(pool);
@@ -1763,10 +1763,10 @@ TrailingReturnTypeAST *TrailingReturnTypeAST::clone(MemoryPool *pool) const
ast->arrow_token = arrow_token;
for (SpecifierListAST *iter = attributes, **ast_iter = &ast->attributes;
iter; iter = iter->next, ast_iter = &(*ast_iter)->next)
*ast_iter = new (pool) SpecifierListAST((iter->value) ? iter->value->clone(pool) : 0);
*ast_iter = new (pool) SpecifierListAST((iter->value) ? iter->value->clone(pool) : nullptr);
for (SpecifierListAST *iter = type_specifier_list, **ast_iter = &ast->type_specifier_list;
iter; iter = iter->next, ast_iter = &(*ast_iter)->next)
*ast_iter = new (pool) SpecifierListAST((iter->value) ? iter->value->clone(pool) : 0);
*ast_iter = new (pool) SpecifierListAST((iter->value) ? iter->value->clone(pool) : nullptr);
if (declarator)
ast->declarator = declarator->clone(pool);
return ast;
@@ -1778,7 +1778,7 @@ BracedInitializerAST *BracedInitializerAST::clone(MemoryPool *pool) const
ast->lbrace_token = lbrace_token;
for (ExpressionListAST *iter = expression_list, **ast_iter = &ast->expression_list;
iter; iter = iter->next, ast_iter = &(*ast_iter)->next)
*ast_iter = new (pool) ExpressionListAST((iter->value) ? iter->value->clone(pool) : 0);
*ast_iter = new (pool) ExpressionListAST((iter->value) ? iter->value->clone(pool) : nullptr);
ast->comma_token = comma_token;
ast->rbrace_token = rbrace_token;
return ast;
@@ -1807,7 +1807,7 @@ DesignatedInitializerAST *DesignatedInitializerAST::clone(MemoryPool *pool) cons
DesignatedInitializerAST *ast = new (pool) DesignatedInitializerAST;
for (DesignatorListAST *iter = designator_list, **ast_iter = &ast->designator_list;
iter; iter = iter->next, ast_iter = &(*ast_iter)->next)
*ast_iter = new (pool) DesignatorListAST((iter->value) ? iter->value->clone(pool) : 0);
*ast_iter = new (pool) DesignatorListAST((iter->value) ? iter->value->clone(pool) : nullptr);
ast->equal_token = equal_token;
if (initializer)
ast->initializer = initializer->clone(pool);

View File

@@ -1181,7 +1181,7 @@ public:
return ast;
}
BaseSpecifierListAST *BaseSpecifierList(BaseSpecifierAST *value, BaseSpecifierListAST *next = 0)
BaseSpecifierListAST *BaseSpecifierList(BaseSpecifierAST *value, BaseSpecifierListAST *next = nullptr)
{
BaseSpecifierListAST *list = new (&pool) BaseSpecifierListAST;
list->next = next;
@@ -1189,7 +1189,7 @@ public:
return list;
}
CaptureListAST *CaptureList(CaptureAST *value, CaptureListAST *next = 0)
CaptureListAST *CaptureList(CaptureAST *value, CaptureListAST *next = nullptr)
{
CaptureListAST *list = new (&pool) CaptureListAST;
list->next = next;
@@ -1197,7 +1197,7 @@ public:
return list;
}
CatchClauseListAST *CatchClauseList(CatchClauseAST *value, CatchClauseListAST *next = 0)
CatchClauseListAST *CatchClauseList(CatchClauseAST *value, CatchClauseListAST *next = nullptr)
{
CatchClauseListAST *list = new (&pool) CatchClauseListAST;
list->next = next;
@@ -1205,7 +1205,7 @@ public:
return list;
}
DeclarationListAST *DeclarationList(DeclarationAST *value, DeclarationListAST *next = 0)
DeclarationListAST *DeclarationList(DeclarationAST *value, DeclarationListAST *next = nullptr)
{
DeclarationListAST *list = new (&pool) DeclarationListAST;
list->next = next;
@@ -1213,7 +1213,7 @@ public:
return list;
}
DeclaratorListAST *DeclaratorList(DeclaratorAST *value, DeclaratorListAST *next = 0)
DeclaratorListAST *DeclaratorList(DeclaratorAST *value, DeclaratorListAST *next = nullptr)
{
DeclaratorListAST *list = new (&pool) DeclaratorListAST;
list->next = next;
@@ -1221,7 +1221,7 @@ public:
return list;
}
DesignatorListAST *DesignatorList(DesignatorAST *value, DesignatorListAST *next = 0)
DesignatorListAST *DesignatorList(DesignatorAST *value, DesignatorListAST *next = nullptr)
{
DesignatorListAST *list = new (&pool) DesignatorListAST;
list->next = next;
@@ -1229,7 +1229,7 @@ public:
return list;
}
EnumeratorListAST *EnumeratorList(EnumeratorAST *value, EnumeratorListAST *next = 0)
EnumeratorListAST *EnumeratorList(EnumeratorAST *value, EnumeratorListAST *next = nullptr)
{
EnumeratorListAST *list = new (&pool) EnumeratorListAST;
list->next = next;
@@ -1237,7 +1237,7 @@ public:
return list;
}
ExpressionListAST *ExpressionList(ExpressionAST *value, ExpressionListAST *next = 0)
ExpressionListAST *ExpressionList(ExpressionAST *value, ExpressionListAST *next = nullptr)
{
ExpressionListAST *list = new (&pool) ExpressionListAST;
list->next = next;
@@ -1245,7 +1245,7 @@ public:
return list;
}
GnuAttributeListAST *GnuAttributeList(GnuAttributeAST *value, GnuAttributeListAST *next = 0)
GnuAttributeListAST *GnuAttributeList(GnuAttributeAST *value, GnuAttributeListAST *next = nullptr)
{
GnuAttributeListAST *list = new (&pool) GnuAttributeListAST;
list->next = next;
@@ -1253,7 +1253,7 @@ public:
return list;
}
MemInitializerListAST *MemInitializerList(MemInitializerAST *value, MemInitializerListAST *next = 0)
MemInitializerListAST *MemInitializerList(MemInitializerAST *value, MemInitializerListAST *next = nullptr)
{
MemInitializerListAST *list = new (&pool) MemInitializerListAST;
list->next = next;
@@ -1261,7 +1261,7 @@ public:
return list;
}
NameListAST *NameList(NameAST *value, NameListAST *next = 0)
NameListAST *NameList(NameAST *value, NameListAST *next = nullptr)
{
NameListAST *list = new (&pool) NameListAST;
list->next = next;
@@ -1269,7 +1269,7 @@ public:
return list;
}
NestedNameSpecifierListAST *NestedNameSpecifierList(NestedNameSpecifierAST *value, NestedNameSpecifierListAST *next = 0)
NestedNameSpecifierListAST *NestedNameSpecifierList(NestedNameSpecifierAST *value, NestedNameSpecifierListAST *next = nullptr)
{
NestedNameSpecifierListAST *list = new (&pool) NestedNameSpecifierListAST;
list->next = next;
@@ -1277,7 +1277,7 @@ public:
return list;
}
NewArrayDeclaratorListAST *NewArrayDeclaratorList(NewArrayDeclaratorAST *value, NewArrayDeclaratorListAST *next = 0)
NewArrayDeclaratorListAST *NewArrayDeclaratorList(NewArrayDeclaratorAST *value, NewArrayDeclaratorListAST *next = nullptr)
{
NewArrayDeclaratorListAST *list = new (&pool) NewArrayDeclaratorListAST;
list->next = next;
@@ -1285,7 +1285,7 @@ public:
return list;
}
ObjCMessageArgumentDeclarationListAST *ObjCMessageArgumentDeclarationList(ObjCMessageArgumentDeclarationAST *value, ObjCMessageArgumentDeclarationListAST *next = 0)
ObjCMessageArgumentDeclarationListAST *ObjCMessageArgumentDeclarationList(ObjCMessageArgumentDeclarationAST *value, ObjCMessageArgumentDeclarationListAST *next = nullptr)
{
ObjCMessageArgumentDeclarationListAST *list = new (&pool) ObjCMessageArgumentDeclarationListAST;
list->next = next;
@@ -1293,7 +1293,7 @@ public:
return list;
}
ObjCMessageArgumentListAST *ObjCMessageArgumentList(ObjCMessageArgumentAST *value, ObjCMessageArgumentListAST *next = 0)
ObjCMessageArgumentListAST *ObjCMessageArgumentList(ObjCMessageArgumentAST *value, ObjCMessageArgumentListAST *next = nullptr)
{
ObjCMessageArgumentListAST *list = new (&pool) ObjCMessageArgumentListAST;
list->next = next;
@@ -1301,7 +1301,7 @@ public:
return list;
}
ObjCPropertyAttributeListAST *ObjCPropertyAttributeList(ObjCPropertyAttributeAST *value, ObjCPropertyAttributeListAST *next = 0)
ObjCPropertyAttributeListAST *ObjCPropertyAttributeList(ObjCPropertyAttributeAST *value, ObjCPropertyAttributeListAST *next = nullptr)
{
ObjCPropertyAttributeListAST *list = new (&pool) ObjCPropertyAttributeListAST;
list->next = next;
@@ -1309,7 +1309,7 @@ public:
return list;
}
ObjCSelectorArgumentListAST *ObjCSelectorArgumentList(ObjCSelectorArgumentAST *value, ObjCSelectorArgumentListAST *next = 0)
ObjCSelectorArgumentListAST *ObjCSelectorArgumentList(ObjCSelectorArgumentAST *value, ObjCSelectorArgumentListAST *next = nullptr)
{
ObjCSelectorArgumentListAST *list = new (&pool) ObjCSelectorArgumentListAST;
list->next = next;
@@ -1317,7 +1317,7 @@ public:
return list;
}
ObjCSynthesizedPropertyListAST *ObjCSynthesizedPropertyList(ObjCSynthesizedPropertyAST *value, ObjCSynthesizedPropertyListAST *next = 0)
ObjCSynthesizedPropertyListAST *ObjCSynthesizedPropertyList(ObjCSynthesizedPropertyAST *value, ObjCSynthesizedPropertyListAST *next = nullptr)
{
ObjCSynthesizedPropertyListAST *list = new (&pool) ObjCSynthesizedPropertyListAST;
list->next = next;
@@ -1325,7 +1325,7 @@ public:
return list;
}
ParameterDeclarationListAST *ParameterDeclarationList(ParameterDeclarationAST *value, ParameterDeclarationListAST *next = 0)
ParameterDeclarationListAST *ParameterDeclarationList(ParameterDeclarationAST *value, ParameterDeclarationListAST *next = nullptr)
{
ParameterDeclarationListAST *list = new (&pool) ParameterDeclarationListAST;
list->next = next;
@@ -1333,7 +1333,7 @@ public:
return list;
}
PostfixDeclaratorListAST *PostfixDeclaratorList(PostfixDeclaratorAST *value, PostfixDeclaratorListAST *next = 0)
PostfixDeclaratorListAST *PostfixDeclaratorList(PostfixDeclaratorAST *value, PostfixDeclaratorListAST *next = nullptr)
{
PostfixDeclaratorListAST *list = new (&pool) PostfixDeclaratorListAST;
list->next = next;
@@ -1341,7 +1341,7 @@ public:
return list;
}
PtrOperatorListAST *PtrOperatorList(PtrOperatorAST *value, PtrOperatorListAST *next = 0)
PtrOperatorListAST *PtrOperatorList(PtrOperatorAST *value, PtrOperatorListAST *next = nullptr)
{
PtrOperatorListAST *list = new (&pool) PtrOperatorListAST;
list->next = next;
@@ -1349,7 +1349,7 @@ public:
return list;
}
QtInterfaceNameListAST *QtInterfaceNameList(QtInterfaceNameAST *value, QtInterfaceNameListAST *next = 0)
QtInterfaceNameListAST *QtInterfaceNameList(QtInterfaceNameAST *value, QtInterfaceNameListAST *next = nullptr)
{
QtInterfaceNameListAST *list = new (&pool) QtInterfaceNameListAST;
list->next = next;
@@ -1357,7 +1357,7 @@ public:
return list;
}
QtPropertyDeclarationItemListAST *QtPropertyDeclarationItemList(QtPropertyDeclarationItemAST *value, QtPropertyDeclarationItemListAST *next = 0)
QtPropertyDeclarationItemListAST *QtPropertyDeclarationItemList(QtPropertyDeclarationItemAST *value, QtPropertyDeclarationItemListAST *next = nullptr)
{
QtPropertyDeclarationItemListAST *list = new (&pool) QtPropertyDeclarationItemListAST;
list->next = next;
@@ -1365,7 +1365,7 @@ public:
return list;
}
SpecifierListAST *SpecifierList(SpecifierAST *value, SpecifierListAST *next = 0)
SpecifierListAST *SpecifierList(SpecifierAST *value, SpecifierListAST *next = nullptr)
{
SpecifierListAST *list = new (&pool) SpecifierListAST;
list->next = next;
@@ -1373,7 +1373,7 @@ public:
return list;
}
StatementListAST *StatementList(StatementAST *value, StatementListAST *next = 0)
StatementListAST *StatementList(StatementAST *value, StatementListAST *next = nullptr)
{
StatementListAST *list = new (&pool) StatementListAST;
list->next = next;

View File

@@ -40,7 +40,7 @@ Control *ASTVisitor::control() const
if (_translationUnit)
return _translationUnit->control();
return 0;
return nullptr;
}
TranslationUnit *ASTVisitor::translationUnit() const

View File

@@ -42,10 +42,10 @@ const int Bind::kMaxDepth(100);
Bind::Bind(TranslationUnit *unit)
: ASTVisitor(unit),
_scope(0),
_expression(0),
_name(0),
_declaratorId(0),
_scope(nullptr),
_expression(nullptr),
_name(nullptr),
_declaratorId(nullptr),
_visibility(Symbol::Public),
_objcVisibility(Symbol::Public),
_methodKey(Function::NormalMethod),
@@ -229,7 +229,7 @@ void Bind::declaration(DeclarationAST *ast)
const Name *Bind::name(NameAST *ast)
{
const Name *value = 0;
const Name *value = nullptr;
std::swap(_name, value);
accept(ast);
std::swap(_name, value);
@@ -296,7 +296,7 @@ bool Bind::visit(ObjCSelectorArgumentAST *ast)
const Name *Bind::objCSelectorArgument(ObjCSelectorArgumentAST *ast, bool *hasArg)
{
if (! (ast && ast->name_token))
return 0;
return nullptr;
if (ast->colon_token)
*hasArg = true;
@@ -531,7 +531,7 @@ const StringLiteral *valueOfEnumerator(const Enum *e, const Identifier *value) {
}
}
}
return 0;
return nullptr;
}
} // anonymous namespace
@@ -556,7 +556,7 @@ void Bind::enumerator(EnumeratorAST *ast, Enum *symbol)
const int firstToken = expr->firstToken();
const int lastToken = expr->lastToken();
const StringLiteral *constantValue = asStringLiteral(expr);
const StringLiteral *resolvedValue = 0;
const StringLiteral *resolvedValue = nullptr;
if (lastToken - firstToken == 1) {
if (const Identifier *constantId = identifier(firstToken))
resolvedValue = valueOfEnumerator(symbol, constantId);
@@ -629,7 +629,7 @@ bool Bind::visit(NestedNameSpecifierAST *ast)
const Name *Bind::nestedNameSpecifier(NestedNameSpecifierAST *ast)
{
if (! ast)
return 0;
return nullptr;
const Name *class_or_namespace_name = this->name(ast->class_or_namespace_name);
return class_or_namespace_name;
@@ -1070,7 +1070,7 @@ bool Bind::visit(ObjCMethodPrototypeAST *ast)
ObjCMethod *Bind::objCMethodPrototype(ObjCMethodPrototypeAST *ast)
{
if (! ast)
return 0;
return nullptr;
// int method_type_token = ast->method_type_token;
FullySpecifiedType returnType = this->objCTypeName(ast->type_name);
@@ -1180,9 +1180,9 @@ bool Bind::visit(LambdaDeclaratorAST *ast)
Function *Bind::lambdaDeclarator(LambdaDeclaratorAST *ast)
{
if (! ast)
return 0;
return nullptr;
Function *fun = control()->newFunction(0, 0);
Function *fun = control()->newFunction(0, nullptr);
fun->setStartOffset(tokenAt(ast->firstToken()).utf16charsBegin());
fun->setEndOffset(tokenAt(ast->lastToken() - 1).utf16charsEnd());
@@ -1227,14 +1227,14 @@ FullySpecifiedType Bind::trailingReturnType(TrailingReturnTypeAST *ast, const Fu
for (SpecifierListAST *it = ast->type_specifier_list; it; it = it->next) {
type = this->specifier(it->value, type);
}
DeclaratorIdAST *declaratorId = 0;
DeclaratorIdAST *declaratorId = nullptr;
type = this->declarator(ast->declarator, type, &declaratorId);
return type;
}
const StringLiteral *Bind::asStringLiteral(const ExpressionAST *ast)
{
CPP_ASSERT(ast, return 0);
CPP_ASSERT(ast, return nullptr);
const int firstToken = ast->firstToken();
const int lastToken = ast->lastToken();
std::string buffer;
@@ -1250,7 +1250,7 @@ const StringLiteral *Bind::asStringLiteral(const ExpressionAST *ast)
// StatementAST
bool Bind::visit(QtMemberDeclarationAST *ast)
{
const Name *name = 0;
const Name *name = nullptr;
if (tokenKind(ast->q_token) == T_Q_D)
name = control()->identifier("d");
@@ -1344,18 +1344,18 @@ bool Bind::visit(ForeachStatementAST *ast)
for (SpecifierListAST *it = ast->type_specifier_list; it; it = it->next) {
type = this->specifier(it->value, type);
}
DeclaratorIdAST *declaratorId = 0;
DeclaratorIdAST *declaratorId = nullptr;
type = this->declarator(ast->declarator, type, &declaratorId);
const StringLiteral *initializer = 0;
const StringLiteral *initializer = nullptr;
if (type.isAuto() && translationUnit()->languageFeatures().cxx11Enabled) {
ExpressionTy exprType = this->expression(ast->expression);
ArrayType* arrayType = 0;
ArrayType* arrayType = nullptr;
arrayType = exprType->asArrayType();
if (arrayType != 0)
if (arrayType != nullptr)
type = arrayType->elementType();
else if (ast->expression != 0) {
else if (ast->expression != nullptr) {
const StringLiteral *sl = asStringLiteral(ast->expression);
const std::string buff = std::string("*") + sl->chars() + ".begin()";
initializer = control()->stringLiteral(buff.c_str(), int(buff.size()));
@@ -1392,18 +1392,18 @@ bool Bind::visit(RangeBasedForStatementAST *ast)
for (SpecifierListAST *it = ast->type_specifier_list; it; it = it->next) {
type = this->specifier(it->value, type);
}
DeclaratorIdAST *declaratorId = 0;
DeclaratorIdAST *declaratorId = nullptr;
type = this->declarator(ast->declarator, type, &declaratorId);
const StringLiteral *initializer = 0;
const StringLiteral *initializer = nullptr;
if (type.isAuto() && translationUnit()->languageFeatures().cxx11Enabled) {
ExpressionTy exprType = this->expression(ast->expression);
ArrayType* arrayType = 0;
ArrayType* arrayType = nullptr;
arrayType = exprType->asArrayType();
if (arrayType != 0)
if (arrayType != nullptr)
type = arrayType->elementType();
else if (ast->expression != 0) {
else if (ast->expression != nullptr) {
const StringLiteral *sl = asStringLiteral(ast->expression);
const std::string buff = std::string("*") + sl->chars() + ".begin()";
initializer = control()->stringLiteral(buff.c_str(), int(buff.size()));
@@ -1573,7 +1573,7 @@ bool Bind::visit(ObjCFastEnumerationAST *ast)
for (SpecifierListAST *it = ast->type_specifier_list; it; it = it->next) {
type = this->specifier(it->value, type);
}
DeclaratorIdAST *declaratorId = 0;
DeclaratorIdAST *declaratorId = nullptr;
type = this->declarator(ast->declarator, type, &declaratorId);
if (declaratorId && declaratorId->name) {
@@ -1630,7 +1630,7 @@ bool Bind::visit(QtMethodAST *ast)
// int method_token = ast->method_token;
// int lparen_token = ast->lparen_token;
FullySpecifiedType type;
DeclaratorIdAST *declaratorId = 0;
DeclaratorIdAST *declaratorId = nullptr;
type = this->declarator(ast->declarator, type, &declaratorId);
// int rparen_token = ast->rparen_token;
return false;
@@ -1659,7 +1659,7 @@ bool Bind::visit(ConditionAST *ast)
for (SpecifierListAST *it = ast->type_specifier_list; it; it = it->next) {
type = this->specifier(it->value, type);
}
DeclaratorIdAST *declaratorId = 0;
DeclaratorIdAST *declaratorId = nullptr;
type = this->declarator(ast->declarator, type, &declaratorId);
if (declaratorId && declaratorId->name) {
@@ -1824,7 +1824,7 @@ bool Bind::visit(TypeIdAST *ast)
for (SpecifierListAST *it = ast->type_specifier_list; it; it = it->next) {
type = this->specifier(it->value, type);
}
DeclaratorIdAST *declaratorId = 0;
DeclaratorIdAST *declaratorId = nullptr;
type = this->declarator(ast->declarator, type, &declaratorId);
_expression = type;
return false;
@@ -1929,13 +1929,13 @@ bool Bind::visit(SimpleDeclarationAST *ast)
List<Symbol *> **symbolTail = &ast->symbols;
if (! ast->declarator_list) {
ElaboratedTypeSpecifierAST *elabTypeSpec = 0;
ElaboratedTypeSpecifierAST *elabTypeSpec = nullptr;
for (SpecifierListAST *it = ast->decl_specifier_list; ! elabTypeSpec && it; it = it->next)
elabTypeSpec = it->value->asElaboratedTypeSpecifier();
if (elabTypeSpec && tokenKind(elabTypeSpec->classkey_token) != T_TYPENAME) {
int sourceLocation = elabTypeSpec->firstToken();
const Name *name = 0;
const Name *name = nullptr;
if (elabTypeSpec->name) {
sourceLocation = location(elabTypeSpec->name, sourceLocation);
name = elabTypeSpec->name->name;
@@ -1953,10 +1953,10 @@ bool Bind::visit(SimpleDeclarationAST *ast)
}
for (DeclaratorListAST *it = ast->declarator_list; it; it = it->next) {
DeclaratorIdAST *declaratorId = 0;
DeclaratorIdAST *declaratorId = nullptr;
FullySpecifiedType declTy = this->declarator(it->value, type, &declaratorId);
const Name *declName = 0;
const Name *declName = nullptr;
int sourceLocation = location(it->value, ast->firstToken());
if (declaratorId && declaratorId->name)
declName = declaratorId->name->name;
@@ -2050,7 +2050,7 @@ bool Bind::visit(QtPrivateSlotAST *ast)
for (SpecifierListAST *it = ast->type_specifier_list; it; it = it->next) {
type = this->specifier(it->value, type);
}
DeclaratorIdAST *declaratorId = 0;
DeclaratorIdAST *declaratorId = nullptr;
type = this->declarator(ast->declarator, type, &declaratorId);
// int rparen_token = ast->rparen_token;
return false;
@@ -2208,10 +2208,10 @@ bool Bind::visit(ExceptionDeclarationAST *ast)
for (SpecifierListAST *it = ast->type_specifier_list; it; it = it->next) {
type = this->specifier(it->value, type);
}
DeclaratorIdAST *declaratorId = 0;
DeclaratorIdAST *declaratorId = nullptr;
type = this->declarator(ast->declarator, type, &declaratorId);
const Name *argName = 0;
const Name *argName = nullptr;
if (declaratorId && declaratorId->name)
argName = declaratorId->name->name;
Argument *arg = control()->newArgument(location(declaratorId, ast->firstToken()), argName);
@@ -2233,7 +2233,7 @@ bool Bind::visit(FunctionDefinitionAST *ast)
for (SpecifierListAST *it = ast->decl_specifier_list; it; it = it->next) {
declSpecifiers = this->specifier(it->value, declSpecifiers);
}
DeclaratorIdAST *declaratorId = 0;
DeclaratorIdAST *declaratorId = nullptr;
FullySpecifiedType type = this->declarator(ast->declarator, declSpecifiers.qualifiedType(), &declaratorId);
Function *fun = type->asFunctionType();
@@ -2296,7 +2296,7 @@ bool Bind::visit(NamespaceAST *ast)
}
int sourceLocation = ast->firstToken();
const Name *namespaceName = 0;
const Name *namespaceName = nullptr;
if (ast->identifier_token) {
sourceLocation = ast->identifier_token;
namespaceName = identifier(ast->identifier_token);
@@ -2318,7 +2318,7 @@ bool Bind::visit(NamespaceAST *ast)
bool Bind::visit(NamespaceAliasDefinitionAST *ast)
{
int sourceLocation = ast->firstToken();
const Name *name = 0;
const Name *name = nullptr;
if (ast->namespace_name_token) {
sourceLocation = ast->namespace_name_token;
name = identifier(ast->namespace_name_token);
@@ -2336,12 +2336,12 @@ bool Bind::visit(ParameterDeclarationAST *ast)
for (SpecifierListAST *it = ast->type_specifier_list; it; it = it->next) {
type = this->specifier(it->value, type);
}
DeclaratorIdAST *declaratorId = 0;
DeclaratorIdAST *declaratorId = nullptr;
type = this->declarator(ast->declarator, type, &declaratorId);
// int equal_token = ast->equal_token;
ExpressionTy expression = this->expression(ast->expression);
const Name *argName = 0;
const Name *argName = nullptr;
if (declaratorId && declaratorId->name)
argName = declaratorId->name->name;
@@ -2359,7 +2359,7 @@ bool Bind::visit(ParameterDeclarationAST *ast)
bool Bind::visit(TemplateDeclarationAST *ast)
{
Template *templ = control()->newTemplate(ast->firstToken(), 0);
Template *templ = control()->newTemplate(ast->firstToken(), nullptr);
templ->setStartOffset(tokenAt(ast->firstToken()).utf16charsBegin());
templ->setEndOffset(tokenAt(ast->lastToken() - 1).utf16charsEnd());
ast->symbol = templ;
@@ -3136,7 +3136,7 @@ bool Bind::visit(EnumSpecifierAST *ast)
// PtrOperatorAST
bool Bind::visit(PointerToMemberAST *ast)
{
const Name *memberName = 0;
const Name *memberName = nullptr;
for (NestedNameSpecifierListAST *it = ast->nested_name_specifier_list; it; it = it->next) {
const Name *class_or_namespace_name = this->nestedNameSpecifier(it->value);
@@ -3236,7 +3236,7 @@ bool Bind::visit(NestedDeclaratorAST *ast)
// PostfixDeclaratorAST
bool Bind::visit(FunctionDeclaratorAST *ast)
{
Function *fun = control()->newFunction(0, 0);
Function *fun = control()->newFunction(0, nullptr);
fun->setStartOffset(tokenAt(ast->firstToken()).utf16charsBegin());
fun->setEndOffset(tokenAt(ast->lastToken() - 1).utf16charsEnd());
if (ast->trailing_return_type)
@@ -3266,7 +3266,7 @@ bool Bind::visit(FunctionDeclaratorAST *ast)
}
this->exceptionSpecification(ast->exception_specification, type);
if (ast->as_cpp_initializer != 0) {
if (ast->as_cpp_initializer != nullptr) {
fun->setAmbiguous(true);
/*ExpressionTy as_cpp_initializer =*/ this->expression(ast->as_cpp_initializer);
}

View File

@@ -209,21 +209,21 @@ class Control::Data
public:
Data(Control *control)
: control(control)
, translationUnit(0)
, diagnosticClient(0)
, deprecatedId(0)
, unavailableId(0)
, objcGetterId(0)
, objcSetterId(0)
, objcReadwriteId(0)
, objcReadonlyId(0)
, objcAssignId(0)
, objcRetainId(0)
, objcCopyId(0)
, objcNonatomicId(0)
, cpp11Override(0)
, cpp11Final(0)
, processor(0)
, translationUnit(nullptr)
, diagnosticClient(nullptr)
, deprecatedId(nullptr)
, unavailableId(nullptr)
, objcGetterId(nullptr)
, objcSetterId(nullptr)
, objcReadwriteId(nullptr)
, objcReadonlyId(nullptr)
, objcAssignId(nullptr)
, objcRetainId(nullptr)
, objcCopyId(nullptr)
, objcNonatomicId(nullptr)
, cpp11Override(nullptr)
, cpp11Final(nullptr)
, processor(nullptr)
{}
~Data()
@@ -574,7 +574,7 @@ const OperatorNameId *Control::findOperatorNameId(OperatorNameId::Kind operatorI
{
Table<OperatorNameId>::const_iterator i = d->operatorNameIds.find(operatorId);
if (i == d->operatorNameIds.end())
return 0;
return nullptr;
else
return &*i;
}
@@ -798,7 +798,7 @@ const Identifier *Control::cpp11Final() const
Symbol **Control::firstSymbol() const
{
if (d->symbols.empty())
return 0;
return nullptr;
return &*d->symbols.begin();
}
@@ -806,7 +806,7 @@ Symbol **Control::firstSymbol() const
Symbol **Control::lastSymbol() const
{
if (d->symbols.empty())
return 0;
return nullptr;
return &*d->symbols.begin() + d->symbols.size();
}

View File

@@ -54,7 +54,7 @@ public:
/// Returns the canonical template name id.
const TemplateNameId *templateNameId(const Identifier *id,
bool isSpecialization,
const FullySpecifiedType *const args = 0,
const FullySpecifiedType *const args = nullptr,
int argc = 0);
/// Returns the canonical destructor name id.
@@ -105,67 +105,67 @@ public:
EnumeratorDeclaration *newEnumeratorDeclaration(int sourceLocation, const Name *name);
/// Creates a new Argument symbol.
Argument *newArgument(int sourceLocation, const Name *name = 0);
Argument *newArgument(int sourceLocation, const Name *name = nullptr);
/// Creates a new Argument symbol.
TypenameArgument *newTypenameArgument(int sourceLocation, const Name *name = 0);
TypenameArgument *newTypenameArgument(int sourceLocation, const Name *name = nullptr);
/// Creates a new Function symbol.
Function *newFunction(int sourceLocation, const Name *name = 0);
Function *newFunction(int sourceLocation, const Name *name = nullptr);
/// Creates a new Namespace symbol.
Namespace *newNamespace(int sourceLocation, const Name *name = 0);
Namespace *newNamespace(int sourceLocation, const Name *name = nullptr);
/// Creates a new Template symbol.
Template *newTemplate(int sourceLocation, const Name *name = 0);
Template *newTemplate(int sourceLocation, const Name *name = nullptr);
/// Creates a new Namespace symbol.
NamespaceAlias *newNamespaceAlias(int sourceLocation, const Name *name = 0);
NamespaceAlias *newNamespaceAlias(int sourceLocation, const Name *name = nullptr);
/// Creates a new BaseClass symbol.
BaseClass *newBaseClass(int sourceLocation, const Name *name = 0);
BaseClass *newBaseClass(int sourceLocation, const Name *name = nullptr);
/// Creates a new Class symbol.
Class *newClass(int sourceLocation, const Name *name = 0);
Class *newClass(int sourceLocation, const Name *name = nullptr);
/// Creates a new Enum symbol.
Enum *newEnum(int sourceLocation, const Name *name = 0);
Enum *newEnum(int sourceLocation, const Name *name = nullptr);
/// Creates a new Block symbol.
Block *newBlock(int sourceLocation);
/// Creates a new UsingNamespaceDirective symbol.
UsingNamespaceDirective *newUsingNamespaceDirective(int sourceLocation, const Name *name = 0);
UsingNamespaceDirective *newUsingNamespaceDirective(int sourceLocation, const Name *name = nullptr);
/// Creates a new UsingDeclaration symbol.
UsingDeclaration *newUsingDeclaration(int sourceLocation, const Name *name = 0);
UsingDeclaration *newUsingDeclaration(int sourceLocation, const Name *name = nullptr);
/// Creates a new ForwardClassDeclaration symbol.
ForwardClassDeclaration *newForwardClassDeclaration(int sourceLocation, const Name *name = 0);
ForwardClassDeclaration *newForwardClassDeclaration(int sourceLocation, const Name *name = nullptr);
/// Creates a new QtPropertyDeclaration symbol.
QtPropertyDeclaration *newQtPropertyDeclaration(int sourceLocation, const Name *name = 0);
QtPropertyDeclaration *newQtPropertyDeclaration(int sourceLocation, const Name *name = nullptr);
/// Creates a new QtEnum symbol.
QtEnum *newQtEnum(int sourceLocation, const Name *name = 0);
QtEnum *newQtEnum(int sourceLocation, const Name *name = nullptr);
ObjCBaseClass *newObjCBaseClass(int sourceLocation, const Name *name);
ObjCBaseProtocol *newObjCBaseProtocol(int sourceLocation, const Name *name);
/// Creates a new Objective-C class symbol.
ObjCClass *newObjCClass(int sourceLocation, const Name *name = 0);
ObjCClass *newObjCClass(int sourceLocation, const Name *name = nullptr);
/// Creates a new Objective-C class forward declaration symbol.
ObjCForwardClassDeclaration *newObjCForwardClassDeclaration(int sourceLocation, const Name *name = 0);
ObjCForwardClassDeclaration *newObjCForwardClassDeclaration(int sourceLocation, const Name *name = nullptr);
/// Creates a new Objective-C protocol symbol.
ObjCProtocol *newObjCProtocol(int sourceLocation, const Name *name = 0);
ObjCProtocol *newObjCProtocol(int sourceLocation, const Name *name = nullptr);
/// Creates a new Objective-C protocol forward declaration symbol.
ObjCForwardProtocolDeclaration *newObjCForwardProtocolDeclaration(int sourceLocation, const Name *name = 0);
ObjCForwardProtocolDeclaration *newObjCForwardProtocolDeclaration(int sourceLocation, const Name *name = nullptr);
/// Creates a new Objective-C method symbol.
ObjCMethod *newObjCMethod(int sourceLocation, const Name *name = 0);
ObjCMethod *newObjCMethod(int sourceLocation, const Name *name = nullptr);
/// Creates a new Objective-C @property declaration symbol.
ObjCPropertyDeclaration *newObjCPropertyDeclaration(int sourceLocation, const Name *name);

View File

@@ -28,7 +28,7 @@ namespace CPlusPlus {
class CPLUSPLUS_EXPORT FullySpecifiedType
{
public:
FullySpecifiedType(Type *type = 0);
FullySpecifiedType(Type *type = nullptr);
~FullySpecifiedType();
bool isValid() const;
@@ -103,7 +103,7 @@ public:
bool operator != (const FullySpecifiedType &other) const;
bool operator < (const FullySpecifiedType &other) const;
bool match(const FullySpecifiedType &otherTy, Matcher *matcher = 0) const;
bool match(const FullySpecifiedType &otherTy, Matcher *matcher = nullptr) const;
FullySpecifiedType simplified() const;

View File

@@ -64,8 +64,8 @@ Lexer::Lexer(TranslationUnit *unit)
}
Lexer::Lexer(const char *firstChar, const char *lastChar)
: _translationUnit(0),
_control(0),
: _translationUnit(nullptr),
_control(nullptr),
_state(0),
_flags(0),
_currentLine(1)
@@ -747,7 +747,7 @@ void Lexer::scanRawStringLiteral(Token *tok, unsigned char hint)
const char *yytext = _currentChar;
int delimLength = -1;
const char *closingDelimCandidate = 0;
const char *closingDelimCandidate = nullptr;
bool closed = false;
while (_yychar) {
if (_yychar == '(' && delimLength == -1) {
@@ -781,7 +781,7 @@ void Lexer::scanRawStringLiteral(Token *tok, unsigned char hint)
// Make sure this continues to be a valid candidate.
if (_yychar != *(yytext + (_currentChar - closingDelimCandidate)))
closingDelimCandidate = 0;
closingDelimCandidate = nullptr;
yyinp();
}

View File

@@ -36,8 +36,8 @@ public:
public:
LiteralTable()
: _literals(0),
_buckets(0),
: _literals(nullptr),
_buckets(nullptr),
_allocatedLiterals(0),
_literalCount(-1),
_allocatedBuckets(0)
@@ -59,8 +59,8 @@ public:
if (_buckets)
std::free(_buckets);
_literals = 0;
_buckets = 0;
_literals = nullptr;
_buckets = nullptr;
_allocatedLiterals = 0;
_literalCount = -1;
_allocatedBuckets = 0;
@@ -92,7 +92,7 @@ public:
}
}
return 0;
return nullptr;
}
const Literal *findOrInsertLiteral(const char *chars, int size)

View File

@@ -29,7 +29,7 @@ using namespace CPlusPlus;
////////////////////////////////////////////////////////////////////////////////
Literal::Literal(const char *chars, int size)
: _next(0), _index(0)
: _next(nullptr), _index(0)
{
_chars = new char[size + 1];

View File

@@ -38,8 +38,8 @@ public:
Matcher();
virtual ~Matcher();
static bool match(const Type *type, const Type *otherType, Matcher *matcher = 0);
static bool match(const Name *name, const Name *otherName, Matcher *matcher = 0);
static bool match(const Type *type, const Type *otherType, Matcher *matcher = nullptr);
static bool match(const Name *name, const Name *otherName, Matcher *matcher = nullptr);
virtual bool match(const UndefinedType *type, const UndefinedType *otherType);
virtual bool match(const VoidType *type, const VoidType *otherType);

View File

@@ -27,11 +27,11 @@
using namespace CPlusPlus;
MemoryPool::MemoryPool()
: _blocks(0),
: _blocks(nullptr),
_allocatedBlocks(0),
_blockCount(-1),
_ptr(0),
_end(0)
_ptr(nullptr),
_end(nullptr)
{ }
MemoryPool::~MemoryPool()
@@ -49,7 +49,7 @@ MemoryPool::~MemoryPool()
void MemoryPool::reset()
{
_blockCount = -1;
_ptr = _end = 0;
_ptr = _end = nullptr;
}
void *MemoryPool::allocate_helper(size_t size)
@@ -65,7 +65,7 @@ void *MemoryPool::allocate_helper(size_t size)
_blocks = (char **) realloc(_blocks, sizeof(char *) * _allocatedBlocks);
for (int index = _blockCount; index < _allocatedBlocks; ++index)
_blocks[index] = 0;
_blocks[index] = nullptr;
}
char *&block = _blocks[_blockCount];

View File

@@ -35,28 +35,28 @@ Name::~Name()
{ }
bool Name::isNameId() const
{ return asNameId() != 0; }
{ return asNameId() != nullptr; }
bool Name::isAnonymousNameId() const
{ return asAnonymousNameId() != 0; }
{ return asAnonymousNameId() != nullptr; }
bool Name::isTemplateNameId() const
{ return asTemplateNameId() != 0; }
{ return asTemplateNameId() != nullptr; }
bool Name::isDestructorNameId() const
{ return asDestructorNameId() != 0; }
{ return asDestructorNameId() != nullptr; }
bool Name::isOperatorNameId() const
{ return asOperatorNameId() != 0; }
{ return asOperatorNameId() != nullptr; }
bool Name::isConversionNameId() const
{ return asConversionNameId() != 0; }
{ return asConversionNameId() != nullptr; }
bool Name::isQualifiedNameId() const
{ return asQualifiedNameId() != 0; }
{ return asQualifiedNameId() != nullptr; }
bool Name::isSelectorNameId() const
{ return asSelectorNameId() != 0; }
{ return asSelectorNameId() != nullptr; }
void Name::accept(NameVisitor *visitor) const
{
@@ -79,9 +79,9 @@ bool Name::match(const Name *other, Matcher *matcher) const
bool Name::Compare::operator()(const Name *name, const Name *other) const
{
if (name == 0)
return other != 0;
if (other == 0)
if (name == nullptr)
return other != nullptr;
if (other == nullptr)
return false;
if (name == other)
return false;
@@ -89,9 +89,9 @@ bool Name::Compare::operator()(const Name *name, const Name *other) const
const Identifier *id = name->identifier();
const Identifier *otherId = other->identifier();
if (id == 0)
return otherId != 0;
if (otherId == 0)
if (id == nullptr)
return otherId != nullptr;
if (otherId == nullptr)
return false;
return std::strcmp(id->chars(), otherId->chars()) < 0;

View File

@@ -44,19 +44,19 @@ public:
bool isQualifiedNameId() const;
bool isSelectorNameId() const;
virtual const Identifier *asNameId() const { return 0; }
virtual const AnonymousNameId *asAnonymousNameId() const { return 0; }
virtual const TemplateNameId *asTemplateNameId() const { return 0; }
virtual const DestructorNameId *asDestructorNameId() const { return 0; }
virtual const OperatorNameId *asOperatorNameId() const { return 0; }
virtual const ConversionNameId *asConversionNameId() const { return 0; }
virtual const QualifiedNameId *asQualifiedNameId() const { return 0; }
virtual const SelectorNameId *asSelectorNameId() const { return 0; }
virtual const Identifier *asNameId() const { return nullptr; }
virtual const AnonymousNameId *asAnonymousNameId() const { return nullptr; }
virtual const TemplateNameId *asTemplateNameId() const { return nullptr; }
virtual const DestructorNameId *asDestructorNameId() const { return nullptr; }
virtual const OperatorNameId *asOperatorNameId() const { return nullptr; }
virtual const ConversionNameId *asConversionNameId() const { return nullptr; }
virtual const QualifiedNameId *asQualifiedNameId() const { return nullptr; }
virtual const SelectorNameId *asSelectorNameId() const { return nullptr; }
void accept(NameVisitor *visitor) const;
static void accept(const Name *name, NameVisitor *visitor);
bool match(const Name *other, Matcher *matcher = 0) const;
bool match(const Name *other, Matcher *matcher = nullptr) const;
public:
struct Compare {

View File

@@ -45,7 +45,7 @@ const Identifier *QualifiedNameId::identifier() const
if (const Name *u = name())
return u->identifier();
return 0;
return nullptr;
}
const Name *QualifiedNameId::base() const
@@ -102,9 +102,9 @@ const FullySpecifiedType &TemplateNameId::templateArgumentAt(int index) const
bool TemplateNameId::Compare::operator()(const TemplateNameId *name,
const TemplateNameId *other) const
{
if (name == 0)
return other != 0;
if (other == 0)
if (name == nullptr)
return other != nullptr;
if (other == nullptr)
return false;
if (name == other)
return false;
@@ -112,9 +112,9 @@ bool TemplateNameId::Compare::operator()(const TemplateNameId *name,
const Identifier *id = name->identifier();
const Identifier *otherId = other->identifier();
if (id == 0)
return otherId != 0;
if (otherId == 0)
if (id == nullptr)
return otherId != nullptr;
if (otherId == nullptr)
return false;
const int c = std::strcmp(id->chars(), otherId->chars());
@@ -154,7 +154,7 @@ OperatorNameId::Kind OperatorNameId::kind() const
{ return _kind; }
const Identifier *OperatorNameId::identifier() const
{ return 0; }
{ return nullptr; }
ConversionNameId::ConversionNameId(const FullySpecifiedType &type)
: _type(type)
@@ -177,7 +177,7 @@ FullySpecifiedType ConversionNameId::type() const
{ return _type; }
const Identifier *ConversionNameId::identifier() const
{ return 0; }
{ return nullptr; }
SelectorNameId::~SelectorNameId()
{ }
@@ -195,7 +195,7 @@ bool SelectorNameId::match0(const Name *otherName, Matcher *matcher) const
const Identifier *SelectorNameId::identifier() const
{
if (_names.empty())
return 0;
return nullptr;
return nameAt(0)->identifier();
}
@@ -232,4 +232,4 @@ bool AnonymousNameId::match0(const Name *otherName, Matcher *matcher) const
}
const Identifier *AnonymousNameId::identifier() const
{ return 0; }
{ return nullptr; }

File diff suppressed because it is too large Load Diff

View File

@@ -76,10 +76,10 @@ public:
bool parseOverrideFinalQualifiers(SpecifierListAST *&node);
bool parseDeclaratorOrAbstractDeclarator(DeclaratorAST *&node, SpecifierListAST *decl_specifier_list);
bool parseDeclaration(DeclarationAST *&node);
bool parseSimpleDeclaration(DeclarationAST *&node, ClassSpecifierAST *declaringClass = 0);
bool parseSimpleDeclaration(DeclarationAST *&node, ClassSpecifierAST *declaringClass = nullptr);
bool parseDeclarationStatement(StatementAST *&node);
bool parseCoreDeclarator(DeclaratorAST *&node, SpecifierListAST *decl_specifier_list, ClassSpecifierAST *declaringClass);
bool parseDeclarator(DeclaratorAST *&node, SpecifierListAST *decl_specifier_list, ClassSpecifierAST *declaringClass = 0);
bool parseDeclarator(DeclaratorAST *&node, SpecifierListAST *decl_specifier_list, ClassSpecifierAST *declaringClass = nullptr);
bool parseDeleteExpression(ExpressionAST *&node);
bool parseDoStatement(StatementAST *&node);
bool parseElaboratedTypeSpecifier(SpecifierListAST *&node);
@@ -213,9 +213,9 @@ public:
bool parseObjCExpression(ExpressionAST *&node);
bool parseObjCClassForwardDeclaration(DeclarationAST *&node);
bool parseObjCInterface(DeclarationAST *&node,
SpecifierListAST *attributes = 0);
SpecifierListAST *attributes = nullptr);
bool parseObjCProtocol(DeclarationAST *&node,
SpecifierListAST *attributes = 0);
SpecifierListAST *attributes = nullptr);
bool parseObjCTryStatement(StatementAST *&node);
bool parseObjCSynchronizedStatement(StatementAST *&node);
@@ -236,7 +236,7 @@ public:
bool parseObjCInterfaceMemberDeclaration(DeclarationAST *&node);
bool parseObjCInstanceVariableDeclaration(DeclarationAST *&node);
bool parseObjCPropertyDeclaration(DeclarationAST *&node,
SpecifierListAST *attributes = 0);
SpecifierListAST *attributes = nullptr);
bool parseObjCImplementation(DeclarationAST *&node);
bool parseObjCMethodPrototype(ObjCMethodPrototypeAST *&node);
bool parseObjCPropertyAttribute(ObjCPropertyAttributeAST *&node);
@@ -303,7 +303,7 @@ public:
int cursor;
ExpressionListAST *ast;
TemplateArgumentListEntry(int index = 0, int cursor = 0, ExpressionListAST *ast = 0)
TemplateArgumentListEntry(int index = 0, int cursor = 0, ExpressionListAST *ast = nullptr)
: index(index), cursor(cursor), ast(ast) {}
};

View File

@@ -40,7 +40,7 @@ public:
public:
/// Constructs an empty Scope.
SymbolTable(Scope *owner = 0);
SymbolTable(Scope *owner = nullptr);
/// Destroy this scope.
~SymbolTable();
@@ -92,8 +92,8 @@ private:
SymbolTable::SymbolTable(Scope *owner)
: _owner(owner),
_symbols(0),
_hash(0),
_symbols(nullptr),
_hash(nullptr),
_allocatedSymbols(0),
_symbolCount(-1),
_hashSize(0)
@@ -136,7 +136,7 @@ void SymbolTable::enterSymbol(Symbol *symbol)
Symbol *SymbolTable::lookat(const Identifier *id) const
{
if (! _hash || ! id)
return 0;
return nullptr;
const unsigned h = id->hashCode() % _hashSize;
Symbol *symbol = _hash[h];
@@ -154,7 +154,7 @@ Symbol *SymbolTable::lookat(const Identifier *id) const
if (d->identifier()->match(id))
break;
} else if (identity->isQualifiedNameId()) {
return 0;
return nullptr;
} else if (const SelectorNameId *selectorNameId = identity->asSelectorNameId()) {
if (selectorNameId->identifier()->match(id))
break;
@@ -166,7 +166,7 @@ Symbol *SymbolTable::lookat(const Identifier *id) const
Symbol *SymbolTable::lookat(OperatorNameId::Kind operatorId) const
{
if (! _hash)
return 0;
return nullptr;
const unsigned h = operatorId % _hashSize;
Symbol *symbol = _hash[h];
@@ -216,7 +216,7 @@ int SymbolTable::symbolCount() const
Symbol *SymbolTable::symbolAt(int index) const
{
if (! _symbols)
return 0;
return nullptr;
return _symbols[index];
}
@@ -228,14 +228,14 @@ SymbolTable::iterator SymbolTable::lastSymbol() const
Scope::Scope(TranslationUnit *translationUnit, int sourceLocation, const Name *name)
: Symbol(translationUnit, sourceLocation, name),
_members(0),
_members(nullptr),
_startOffset(0),
_endOffset(0)
{ }
Scope::Scope(Clone *clone, Subst *subst, Scope *original)
: Symbol(clone, subst, original)
, _members(0)
, _members(nullptr)
, _startOffset(original->_startOffset)
, _endOffset(original->_endOffset)
{
@@ -265,21 +265,21 @@ int Scope::memberCount() const
/// Returns the Symbol at the given position.
Symbol *Scope::memberAt(int index) const
{ return _members ? _members->symbolAt(index) : 0; }
{ return _members ? _members->symbolAt(index) : nullptr; }
/// Returns the first Symbol in the scope.
Scope::iterator Scope::memberBegin() const
{ return _members ? _members->firstSymbol() : 0; }
{ return _members ? _members->firstSymbol() : nullptr; }
/// Returns the last Symbol in the scope.
Scope::iterator Scope::memberEnd() const
{ return _members ? _members->lastSymbol() : 0; }
{ return _members ? _members->lastSymbol() : nullptr; }
Symbol *Scope::find(const Identifier *id) const
{ return _members ? _members->lookat(id) : 0; }
{ return _members ? _members->lookat(id) : nullptr; }
Symbol *Scope::find(OperatorNameId::Kind operatorId) const
{ return _members ? _members->lookat(operatorId) : 0; }
{ return _members ? _members->lookat(operatorId) : nullptr; }
/// Set the start offset of the scope
int Scope::startOffset() const

View File

@@ -87,10 +87,10 @@ private:
};
Symbol::Symbol(TranslationUnit *translationUnit, int sourceLocation, const Name *name)
: _name(0),
_enclosingScope(0),
_next(0),
_fileId(0),
: _name(nullptr),
_enclosingScope(nullptr),
_next(nullptr),
_fileId(nullptr),
_sourceLocation(0),
_hashCode(0),
_storage(Symbol::NoStorage),
@@ -108,8 +108,8 @@ Symbol::Symbol(TranslationUnit *translationUnit, int sourceLocation, const Name
Symbol::Symbol(Clone *clone, Subst *subst, Symbol *original)
: _name(clone->name(original->_name, subst)),
_enclosingScope(0),
_next(0),
_enclosingScope(nullptr),
_next(nullptr),
_fileId(clone->control()->stringLiteral(original->fileName(), original->fileNameLength())),
_sourceLocation(original->_sourceLocation),
_hashCode(original->_hashCode),
@@ -172,7 +172,7 @@ void Symbol::setSourceLocation(int sourceLocation, TranslationUnit *translationU
_isGenerated = false;
_line = 0;
_column = 0;
_fileId = 0;
_fileId = nullptr;
}
}
@@ -200,7 +200,7 @@ int Symbol::fileNameLength() const
const Name *Symbol::unqualifiedName() const
{
if (! _name)
return 0;
return nullptr;
else if (const QualifiedNameId *q = _name->asQualifiedNameId())
return q->name();
@@ -228,7 +228,7 @@ const Identifier *Symbol::identifier() const
if (_name)
return _name->identifier();
return 0;
return nullptr;
}
Scope *Symbol::enclosingScope() const
@@ -242,7 +242,7 @@ void Symbol::setEnclosingScope(Scope *scope)
void Symbol::resetEnclosingScope()
{
_enclosingScope = 0;
_enclosingScope = nullptr;
}
Namespace *Symbol::enclosingNamespace() const
@@ -251,7 +251,7 @@ Namespace *Symbol::enclosingNamespace() const
if (Namespace *ns = s->asNamespace())
return ns;
}
return 0;
return nullptr;
}
Template *Symbol::enclosingTemplate() const
@@ -260,7 +260,7 @@ Template *Symbol::enclosingTemplate() const
if (Template *templ = s->asTemplate())
return templ;
}
return 0;
return nullptr;
}
Class *Symbol::enclosingClass() const
@@ -269,7 +269,7 @@ Class *Symbol::enclosingClass() const
if (Class *klass = s->asClass())
return klass;
}
return 0;
return nullptr;
}
Enum *Symbol::enclosingEnum() const
@@ -278,7 +278,7 @@ Enum *Symbol::enclosingEnum() const
if (Enum *e = s->asEnum())
return e;
}
return 0;
return nullptr;
}
Function *Symbol::enclosingFunction() const
@@ -287,7 +287,7 @@ Function *Symbol::enclosingFunction() const
if (Function *fun = s->asFunction())
return fun;
}
return 0;
return nullptr;
}
Block *Symbol::enclosingBlock() const
@@ -296,7 +296,7 @@ Block *Symbol::enclosingBlock() const
if (Block *block = s->asBlock())
return block;
}
return 0;
return nullptr;
}
unsigned Symbol::index() const
@@ -348,76 +348,76 @@ bool Symbol::isPrivate() const
{ return _visibility == Private; }
bool Symbol::isScope() const
{ return asScope() != 0; }
{ return asScope() != nullptr; }
bool Symbol::isEnum() const
{ return asEnum() != 0; }
{ return asEnum() != nullptr; }
bool Symbol::isFunction() const
{ return asFunction() != 0; }
{ return asFunction() != nullptr; }
bool Symbol::isNamespace() const
{ return asNamespace() != 0; }
{ return asNamespace() != nullptr; }
bool Symbol::isTemplate() const
{ return asTemplate() != 0; }
{ return asTemplate() != nullptr; }
bool Symbol::isClass() const
{ return asClass() != 0; }
{ return asClass() != nullptr; }
bool Symbol::isForwardClassDeclaration() const
{ return asForwardClassDeclaration() != 0; }
{ return asForwardClassDeclaration() != nullptr; }
bool Symbol::isQtPropertyDeclaration() const
{ return asQtPropertyDeclaration() != 0; }
{ return asQtPropertyDeclaration() != nullptr; }
bool Symbol::isQtEnum() const
{ return asQtEnum() != 0; }
{ return asQtEnum() != nullptr; }
bool Symbol::isBlock() const
{ return asBlock() != 0; }
{ return asBlock() != nullptr; }
bool Symbol::isUsingNamespaceDirective() const
{ return asUsingNamespaceDirective() != 0; }
{ return asUsingNamespaceDirective() != nullptr; }
bool Symbol::isUsingDeclaration() const
{ return asUsingDeclaration() != 0; }
{ return asUsingDeclaration() != nullptr; }
bool Symbol::isDeclaration() const
{ return asDeclaration() != 0; }
{ return asDeclaration() != nullptr; }
bool Symbol::isArgument() const
{ return asArgument() != 0; }
{ return asArgument() != nullptr; }
bool Symbol::isTypenameArgument() const
{ return asTypenameArgument() != 0; }
{ return asTypenameArgument() != nullptr; }
bool Symbol::isBaseClass() const
{ return asBaseClass() != 0; }
{ return asBaseClass() != nullptr; }
bool Symbol::isObjCBaseClass() const
{ return asObjCBaseClass() != 0; }
{ return asObjCBaseClass() != nullptr; }
bool Symbol::isObjCBaseProtocol() const
{ return asObjCBaseProtocol() != 0; }
{ return asObjCBaseProtocol() != nullptr; }
bool Symbol::isObjCClass() const
{ return asObjCClass() != 0; }
{ return asObjCClass() != nullptr; }
bool Symbol::isObjCForwardClassDeclaration() const
{ return asObjCForwardClassDeclaration() != 0; }
{ return asObjCForwardClassDeclaration() != nullptr; }
bool Symbol::isObjCProtocol() const
{ return asObjCProtocol() != 0; }
{ return asObjCProtocol() != nullptr; }
bool Symbol::isObjCForwardProtocolDeclaration() const
{ return asObjCForwardProtocolDeclaration() != 0; }
{ return asObjCForwardProtocolDeclaration() != nullptr; }
bool Symbol::isObjCMethod() const
{ return asObjCMethod() != 0; }
{ return asObjCMethod() != nullptr; }
bool Symbol::isObjCPropertyDeclaration() const
{ return asObjCPropertyDeclaration() != 0; }
{ return asObjCPropertyDeclaration() != nullptr; }
void Symbol::copy(Symbol *other)
{

View File

@@ -200,57 +200,57 @@ public:
Utils::Link toLink() const;
virtual const Scope *asScope() const { return 0; }
virtual const Enum *asEnum() const { return 0; }
virtual const Function *asFunction() const { return 0; }
virtual const Namespace *asNamespace() const { return 0; }
virtual const Template *asTemplate() const { return 0; }
virtual const NamespaceAlias *asNamespaceAlias() const { return 0; }
virtual const Class *asClass() const { return 0; }
virtual const Block *asBlock() const { return 0; }
virtual const UsingNamespaceDirective *asUsingNamespaceDirective() const { return 0; }
virtual const UsingDeclaration *asUsingDeclaration() const { return 0; }
virtual const Declaration *asDeclaration() const { return 0; }
virtual const Argument *asArgument() const { return 0; }
virtual const TypenameArgument *asTypenameArgument() const { return 0; }
virtual const BaseClass *asBaseClass() const { return 0; }
virtual const ForwardClassDeclaration *asForwardClassDeclaration() const { return 0; }
virtual const QtPropertyDeclaration *asQtPropertyDeclaration() const { return 0; }
virtual const QtEnum *asQtEnum() const { return 0; }
virtual const ObjCBaseClass *asObjCBaseClass() const { return 0; }
virtual const ObjCBaseProtocol *asObjCBaseProtocol() const { return 0; }
virtual const ObjCClass *asObjCClass() const { return 0; }
virtual const ObjCForwardClassDeclaration *asObjCForwardClassDeclaration() const { return 0; }
virtual const ObjCProtocol *asObjCProtocol() const { return 0; }
virtual const ObjCForwardProtocolDeclaration *asObjCForwardProtocolDeclaration() const { return 0; }
virtual const ObjCMethod *asObjCMethod() const { return 0; }
virtual const ObjCPropertyDeclaration *asObjCPropertyDeclaration() const { return 0; }
virtual const Scope *asScope() const { return nullptr; }
virtual const Enum *asEnum() const { return nullptr; }
virtual const Function *asFunction() const { return nullptr; }
virtual const Namespace *asNamespace() const { return nullptr; }
virtual const Template *asTemplate() const { return nullptr; }
virtual const NamespaceAlias *asNamespaceAlias() const { return nullptr; }
virtual const Class *asClass() const { return nullptr; }
virtual const Block *asBlock() const { return nullptr; }
virtual const UsingNamespaceDirective *asUsingNamespaceDirective() const { return nullptr; }
virtual const UsingDeclaration *asUsingDeclaration() const { return nullptr; }
virtual const Declaration *asDeclaration() const { return nullptr; }
virtual const Argument *asArgument() const { return nullptr; }
virtual const TypenameArgument *asTypenameArgument() const { return nullptr; }
virtual const BaseClass *asBaseClass() const { return nullptr; }
virtual const ForwardClassDeclaration *asForwardClassDeclaration() const { return nullptr; }
virtual const QtPropertyDeclaration *asQtPropertyDeclaration() const { return nullptr; }
virtual const QtEnum *asQtEnum() const { return nullptr; }
virtual const ObjCBaseClass *asObjCBaseClass() const { return nullptr; }
virtual const ObjCBaseProtocol *asObjCBaseProtocol() const { return nullptr; }
virtual const ObjCClass *asObjCClass() const { return nullptr; }
virtual const ObjCForwardClassDeclaration *asObjCForwardClassDeclaration() const { return nullptr; }
virtual const ObjCProtocol *asObjCProtocol() const { return nullptr; }
virtual const ObjCForwardProtocolDeclaration *asObjCForwardProtocolDeclaration() const { return nullptr; }
virtual const ObjCMethod *asObjCMethod() const { return nullptr; }
virtual const ObjCPropertyDeclaration *asObjCPropertyDeclaration() const { return nullptr; }
virtual Scope *asScope() { return 0; }
virtual Enum *asEnum() { return 0; }
virtual Function *asFunction() { return 0; }
virtual Namespace *asNamespace() { return 0; }
virtual Template *asTemplate() { return 0; }
virtual NamespaceAlias *asNamespaceAlias() { return 0; }
virtual Class *asClass() { return 0; }
virtual Block *asBlock() { return 0; }
virtual UsingNamespaceDirective *asUsingNamespaceDirective() { return 0; }
virtual UsingDeclaration *asUsingDeclaration() { return 0; }
virtual Declaration *asDeclaration() { return 0; }
virtual Argument *asArgument() { return 0; }
virtual TypenameArgument *asTypenameArgument() { return 0; }
virtual BaseClass *asBaseClass() { return 0; }
virtual ForwardClassDeclaration *asForwardClassDeclaration() { return 0; }
virtual QtPropertyDeclaration *asQtPropertyDeclaration() { return 0; }
virtual QtEnum *asQtEnum() { return 0; }
virtual ObjCBaseClass *asObjCBaseClass() { return 0; }
virtual ObjCBaseProtocol *asObjCBaseProtocol() { return 0; }
virtual ObjCClass *asObjCClass() { return 0; }
virtual ObjCForwardClassDeclaration *asObjCForwardClassDeclaration() { return 0; }
virtual ObjCProtocol *asObjCProtocol() { return 0; }
virtual ObjCForwardProtocolDeclaration *asObjCForwardProtocolDeclaration() { return 0; }
virtual ObjCMethod *asObjCMethod() { return 0; }
virtual ObjCPropertyDeclaration *asObjCPropertyDeclaration() { return 0; }
virtual Scope *asScope() { return nullptr; }
virtual Enum *asEnum() { return nullptr; }
virtual Function *asFunction() { return nullptr; }
virtual Namespace *asNamespace() { return nullptr; }
virtual Template *asTemplate() { return nullptr; }
virtual NamespaceAlias *asNamespaceAlias() { return nullptr; }
virtual Class *asClass() { return nullptr; }
virtual Block *asBlock() { return nullptr; }
virtual UsingNamespaceDirective *asUsingNamespaceDirective() { return nullptr; }
virtual UsingDeclaration *asUsingDeclaration() { return nullptr; }
virtual Declaration *asDeclaration() { return nullptr; }
virtual Argument *asArgument() { return nullptr; }
virtual TypenameArgument *asTypenameArgument() { return nullptr; }
virtual BaseClass *asBaseClass() { return nullptr; }
virtual ForwardClassDeclaration *asForwardClassDeclaration() { return nullptr; }
virtual QtPropertyDeclaration *asQtPropertyDeclaration() { return nullptr; }
virtual QtEnum *asQtEnum() { return nullptr; }
virtual ObjCBaseClass *asObjCBaseClass() { return nullptr; }
virtual ObjCBaseProtocol *asObjCBaseProtocol() { return nullptr; }
virtual ObjCClass *asObjCClass() { return nullptr; }
virtual ObjCForwardClassDeclaration *asObjCForwardClassDeclaration() { return nullptr; }
virtual ObjCProtocol *asObjCProtocol() { return nullptr; }
virtual ObjCForwardProtocolDeclaration *asObjCForwardProtocolDeclaration() { return nullptr; }
virtual ObjCMethod *asObjCMethod() { return nullptr; }
virtual ObjCPropertyDeclaration *asObjCPropertyDeclaration() { return nullptr; }
/// Returns this Symbol's type.
virtual FullySpecifiedType type() const = 0;

View File

@@ -53,7 +53,7 @@ void UsingNamespaceDirective::visitSymbol0(SymbolVisitor *visitor)
NamespaceAlias::NamespaceAlias(TranslationUnit *translationUnit,
int sourceLocation, const Name *name)
: Symbol(translationUnit, sourceLocation, name), _namespaceName(0)
: Symbol(translationUnit, sourceLocation, name), _namespaceName(nullptr)
{ }
NamespaceAlias::NamespaceAlias(Clone *clone, Subst *subst, NamespaceAlias *original)
@@ -97,7 +97,7 @@ void UsingDeclaration::visitSymbol0(SymbolVisitor *visitor)
Declaration::Declaration(TranslationUnit *translationUnit, int sourceLocation, const Name *name)
: Symbol(translationUnit, sourceLocation, name)
, _initializer(0)
, _initializer(nullptr)
{ }
Declaration::Declaration(Clone *clone, Subst *subst, Declaration *original)
@@ -158,7 +158,7 @@ Declaration::Declaration(Clone *clone, Subst *subst, Declaration *original)
std::strcmp(enNamespaceNameId, "__cxx11") == 0) {
if (std::strcmp(enClassNameId, "unique_ptr") == 0) {
if (std::strcmp(nameId, "pointer") == 0) {
newType = clone->type(subst->apply(firstTemplParamName), 0);
newType = clone->type(subst->apply(firstTemplParamName), nullptr);
newType = FullySpecifiedType(clone->control()->pointerType(newType));
}
} else if (std::strcmp(enClassNameId, "list") == 0 ||
@@ -172,12 +172,12 @@ Declaration::Declaration(Clone *clone, Subst *subst, Declaration *original)
std::strcmp(enClassNameId, "array") == 0) {
if (std::strcmp(nameId, "reference") == 0 ||
std::strcmp(nameId, "const_reference") == 0) {
newType = clone->type(subst->apply(firstTemplParamName), 0);
newType = clone->type(subst->apply(firstTemplParamName), nullptr);
} else if (std::strcmp(nameId, "iterator") == 0 ||
std::strcmp(nameId, "reverse_iterator") == 0 ||
std::strcmp(nameId, "const_reverse_iterator") == 0 ||
std::strcmp(nameId, "const_iterator") == 0) {
newType = clone->type(subst->apply(firstTemplParamName), 0);
newType = clone->type(subst->apply(firstTemplParamName), nullptr);
newType = FullySpecifiedType(clone->control()->pointerType(newType));
}
} else if (std::strcmp(enClassNameId, "_Hash") == 0 ||
@@ -186,12 +186,12 @@ Declaration::Declaration(Clone *clone, Subst *subst, Declaration *original)
std::strcmp(nameId, "reverse_iterator") == 0 ||
std::strcmp(nameId, "const_reverse_iterator") == 0 ||
std::strcmp(nameId, "const_iterator") == 0) {
FullySpecifiedType clonedType = clone->type(subst->apply(firstTemplParamName), 0);
FullySpecifiedType clonedType = clone->type(subst->apply(firstTemplParamName), nullptr);
if (NamedType *namedType = clonedType.type()->asNamedType()) {
if (const TemplateNameId * templateNameId =
namedType->name()->asTemplateNameId()) {
if (templateNameId->templateArgumentCount()) {
newType = clone->type(templateNameId->templateArgumentAt(0), 0);
newType = clone->type(templateNameId->templateArgumentAt(0), nullptr);
newType = FullySpecifiedType(clone->control()->pointerType(newType));
}
}
@@ -228,7 +228,7 @@ void Declaration::visitSymbol0(SymbolVisitor *visitor)
EnumeratorDeclaration::EnumeratorDeclaration(TranslationUnit *translationUnit, int sourceLocation, const Name *name)
: Declaration(translationUnit, sourceLocation, name)
, _constantValue(0)
, _constantValue(nullptr)
{}
EnumeratorDeclaration::~EnumeratorDeclaration()
@@ -242,7 +242,7 @@ void EnumeratorDeclaration::setConstantValue(const StringLiteral *constantValue)
Argument::Argument(TranslationUnit *translationUnit, int sourceLocation, const Name *name)
: Symbol(translationUnit, sourceLocation, name),
_initializer(0)
_initializer(nullptr)
{ }
Argument::Argument(Clone *clone, Subst *subst, Argument *original)
@@ -255,7 +255,7 @@ Argument::~Argument()
{ }
bool Argument::hasInitializer() const
{ return _initializer != 0; }
{ return _initializer != nullptr; }
const StringLiteral *Argument::initializer() const
{ return _initializer; }
@@ -421,7 +421,7 @@ Symbol *Function::argumentAt(int index) const
}
}
return 0;
return nullptr;
}
bool Function::hasArguments() const
@@ -536,7 +536,7 @@ bool Function::maybeValidPrototype(int actualArgumentCount) const
Block::Block(TranslationUnit *translationUnit, int sourceLocation)
: Scope(translationUnit, sourceLocation, /*name = */ 0)
: Scope(translationUnit, sourceLocation, /*name = */ nullptr)
{ }
Block::Block(Clone *clone, Subst *subst, Block *original)
@@ -617,7 +617,7 @@ Template::~Template()
int Template::templateParameterCount() const
{
if (declaration() != 0)
if (declaration() != nullptr)
return memberCount() - 1;
return 0;
@@ -629,7 +629,7 @@ Symbol *Template::templateParameterAt(int index) const
Symbol *Template::declaration() const
{
if (isEmpty())
return 0;
return nullptr;
if (Symbol *s = memberAt(memberCount() - 1)) {
if (s->isClass() || s->isForwardClassDeclaration() ||
@@ -637,7 +637,7 @@ Symbol *Template::declaration() const
return s;
}
return 0;
return nullptr;
}
FullySpecifiedType Template::type() const
@@ -913,15 +913,15 @@ void ObjCBaseProtocol::visitSymbol0(SymbolVisitor *visitor)
ObjCClass::ObjCClass(TranslationUnit *translationUnit, int sourceLocation, const Name *name):
Scope(translationUnit, sourceLocation, name),
_categoryName(0),
_baseClass(0),
_categoryName(nullptr),
_baseClass(nullptr),
_isInterface(false)
{ }
ObjCClass::ObjCClass(Clone *clone, Subst *subst, ObjCClass *original)
: Scope(clone, subst, original)
, _categoryName(clone->name(original->_categoryName, subst))
, _baseClass(0)
, _baseClass(nullptr)
, _isInterface(original->_isInterface)
{
if (original->_baseClass)
@@ -940,7 +940,7 @@ void ObjCClass::setInterface(bool isInterface)
{ _isInterface = isInterface; }
bool ObjCClass::isCategory() const
{ return _categoryName != 0; }
{ return _categoryName != nullptr; }
const Name *ObjCClass::categoryName() const
{ return _categoryName; }
@@ -1175,8 +1175,8 @@ ObjCPropertyDeclaration::ObjCPropertyDeclaration(TranslationUnit *translationUni
int sourceLocation,
const Name *name):
Symbol(translationUnit, sourceLocation, name),
_getterName(0),
_setterName(0),
_getterName(nullptr),
_setterName(nullptr),
_propertyAttributes(None)
{}

View File

@@ -116,10 +116,10 @@ public:
{ return this; }
virtual EnumeratorDeclaration *asEnumeratorDeclarator()
{ return 0; }
{ return nullptr; }
virtual const EnumeratorDeclaration *asEnumeratorDeclarator() const
{ return 0; }
{ return nullptr; }
protected:
virtual void visitSymbol0(SymbolVisitor *visitor);
@@ -356,7 +356,7 @@ public:
RefQualifier refQualifier() const;
void setRefQualifier(RefQualifier refQualifier);
bool isSignatureEqualTo(const Function *other, Matcher *matcher = 0) const;
bool isSignatureEqualTo(const Function *other, Matcher *matcher = nullptr) const;
bool isAmbiguous() const; // internal
void setAmbiguous(bool isAmbiguous); // internal

View File

@@ -34,7 +34,7 @@ using namespace CPlusPlus;
CloneType::CloneType(Clone *clone)
: _clone(clone)
, _control(clone->control())
, _subst(0)
, _subst(nullptr)
{
}
@@ -102,7 +102,7 @@ void CloneType::visit(NamedType *type)
const Name *name = _clone->name(type->name(), _subst);
FullySpecifiedType ty;
if (_subst)
ty = _clone->type(_subst->apply(name), 0);
ty = _clone->type(_subst->apply(name), nullptr);
if (! ty.isValid())
ty = _control->namedType(name);
_type.setType(ty.type());
@@ -177,15 +177,15 @@ void CloneType::visit(ObjCForwardProtocolDeclaration *type)
CloneSymbol::CloneSymbol(Clone *clone)
: _clone(clone)
, _control(clone->control())
, _subst(0)
, _symbol(0)
, _subst(nullptr)
, _symbol(nullptr)
{
}
Symbol *CloneSymbol::cloneSymbol(Symbol *symbol, Subst *subst)
{
if (! symbol)
return 0;
return nullptr;
SymbolSubstPair symbolSubstPair = std::make_pair(symbol, subst);
auto it = _cache.find(symbolSubstPair);
@@ -194,14 +194,14 @@ Symbol *CloneSymbol::cloneSymbol(Symbol *symbol, Subst *subst)
return it->second;
}
Symbol *r = 0;
Symbol *r = nullptr;
std::swap(_subst, subst);
std::swap(_symbol, r);
accept(symbol);
std::swap(_symbol, r);
std::swap(_subst, subst);
CPP_CHECK(r != 0);
CPP_CHECK(r != nullptr);
_cache[symbolSubstPair] = r;
return r;
}
@@ -401,28 +401,28 @@ bool CloneSymbol::visit(ObjCPropertyDeclaration *symbol)
CloneName::CloneName(Clone *clone)
: _clone(clone)
, _control(clone->control())
, _subst(0)
, _name(0)
, _subst(nullptr)
, _name(nullptr)
{
}
const Name *CloneName::cloneName(const Name *name, Subst *subst)
{
if (! name)
return 0;
return nullptr;
NameSubstPair nameSubstPair = std::make_pair(name, subst);
auto it = _cache.find(nameSubstPair);
if (it != _cache.end())
return it->second;
const Name *r = 0;
const Name *r = nullptr;
std::swap(_subst, subst);
std::swap(_name, r);
accept(name);
std::swap(_name, r);
std::swap(_subst, subst);
CPP_CHECK(r != 0);
CPP_CHECK(r != nullptr);
_cache[nameSubstPair] = r;
return r;
}
@@ -490,17 +490,17 @@ Clone::Clone(Control *control)
const StringLiteral *Clone::stringLiteral(const StringLiteral *literal)
{
return literal ? _control->stringLiteral(literal->chars(), literal->size()) : 0;
return literal ? _control->stringLiteral(literal->chars(), literal->size()) : nullptr;
}
const NumericLiteral *Clone::numericLiteral(const NumericLiteral *literal)
{
return literal ? _control->numericLiteral(literal->chars(), literal->size()) : 0;
return literal ? _control->numericLiteral(literal->chars(), literal->size()) : nullptr;
}
const Identifier *Clone::identifier(const Identifier *id)
{
return id ? _control->identifier(id->chars(), id->size()) : 0;
return id ? _control->identifier(id->chars(), id->size()) : nullptr;
}
FullySpecifiedType Clone::type(const FullySpecifiedType &type, Subst *subst)
@@ -524,7 +524,7 @@ Symbol *Clone::instantiate(Template *templ, const FullySpecifiedType *const args
for (int i = 0, e = std::min(templ->templateParameterCount(), argc); i < e; ++i) {
Symbol *formal = templ->templateParameterAt(i);
FullySpecifiedType actual = args[i];
subst.bind(name(formal->name(), 0), actual);
subst.bind(name(formal->name(), nullptr), actual);
}
if (argc < templ->templateParameterCount()) {
for (int i = argc; i < templ->templateParameterCount(); ++i) {
@@ -537,7 +537,7 @@ Symbol *Clone::instantiate(Template *templ, const FullySpecifiedType *const args
inst->setEnclosingScope(templ->enclosingScope());
return inst;
}
return 0;
return nullptr;
}
//
@@ -564,7 +564,7 @@ FullySpecifiedType Subst::apply(const Name *name) const
return control()->namedType(control()->qualifiedNameId(qualifiedBase,
qualifiedName));
}
else if(baseNamedType->name()->identifier() != 0) {
else if(baseNamedType->name()->identifier() != nullptr) {
const QualifiedNameId *clonedQualifiedNameId
= control()->qualifiedNameId(baseNamedType->name()->identifier(),
unqualified->name());

View File

@@ -40,7 +40,7 @@ class CPLUSPLUS_EXPORT Subst
Subst &operator = (const Subst &other);
public:
Subst(Control *control, Subst *previous = 0)
Subst(Control *control, Subst *previous = nullptr)
: _control(control)
, _previous(previous)
{ }
@@ -197,7 +197,7 @@ public:
Symbol *instantiate(Template *templ,
const FullySpecifiedType *const args, int argc,
Subst *subst = 0);
Subst *subst = nullptr);
private:
CloneType _type;

View File

@@ -247,7 +247,7 @@ void Token::reset()
flags = 0;
byteOffset = 0;
utf16charOffset = 0;
ptr = 0;
ptr = nullptr;
}
const char *Token::name(int kind)

View File

@@ -298,7 +298,7 @@ enum Kind {
class CPLUSPLUS_EXPORT Token
{
public:
Token() : flags(0), byteOffset(0), utf16charOffset(0), ptr(0) {}
Token() : flags(0), byteOffset(0), utf16charOffset(0), ptr(nullptr) {}
inline bool is(unsigned k) const { return f.kind == k; }
inline bool isNot(unsigned k) const { return f.kind != k; }

View File

@@ -43,10 +43,10 @@ const Token TranslationUnit::nullToken;
TranslationUnit::TranslationUnit(Control *control, const StringLiteral *fileId)
: _control(control),
_fileId(fileId),
_firstSourceChar(0),
_lastSourceChar(0),
_pool(0),
_ast(0),
_firstSourceChar(nullptr),
_lastSourceChar(nullptr),
_pool(nullptr),
_ast(nullptr),
_flags(0)
{
_tokens = new std::vector<Token>();
@@ -91,7 +91,7 @@ void TranslationUnit::setSource(const char *source, int size)
const char *TranslationUnit::spell(int index) const
{
if (! index)
return 0;
return nullptr;
return tokenAt(index).spell();
}
@@ -198,7 +198,7 @@ recognize:
// Get the total number of generated tokens and specify "null"
// information for them.
unsigned totalGenerated =
static_cast<int>(strtoul(tk.spell(), 0, 0));
static_cast<int>(strtoul(tk.spell(), nullptr, 0));
const std::size_t previousSize = lineColumn.size();
lineColumn.resize(previousSize + totalGenerated);
std::fill(lineColumn.begin() + previousSize,
@@ -207,10 +207,10 @@ recognize:
lex(&tk);
} else if (tk.is(T_NUMERIC_LITERAL)) {
int line = static_cast<int>(strtoul(tk.spell(), 0, 0));
int line = static_cast<int>(strtoul(tk.spell(), nullptr, 0));
lex(&tk);
lex(&tk); // Skip the separating colon
int column = static_cast<int>(strtoul(tk.spell(), 0, 0));
int column = static_cast<int>(strtoul(tk.spell(), nullptr, 0));
// Store line and column for this non-generated token.
lineColumn.push_back(std::make_pair(line, column));
@@ -230,7 +230,7 @@ recognize:
if (! tk.newline() && tk.is(T_IDENTIFIER) && tk.identifier == lineId)
lex(&tk);
if (! tk.newline() && tk.is(T_NUMERIC_LITERAL)) {
int line = static_cast<int>(strtol(tk.spell(), 0, 0));
int line = static_cast<int>(strtol(tk.spell(), nullptr, 0));
lex(&tk);
if (! tk.newline() && tk.is(T_STRING_LITERAL)) {
const StringLiteral *fileName =
@@ -302,31 +302,31 @@ bool TranslationUnit::parse(ParseMode mode)
switch (mode) {
case ParseTranlationUnit: {
TranslationUnitAST *node = 0;
TranslationUnitAST *node = nullptr;
parsed = parser.parseTranslationUnit(node);
_ast = node;
} break;
case ParseDeclaration: {
DeclarationAST *node = 0;
DeclarationAST *node = nullptr;
parsed = parser.parseDeclaration(node);
_ast = node;
} break;
case ParseExpression: {
ExpressionAST *node = 0;
ExpressionAST *node = nullptr;
parsed = parser.parseExpression(node);
_ast = node;
} break;
case ParseDeclarator: {
DeclaratorAST *node = 0;
parsed = parser.parseDeclarator(node, /*decl_specifier_list =*/ 0);
DeclaratorAST *node = nullptr;
parsed = parser.parseDeclarator(node, /*decl_specifier_list =*/ nullptr);
_ast = node;
} break;
case ParseStatement: {
StatementAST *node = 0;
StatementAST *node = nullptr;
parsed = parser.parseStatement(node);
_ast = node;
} break;
@@ -399,7 +399,7 @@ void TranslationUnit::getPosition(int utf16charOffset,
{
int lineNumber = 0;
int columnNumber = 0;
const StringLiteral *file = 0;
const StringLiteral *file = nullptr;
// If this token is expanded we already have the information directly from the expansion
// section header. Otherwise, we need to calculate it.
@@ -441,7 +441,7 @@ void TranslationUnit::message(DiagnosticClient::Level level, int index, const ch
index = std::min(index, tokenCount() - 1);
int line = 0, column = 0;
const StringLiteral *fileName = 0;
const StringLiteral *fileName = nullptr;
getTokenPosition(index, &line, &column, &fileName);
if (DiagnosticClient *client = control()->diagnosticClient())
@@ -529,16 +529,16 @@ bool TranslationUnit::maybeSplitGreaterGreaterToken(int tokenIndex)
void TranslationUnit::releaseTokensAndComments()
{
delete _tokens;
_tokens = 0;
_tokens = nullptr;
delete _comments;
_comments = 0;
_comments = nullptr;
}
void TranslationUnit::resetAST()
{
delete _pool;
_pool = 0;
_ast = 0;
_pool = nullptr;
_ast = nullptr;
}
void TranslationUnit::release()

View File

@@ -144,7 +144,7 @@ private:
PPLine(int utf16charOffset = 0,
int line = 0,
const StringLiteral *fileName = 0)
const StringLiteral *fileName = nullptr)
: utf16charOffset(utf16charOffset), line(line), fileName(fileName)
{ }

View File

@@ -36,61 +36,61 @@ bool Type::isUndefinedType() const
{ return this == UndefinedType::instance(); }
bool Type::isVoidType() const
{ return asVoidType() != 0; }
{ return asVoidType() != nullptr; }
bool Type::isIntegerType() const
{ return asIntegerType() != 0; }
{ return asIntegerType() != nullptr; }
bool Type::isFloatType() const
{ return asFloatType() != 0; }
{ return asFloatType() != nullptr; }
bool Type::isPointerType() const
{ return asPointerType() != 0; }
{ return asPointerType() != nullptr; }
bool Type::isPointerToMemberType() const
{ return asPointerToMemberType() != 0; }
{ return asPointerToMemberType() != nullptr; }
bool Type::isReferenceType() const
{ return asReferenceType() != 0; }
{ return asReferenceType() != nullptr; }
bool Type::isArrayType() const
{ return asArrayType() != 0; }
{ return asArrayType() != nullptr; }
bool Type::isNamedType() const
{ return asNamedType() != 0; }
{ return asNamedType() != nullptr; }
bool Type::isFunctionType() const
{ return asFunctionType() != 0; }
{ return asFunctionType() != nullptr; }
bool Type::isNamespaceType() const
{ return asNamespaceType() != 0; }
{ return asNamespaceType() != nullptr; }
bool Type::isTemplateType() const
{ return asTemplateType() != 0; }
{ return asTemplateType() != nullptr; }
bool Type::isClassType() const
{ return asClassType() != 0; }
{ return asClassType() != nullptr; }
bool Type::isEnumType() const
{ return asEnumType() != 0; }
{ return asEnumType() != nullptr; }
bool Type::isForwardClassDeclarationType() const
{ return asForwardClassDeclarationType() != 0; }
{ return asForwardClassDeclarationType() != nullptr; }
bool Type::isObjCClassType() const
{ return asObjCClassType() != 0; }
{ return asObjCClassType() != nullptr; }
bool Type::isObjCProtocolType() const
{ return asObjCProtocolType() != 0; }
{ return asObjCProtocolType() != nullptr; }
bool Type::isObjCMethodType() const
{ return asObjCMethodType() != 0; }
{ return asObjCMethodType() != nullptr; }
bool Type::isObjCForwardClassDeclarationType() const
{ return asObjCForwardClassDeclarationType() != 0; }
{ return asObjCForwardClassDeclarationType() != nullptr; }
bool Type::isObjCForwardProtocolDeclarationType() const
{ return asObjCForwardProtocolDeclarationType() != 0; }
{ return asObjCForwardProtocolDeclarationType() != nullptr; }
void Type::accept(TypeVisitor *visitor)
{

View File

@@ -51,52 +51,52 @@ public:
bool isObjCForwardClassDeclarationType() const;
bool isObjCForwardProtocolDeclarationType() const;
virtual const UndefinedType *asUndefinedType() const { return 0; }
virtual const VoidType *asVoidType() const { return 0; }
virtual const IntegerType *asIntegerType() const { return 0; }
virtual const FloatType *asFloatType() const { return 0; }
virtual const PointerType *asPointerType() const { return 0; }
virtual const PointerToMemberType *asPointerToMemberType() const { return 0; }
virtual const ReferenceType *asReferenceType() const { return 0; }
virtual const ArrayType *asArrayType() const { return 0; }
virtual const NamedType *asNamedType() const { return 0; }
virtual const Function *asFunctionType() const { return 0; }
virtual const Namespace *asNamespaceType() const { return 0; }
virtual const Template *asTemplateType() const { return 0; }
virtual const Class *asClassType() const { return 0; }
virtual const Enum *asEnumType() const { return 0; }
virtual const ForwardClassDeclaration *asForwardClassDeclarationType() const { return 0; }
virtual const ObjCClass *asObjCClassType() const { return 0; }
virtual const ObjCProtocol *asObjCProtocolType() const { return 0; }
virtual const ObjCMethod *asObjCMethodType() const { return 0; }
virtual const ObjCForwardClassDeclaration *asObjCForwardClassDeclarationType() const { return 0; }
virtual const ObjCForwardProtocolDeclaration *asObjCForwardProtocolDeclarationType() const { return 0; }
virtual const UndefinedType *asUndefinedType() const { return nullptr; }
virtual const VoidType *asVoidType() const { return nullptr; }
virtual const IntegerType *asIntegerType() const { return nullptr; }
virtual const FloatType *asFloatType() const { return nullptr; }
virtual const PointerType *asPointerType() const { return nullptr; }
virtual const PointerToMemberType *asPointerToMemberType() const { return nullptr; }
virtual const ReferenceType *asReferenceType() const { return nullptr; }
virtual const ArrayType *asArrayType() const { return nullptr; }
virtual const NamedType *asNamedType() const { return nullptr; }
virtual const Function *asFunctionType() const { return nullptr; }
virtual const Namespace *asNamespaceType() const { return nullptr; }
virtual const Template *asTemplateType() const { return nullptr; }
virtual const Class *asClassType() const { return nullptr; }
virtual const Enum *asEnumType() const { return nullptr; }
virtual const ForwardClassDeclaration *asForwardClassDeclarationType() const { return nullptr; }
virtual const ObjCClass *asObjCClassType() const { return nullptr; }
virtual const ObjCProtocol *asObjCProtocolType() const { return nullptr; }
virtual const ObjCMethod *asObjCMethodType() const { return nullptr; }
virtual const ObjCForwardClassDeclaration *asObjCForwardClassDeclarationType() const { return nullptr; }
virtual const ObjCForwardProtocolDeclaration *asObjCForwardProtocolDeclarationType() const { return nullptr; }
virtual UndefinedType *asUndefinedType() { return 0; }
virtual VoidType *asVoidType() { return 0; }
virtual IntegerType *asIntegerType() { return 0; }
virtual FloatType *asFloatType() { return 0; }
virtual PointerType *asPointerType() { return 0; }
virtual PointerToMemberType *asPointerToMemberType() { return 0; }
virtual ReferenceType *asReferenceType() { return 0; }
virtual ArrayType *asArrayType() { return 0; }
virtual NamedType *asNamedType() { return 0; }
virtual Function *asFunctionType() { return 0; }
virtual Namespace *asNamespaceType() { return 0; }
virtual Template *asTemplateType() { return 0; }
virtual Class *asClassType() { return 0; }
virtual Enum *asEnumType() { return 0; }
virtual ForwardClassDeclaration *asForwardClassDeclarationType() { return 0; }
virtual ObjCClass *asObjCClassType() { return 0; }
virtual ObjCProtocol *asObjCProtocolType() { return 0; }
virtual ObjCMethod *asObjCMethodType() { return 0; }
virtual ObjCForwardClassDeclaration *asObjCForwardClassDeclarationType() { return 0; }
virtual ObjCForwardProtocolDeclaration *asObjCForwardProtocolDeclarationType() { return 0; }
virtual UndefinedType *asUndefinedType() { return nullptr; }
virtual VoidType *asVoidType() { return nullptr; }
virtual IntegerType *asIntegerType() { return nullptr; }
virtual FloatType *asFloatType() { return nullptr; }
virtual PointerType *asPointerType() { return nullptr; }
virtual PointerToMemberType *asPointerToMemberType() { return nullptr; }
virtual ReferenceType *asReferenceType() { return nullptr; }
virtual ArrayType *asArrayType() { return nullptr; }
virtual NamedType *asNamedType() { return nullptr; }
virtual Function *asFunctionType() { return nullptr; }
virtual Namespace *asNamespaceType() { return nullptr; }
virtual Template *asTemplateType() { return nullptr; }
virtual Class *asClassType() { return nullptr; }
virtual Enum *asEnumType() { return nullptr; }
virtual ForwardClassDeclaration *asForwardClassDeclarationType() { return nullptr; }
virtual ObjCClass *asObjCClassType() { return nullptr; }
virtual ObjCProtocol *asObjCProtocolType() { return nullptr; }
virtual ObjCMethod *asObjCMethodType() { return nullptr; }
virtual ObjCForwardClassDeclaration *asObjCForwardClassDeclarationType() { return nullptr; }
virtual ObjCForwardProtocolDeclaration *asObjCForwardProtocolDeclarationType() { return nullptr; }
void accept(TypeVisitor *visitor);
static void accept(Type *type, TypeVisitor *visitor);
bool match(const Type *other, Matcher *matcher = 0) const;
bool match(const Type *other, Matcher *matcher = nullptr) const;
protected:
virtual void accept0(TypeVisitor *visitor) = 0;

View File

@@ -40,7 +40,7 @@ Utf8String debugId(const FileContainer &fileContainer);
class CLANGSUPPORT_EXPORT VerboseScopeDurationTimer
{
public:
VerboseScopeDurationTimer(const char *id = 0);
VerboseScopeDurationTimer(const char *id = nullptr);
~VerboseScopeDurationTimer();
private:

View File

@@ -35,7 +35,7 @@ template<typename T>
class AlreadyConsideredClassContainer
{
public:
AlreadyConsideredClassContainer() : _class(0) {}
AlreadyConsideredClassContainer() : _class(nullptr) {}
void insert(const T *item)
{
if (_container.isEmpty())

View File

@@ -67,13 +67,13 @@ class LastVisibleSymbolAt: protected SymbolVisitor
public:
LastVisibleSymbolAt(Symbol *root)
: root(root), line(0), column(0), symbol(0) {}
: root(root), line(0), column(0), symbol(nullptr) {}
Symbol *operator()(int line, int column)
{
this->line = line;
this->column = column;
this->symbol = 0;
this->symbol = nullptr;
accept(root);
if (! symbol)
symbol = root;
@@ -104,7 +104,7 @@ class FindScopeAt: protected SymbolVisitor
public:
/** line and column should be 1-based */
FindScopeAt(TranslationUnit *unit, int line, int column)
: _unit(unit), _line(line), _column(column), _scope(0) {}
: _unit(unit), _line(line), _column(column), _scope(nullptr) {}
Scope *operator()(Symbol *symbol)
{
@@ -265,7 +265,7 @@ private:
Document::Document(const QString &fileName)
: _fileName(QDir::cleanPath(fileName)),
_globalNamespace(0),
_globalNamespace(nullptr),
_revision(0),
_editorRevision(0),
_checkMode(0)
@@ -284,12 +284,12 @@ Document::Document(const QString &fileName)
Document::~Document()
{
delete _translationUnit;
_translationUnit = 0;
_translationUnit = nullptr;
if (_control) {
delete _control->diagnosticClient();
delete _control;
}
_control = 0;
_control = nullptr;
}
Control *Document::control() const
@@ -308,7 +308,7 @@ Control *Document::swapControl(Control *newControl)
_translationUnit = newTranslationUnit;
} else {
delete _translationUnit;
_translationUnit = 0;
_translationUnit = nullptr;
}
Control *oldControl = _control;
@@ -557,7 +557,7 @@ const Macro *Document::findMacroDefinitionAt(int line) const
if (macro.line() == line)
return &macro;
}
return 0;
return nullptr;
}
const Document::MacroUse *Document::findMacroUseAt(int utf16charsOffset) const
@@ -568,7 +568,7 @@ const Document::MacroUse *Document::findMacroUseAt(int utf16charsOffset) const
return &use;
}
}
return 0;
return nullptr;
}
const Document::UndefinedMacroUse *Document::findUndefinedMacroUseAt(int utf16charsOffset) const
@@ -579,7 +579,7 @@ const Document::UndefinedMacroUse *Document::findUndefinedMacroUseAt(int utf16ch
+ QString::fromUtf8(use.name(), use.name().size()).length()))
return &use;
}
return 0;
return nullptr;
}
Document::Ptr Document::create(const QString &fileName)

View File

@@ -131,7 +131,7 @@ public:
void visit(Function *type) override
{
Function *funTy = control()->newFunction(0, 0);
Function *funTy = control()->newFunction(0, nullptr);
funTy->copy(type);
funTy->setConst(type->isConst());
funTy->setVolatile(type->isVolatile());
@@ -144,7 +144,7 @@ public:
for (unsigned i = 0, argc = type->argumentCount(); i < argc; ++i) {
Symbol *arg = type->argumentAt(i);
Argument *newArg = control()->newArgument(0, 0);
Argument *newArg = control()->newArgument(0, nullptr);
newArg->copy(arg);
newArg->setName(rewrite->rewriteName(arg->name()));
newArg->setType(rewrite->rewriteType(arg->type()));
@@ -225,7 +225,7 @@ public:
const Identifier *identifier(const Identifier *other) const
{
if (! other)
return 0;
return nullptr;
return control()->identifier(other->chars(), other->size());
}
@@ -236,7 +236,7 @@ public:
const Name *operator()(const Name *name)
{
if (! name)
return 0;
return nullptr;
accept(name);
return (!temps.isEmpty()) ? temps.takeLast() : name;
@@ -296,7 +296,7 @@ public: // attributes
};
SubstitutionEnvironment::SubstitutionEnvironment()
: _scope(0)
: _scope(nullptr)
{
}
@@ -415,7 +415,7 @@ FullySpecifiedType UseMinimalNames::apply(const Name *name, Rewrite *rewrite) co
UseQualifiedNames::UseQualifiedNames()
: UseMinimalNames(0)
: UseMinimalNames(nullptr)
{
}

View File

@@ -291,7 +291,7 @@ private:
}
return 0;
return nullptr;
}
void visit(const QualifiedNameId *name) override
@@ -362,7 +362,7 @@ FullySpecifiedType ApplySubstitution::apply(const FullySpecifiedType &type)
int ApplySubstitution::findSubstitution(const Identifier *id) const
{
Q_ASSERT(id != 0);
Q_ASSERT(id != nullptr);
for (int index = 0; index < substitution.size(); ++index) {
QPair<const Identifier *, FullySpecifiedType> s = substitution.at(index);

View File

@@ -98,7 +98,7 @@ void FindUsages::operator()(Symbol *symbol)
void FindUsages::reportResult(unsigned tokenIndex, const Name *name, Scope *scope)
{
if (! (tokenIndex && name != 0))
if (! (tokenIndex && name != nullptr))
return;
if (name->identifier() != _id)
@@ -298,7 +298,7 @@ const Name *FindUsages::name(NameAST *ast)
return ast->name;
}
return 0;
return nullptr;
}
void FindUsages::specifier(SpecifierAST *ast)
@@ -1867,7 +1867,7 @@ bool FindUsages::visit(QualifiedNameAST *ast)
if (NameAST *class_or_namespace_name = nested_name_specifier->class_or_namespace_name) {
SimpleNameAST *simple_name = class_or_namespace_name->asSimpleName();
TemplateIdAST *template_id = 0;
TemplateIdAST *template_id = nullptr;
if (! simple_name) {
template_id = class_or_namespace_name->asTemplateId();
@@ -1897,7 +1897,7 @@ bool FindUsages::visit(QualifiedNameAST *ast)
else if (DestructorNameAST *dtor = unqualified_name->asDestructorName())
identifier_token = dtor->unqualified_name->firstToken();
TemplateIdAST *template_id = 0;
TemplateIdAST *template_id = nullptr;
if (! identifier_token) {
template_id = unqualified_name->asTemplateId();

View File

@@ -69,13 +69,13 @@ protected:
QString matchingLine(const Token &tk) const;
void reportResult(unsigned tokenIndex, const Name *name, Scope *scope = 0);
void reportResult(unsigned tokenIndex, const Identifier *id, Scope *scope = 0);
void reportResult(unsigned tokenIndex, const Name *name, Scope *scope = nullptr);
void reportResult(unsigned tokenIndex, const Identifier *id, Scope *scope = nullptr);
void reportResult(unsigned tokenIndex, const QList<LookupItem> &candidates);
void reportResult(unsigned tokenIndex);
bool checkCandidates(const QList<LookupItem> &candidates) const;
void checkExpression(unsigned startToken, unsigned endToken, Scope *scope = 0);
void checkExpression(unsigned startToken, unsigned endToken, Scope *scope = nullptr);
static bool isLocalScope(Scope *scope);
@@ -90,7 +90,7 @@ protected:
void objCSelectorArgument(ObjCSelectorArgumentAST *ast);
void attribute(GnuAttributeAST *ast);
void declarator(DeclaratorAST *ast, Scope *symbol = 0);
void declarator(DeclaratorAST *ast, Scope *symbol = nullptr);
void qtPropertyDeclarationItem(QtPropertyDeclarationItemAST *ast);
void qtInterfaceName(QtInterfaceNameAST *ast);
void baseSpecifier(BaseSpecifierAST *ast);

View File

@@ -234,7 +234,7 @@ static bool symbolIdentical(Symbol *s1, Symbol *s2)
static const Name *toName(const QList<const Name *> &names, Control *control)
{
const Name *n = 0;
const Name *n = nullptr;
for (int i = names.size() - 1; i >= 0; --i) {
if (! n)
n = names.at(i);
@@ -260,7 +260,7 @@ static bool isInlineNamespace(ClassOrNamespace *con, const Name *name)
const Name *LookupContext::minimalName(Symbol *symbol, ClassOrNamespace *target, Control *control)
{
const Name *n = 0;
const Name *n = nullptr;
QList<const Name *> names = LookupContext::fullyQualifiedName(symbol);
for (int i = names.size() - 1; i >= 0; --i) {
@@ -360,7 +360,7 @@ ClassOrNamespace *LookupContext::lookupType(const Name *name, Scope *scope,
QSet<const Declaration *> typedefsBeingResolved) const
{
if (! scope || ! name) {
return 0;
return nullptr;
} else if (Block *block = scope->asBlock()) {
for (int i = 0; i < block->memberCount(); ++i) {
Symbol *m = block->memberAt(i);
@@ -379,8 +379,8 @@ ClassOrNamespace *LookupContext::lookupType(const Name *name, Scope *scope,
if (const NamedType *namedTy = d->type()->asNamedType()) {
// Stop on recursive typedef declarations
if (typedefsBeingResolved.contains(d))
return 0;
return lookupType(namedTy->name(), scope, 0,
return nullptr;
return lookupType(namedTy->name(), scope, nullptr,
QSet<const Declaration *>(typedefsBeingResolved)
<< d);
}
@@ -421,7 +421,7 @@ ClassOrNamespace *LookupContext::lookupType(const Name *name, Scope *scope,
}
}
return 0;
return nullptr;
}
ClassOrNamespace *LookupContext::lookupType(Symbol *symbol,
@@ -438,8 +438,8 @@ QList<LookupItem> LookupContext::lookup(const Name *name, Scope *scope) const
return candidates;
for (; scope; scope = scope->enclosingScope()) {
if (name->identifier() != 0 && scope->isBlock()) {
bindings()->lookupInScope(name, scope, &candidates, /*templateId = */ 0, /*binding=*/ 0);
if (name->identifier() != nullptr && scope->isBlock()) {
bindings()->lookupInScope(name, scope, &candidates, /*templateId = */ nullptr, /*binding=*/ nullptr);
if (! candidates.isEmpty()) {
// it's a local.
@@ -475,7 +475,7 @@ QList<LookupItem> LookupContext::lookup(const Name *name, Scope *scope) const
}
} else if (Function *fun = scope->asFunction()) {
bindings()->lookupInScope(name, fun, &candidates, /*templateId = */ 0, /*binding=*/ 0);
bindings()->lookupInScope(name, fun, &candidates, /*templateId = */ nullptr, /*binding=*/ nullptr);
if (! candidates.isEmpty()) {
// it's an argument or a template parameter.
@@ -507,13 +507,13 @@ QList<LookupItem> LookupContext::lookup(const Name *name, Scope *scope) const
// continue, and look at the enclosing scope.
} else if (ObjCMethod *method = scope->asObjCMethod()) {
bindings()->lookupInScope(name, method, &candidates, /*templateId = */ 0, /*binding=*/ 0);
bindings()->lookupInScope(name, method, &candidates, /*templateId = */ nullptr, /*binding=*/ nullptr);
if (! candidates.isEmpty())
break; // it's a formal argument.
} else if (Template *templ = scope->asTemplate()) {
bindings()->lookupInScope(name, templ, &candidates, /*templateId = */ 0, /*binding=*/ 0);
bindings()->lookupInScope(name, templ, &candidates, /*templateId = */ nullptr, /*binding=*/ nullptr);
if (! candidates.isEmpty()) {
// it's a template parameter.
@@ -569,7 +569,7 @@ ClassOrNamespace *LookupContext::lookupParent(Symbol *symbol) const
foreach (const Name *name, fqName) {
binding = binding->findType(name);
if (!binding)
return 0;
return nullptr;
}
return binding;
@@ -578,11 +578,11 @@ ClassOrNamespace *LookupContext::lookupParent(Symbol *symbol) const
ClassOrNamespace::ClassOrNamespace(CreateBindings *factory, ClassOrNamespace *parent)
: _factory(factory)
, _parent(parent)
, _scopeLookupCache(0)
, _templateId(0)
, _instantiationOrigin(0)
, _rootClass(0)
, _name(0)
, _scopeLookupCache(nullptr)
, _templateId(nullptr)
, _instantiationOrigin(nullptr)
, _rootClass(nullptr)
, _name(nullptr)
{
Q_ASSERT(factory);
}
@@ -667,7 +667,7 @@ QList<LookupItem> ClassOrNamespace::lookup_helper(const Name *name, bool searchI
// It's also possible that there are matches in the parent binding through
// a qualified name. For instance, a nested class which is forward declared
// in the class but defined outside it - we should capture both.
Symbol *match = 0;
Symbol *match = nullptr;
QSet<ClassOrNamespace *> processed;
for (ClassOrNamespace *parentBinding = binding->parent();
parentBinding && !match;
@@ -696,7 +696,7 @@ QList<LookupItem> ClassOrNamespace::lookup_helper(const Name *name, bool searchI
if (processedOwnParents.contains(binding))
break;
processedOwnParents.insert(binding);
lookup_helper(name, binding, &result, &processed, /*templateId = */ 0);
lookup_helper(name, binding, &result, &processed, /*templateId = */ nullptr);
binding = binding->_parent;
} while (searchInEnclosingScope && binding);
}
@@ -829,7 +829,7 @@ void CreateBindings::lookupInScope(const Name *name, Scope *scope,
ClassOrNamespace *ClassOrNamespace::lookupType(const Name *name)
{
if (! name)
return 0;
return nullptr;
QSet<ClassOrNamespace *> processed;
return lookupType_helper(name, &processed, /*searchInEnclosingScope =*/ true, this);
@@ -857,7 +857,7 @@ ClassOrNamespace *ClassOrNamespace::lookupType(const Name *name, Block *block)
return foundNestedBlock;
}
return 0;
return nullptr;
}
ClassOrNamespace *ClassOrNamespace::findType(const Name *name)
@@ -889,7 +889,7 @@ ClassOrNamespace *ClassOrNamespace::findBlock_helper(Block *block,
if (!searchInEnclosingScope)
break;
}
return 0;
return nullptr;
}
ClassOrNamespace *ClassOrNamespace::findBlock(Block *block)
@@ -935,7 +935,7 @@ ClassOrNamespace *ClassOrNamespace::lookupType_helper(const Name *name,
if (ClassOrNamespace *binding = lookupType_helper(q->base(), processed, true, origin))
return binding->lookupType_helper(q->name(), &innerProcessed, false, origin);
return 0;
return nullptr;
} else if (! processed->contains(this)) {
processed->insert(this);
@@ -985,7 +985,7 @@ ClassOrNamespace *ClassOrNamespace::lookupType_helper(const Name *name,
return _parent->lookupType_helper(name, processed, searchInEnclosingScope, origin);
}
return 0;
return nullptr;
}
static ClassOrNamespace *findSpecializationWithMatchingTemplateArgument(const Name *argumentName,
@@ -1008,7 +1008,7 @@ static ClassOrNamespace *findSpecializationWithMatchingTemplateArgument(const Na
}
}
}
return 0;
return nullptr;
}
ClassOrNamespace *ClassOrNamespace::findSpecialization(const TemplateNameId *templId,
@@ -1057,7 +1057,7 @@ ClassOrNamespace *ClassOrNamespace::findSpecialization(const TemplateNameId *tem
}
}
return 0;
return nullptr;
}
ClassOrNamespace *ClassOrNamespace::findOrCreateNestedAnonymousType(
@@ -1080,7 +1080,7 @@ ClassOrNamespace *ClassOrNamespace::nestedType(const Name *name,
QSet<ClassOrNamespace *> *processed,
ClassOrNamespace *origin)
{
Q_ASSERT(name != 0);
Q_ASSERT(name != nullptr);
Q_ASSERT(name->isNameId() || name->isTemplateNameId() || name->isAnonymousNameId());
const_cast<ClassOrNamespace *>(this)->flush();
@@ -1090,7 +1090,7 @@ ClassOrNamespace *ClassOrNamespace::nestedType(const Name *name,
Table::const_iterator it = _classOrNamespaces.find(name);
if (it == _classOrNamespaces.end())
return 0;
return nullptr;
ClassOrNamespace *reference = it->second;
ClassOrNamespace *baseTemplateClassReference = reference;
@@ -1151,7 +1151,7 @@ ClassOrNamespace *ClassOrNamespace::nestedType(const Name *name,
// are templates. We need to collect them now. First, we track the bases which are already
// part of the binding so we can identify the missings ones later.
Class *referenceClass = 0;
Class *referenceClass = nullptr;
QList<const Name *> allBases;
foreach (Symbol *s, reference->symbols()) {
if (Class *clazz = s->asClass()) {
@@ -1272,7 +1272,7 @@ ClassOrNamespace *ClassOrNamespace::nestedType(const Name *name,
templParams.insert(templateSpecialization->templateParameterAt(i)->name(), i);
foreach (const Name *baseName, allBases) {
ClassOrNamespace *baseBinding = 0;
ClassOrNamespace *baseBinding = nullptr;
if (const Identifier *nameId = baseName->asNameId()) {
// This is the simple case in which a template parameter is itself a base.
@@ -1354,7 +1354,7 @@ ClassOrNamespace *ClassOrNamespace::nestedType(const Name *name,
if (const QualifiedNameId *qBaseName = baseName->asQualifiedNameId()) {
if (const Name *qualification = qBaseName->base())
binding = lookupType(qualification);
else if (binding->parent() != 0)
else if (binding->parent() != nullptr)
//if this is global identifier we take global namespace
//Ex: class A{}; namespace NS { class A: public ::A{}; }
binding = binding->globalNamespace();
@@ -1471,7 +1471,7 @@ NamedType *ClassOrNamespace::NestedClassInstantiator::findNamedType(Type *member
else if (ReferenceType *referenceType = memberType->asReferenceType())
return findNamedType(referenceType->elementType().type());
return 0;
return nullptr;
}
void ClassOrNamespace::flush()
@@ -1539,7 +1539,7 @@ ClassOrNamespace *ClassOrNamespace::findOrCreateType(const Name *name, ClassOrNa
return e;
}
return 0;
return nullptr;
}
CreateBindings::CreateBindings(Document::Ptr thisDocument, const Snapshot &snapshot)
@@ -1547,7 +1547,7 @@ CreateBindings::CreateBindings(Document::Ptr thisDocument, const Snapshot &snaps
, _control(QSharedPointer<Control>(new Control))
, _expandTemplates(false)
{
_globalNamespace = allocClassOrNamespace(/*parent = */ 0);
_globalNamespace = allocClassOrNamespace(/*parent = */ nullptr);
_currentClassOrNamespace = _globalNamespace;
process(thisDocument);
@@ -1636,7 +1636,7 @@ void CreateBindings::process(Document::Ptr doc)
ClassOrNamespace *CreateBindings::enterClassOrNamespaceBinding(Symbol *symbol)
{
ClassOrNamespace *entity = _currentClassOrNamespace->findOrCreateType(symbol->name(), 0,
ClassOrNamespace *entity = _currentClassOrNamespace->findOrCreateType(symbol->name(), nullptr,
symbol->asClass());
entity->addSymbol(symbol);
@@ -1645,7 +1645,7 @@ ClassOrNamespace *CreateBindings::enterClassOrNamespaceBinding(Symbol *symbol)
ClassOrNamespace *CreateBindings::enterGlobalClassOrNamespace(Symbol *symbol)
{
ClassOrNamespace *entity = _globalNamespace->findOrCreateType(symbol->name(), 0,
ClassOrNamespace *entity = _globalNamespace->findOrCreateType(symbol->name(), nullptr,
symbol->asClass());
entity->addSymbol(symbol);
@@ -1678,13 +1678,13 @@ bool CreateBindings::visit(Namespace *ns)
bool CreateBindings::visit(Class *klass)
{
ClassOrNamespace *previous = _currentClassOrNamespace;
ClassOrNamespace *binding = 0;
ClassOrNamespace *binding = nullptr;
if (klass->name() && klass->name()->isQualifiedNameId())
binding = _currentClassOrNamespace->lookupType(klass->name());
if (! binding)
binding = _currentClassOrNamespace->findOrCreateType(klass->name(), 0, klass);
binding = _currentClassOrNamespace->findOrCreateType(klass->name(), nullptr, klass);
_currentClassOrNamespace = binding;
_currentClassOrNamespace->addSymbol(klass);
@@ -1737,7 +1737,7 @@ bool CreateBindings::visit(Declaration *decl)
} else if (Class *klass = ty->asClassType()) {
if (const Identifier *nameId = decl->name()->asNameId()) {
ClassOrNamespace *binding
= _currentClassOrNamespace->findOrCreateType(nameId, 0, klass);
= _currentClassOrNamespace->findOrCreateType(nameId, nullptr, klass);
binding->addSymbol(klass);
}
}
@@ -1794,7 +1794,7 @@ bool CreateBindings::visit(Block *block)
_entities.append(binding);
} else {
delete binding;
binding = 0;
binding = nullptr;
}
_currentClassOrNamespace = previous;

View File

@@ -97,8 +97,8 @@ private:
void flush();
/// \internal
ClassOrNamespace *findOrCreateType(const Name *name, ClassOrNamespace *origin = 0,
Class *clazz = 0);
ClassOrNamespace *findOrCreateType(const Name *name, ClassOrNamespace *origin = nullptr,
Class *clazz = nullptr);
ClassOrNamespace *findOrCreateNestedAnonymousType(const AnonymousNameId *anonymousNameId);
@@ -196,9 +196,9 @@ public:
ClassOrNamespace *globalNamespace() const;
/// Finds the binding associated to the given symbol.
ClassOrNamespace *lookupType(Symbol *symbol, ClassOrNamespace *enclosingBinding = 0);
ClassOrNamespace *lookupType(Symbol *symbol, ClassOrNamespace *enclosingBinding = nullptr);
ClassOrNamespace *lookupType(const QList<const Name *> &path,
ClassOrNamespace *enclosingBinding = 0);
ClassOrNamespace *enclosingBinding = nullptr);
/// Returns the Control that must be used to create temporary symbols.
/// \internal
@@ -303,11 +303,11 @@ public:
QList<LookupItem> lookup(const Name *name, Scope *scope) const;
ClassOrNamespace *lookupType(const Name *name, Scope *scope,
ClassOrNamespace *enclosingBinding = 0,
ClassOrNamespace *enclosingBinding = nullptr,
QSet<const Declaration *> typedefsBeingResolved
= QSet<const Declaration *>()) const;
ClassOrNamespace *lookupType(Symbol *symbol,
ClassOrNamespace *enclosingBinding = 0) const;
ClassOrNamespace *enclosingBinding = nullptr) const;
ClassOrNamespace *lookupParent(Symbol *symbol) const;
/// \internal

View File

@@ -41,7 +41,7 @@ uint CPlusPlus::qHash(const LookupItem &key)
}
LookupItem::LookupItem()
: _scope(0), _declaration(0), _binding(0)
: _scope(nullptr), _declaration(nullptr), _binding(nullptr)
{ }
FullySpecifiedType LookupItem::type() const

View File

@@ -48,7 +48,7 @@
using namespace CPlusPlus;
Macro::Macro()
: _next(0),
: _next(nullptr),
_hashcode(0),
_fileRevision(0),
_line(0),

View File

@@ -53,7 +53,7 @@ public:
static bool shouldInsertMatchingText(const QTextCursor &tc);
static bool shouldInsertMatchingText(QChar lookAhead);
static bool isInCommentHelper(const QTextCursor &currsor, Token *retToken = 0);
static bool isInCommentHelper(const QTextCursor &currsor, Token *retToken = nullptr);
static CPlusPlus::Kind stringKindAtCursor(const QTextCursor &cursor);
static QString insertMatchingBrace(const QTextCursor &tc, const QString &text,

View File

@@ -43,12 +43,12 @@ public:
QString operator()(const QList<const Name *> &fullyQualifiedName) const
{ return prettyName(fullyQualifiedName); }
QString operator()(const FullySpecifiedType &type, const Name *name = 0) const
QString operator()(const FullySpecifiedType &type, const Name *name = nullptr) const
{ return prettyType(type, name); }
QString prettyName(const Name *name) const;
QString prettyName(const QList<const Name *> &fullyQualifiedName) const;
QString prettyType(const FullySpecifiedType &type, const Name *name = 0) const;
QString prettyType(const FullySpecifiedType &type, const Name *name = nullptr) const;
QString prettyType(const FullySpecifiedType &type, const QString &name) const;
public:

View File

@@ -67,10 +67,10 @@ static unsigned hashCode(const char *str, int length)
Environment::Environment()
: currentLine(0),
hideNext(false),
_macros(0),
_macros(nullptr),
_allocated_macros(0),
_macro_count(-1),
_hash(0),
_hash(nullptr),
_hash_count(401)
{
}
@@ -153,10 +153,10 @@ void Environment::reset()
if (_hash)
free(_hash);
_macros = 0;
_macros = nullptr;
_allocated_macros = 0;
_macro_count = -1;
_hash = 0;
_hash = nullptr;
_hash_count = 401;
}
@@ -230,14 +230,14 @@ Environment::iterator Environment::lastMacro() const
Macro *Environment::resolve(const ByteArrayRef &name) const
{
if (! _macros)
return 0;
return nullptr;
Macro *it = _hash[hashCode(name.start(), name.size()) % _hash_count];
for (; it; it = it->_next) {
if (it->name() != name)
continue;
else if (it->isHidden())
return 0;
return nullptr;
else break;
}
return it;

View File

@@ -83,7 +83,7 @@ public:
// use an "alreadyResolved" container. FIXME: We might overcome this by resolving the
// template parameters.
unsigned maxDepth = 15;
for (NamedType *namedTy = 0; maxDepth && (namedTy = getNamedType(*type)); --maxDepth) {
for (NamedType *namedTy = nullptr; maxDepth && (namedTy = getNamedType(*type)); --maxDepth) {
QList<LookupItem> namedTypeItems = getNamedTypeItems(namedTy->name(), *scope, _binding);
if (Q_UNLIKELY(debug))
@@ -125,9 +125,9 @@ private:
QList<LookupItem> results;
if (!scope)
return results;
Scope *enclosingBlockScope = 0;
Scope *enclosingBlockScope = nullptr;
for (Block *block = scope->asBlock(); block;
block = enclosingBlockScope ? enclosingBlockScope->asBlock() : 0) {
block = enclosingBlockScope ? enclosingBlockScope->asBlock() : nullptr) {
const unsigned memberCount = block->memberCount();
for (unsigned i = 0; i < memberCount; ++i) {
Symbol *symbol = block->memberAt(i);
@@ -233,7 +233,7 @@ static int evaluateFunctionArgument(const FullySpecifiedType &actualTy,
ResolveExpression::ResolveExpression(const LookupContext &context,
const QSet<const Declaration *> &autoDeclarationsBeingResolved)
: ASTVisitor(context.expressionDocument()->translationUnit()),
_scope(0),
_scope(nullptr),
_context(context),
bind(context.expressionDocument()->translationUnit()),
_autoDeclarationsBeingResolved(autoDeclarationsBeingResolved),
@@ -314,9 +314,9 @@ bool ResolveExpression::visit(IdExpressionAST *ast)
bool ResolveExpression::visit(BinaryExpressionAST *ast)
{
if (tokenKind(ast->binary_op_token) == T_COMMA && ast->right_expression && ast->right_expression->asQtMethod() != 0) {
if (tokenKind(ast->binary_op_token) == T_COMMA && ast->right_expression && ast->right_expression->asQtMethod() != nullptr) {
if (ast->left_expression && ast->left_expression->asQtMethod() != 0)
if (ast->left_expression && ast->left_expression->asQtMethod() != nullptr)
thisObject();
else
accept(ast->left_expression);
@@ -404,7 +404,7 @@ bool ResolveExpression::visit(TypeidExpressionAST *)
{
const Name *stdName = control()->identifier("std");
const Name *tiName = control()->identifier("type_info");
const Name *q = control()->qualifiedNameId(control()->qualifiedNameId(/* :: */ 0, stdName), tiName);
const Name *q = control()->qualifiedNameId(control()->qualifiedNameId(/* :: */ nullptr, stdName), tiName);
FullySpecifiedType ty(control()->namedType(q));
addResult(ty, _scope);
@@ -443,7 +443,7 @@ bool ResolveExpression::visit(NumericLiteralAST *ast)
{
const Token &tk = tokenAt(ast->literal_token);
Type *type = 0;
Type *type = nullptr;
bool isUnsigned = false;
if (tk.is(T_CHAR_LITERAL)) {
@@ -591,7 +591,7 @@ bool ResolveExpression::visit(UnaryExpressionAST *ast)
LookupItem &p = _results[i];
FullySpecifiedType ty = p.type();
NamedType *namedTy = ty->asNamedType();
if (namedTy != 0) {
if (namedTy != nullptr) {
const QList<LookupItem> types = _context.lookup(namedTy->name(), p.scope());
if (!types.empty())
ty = types.front().type();
@@ -600,7 +600,7 @@ bool ResolveExpression::visit(UnaryExpressionAST *ast)
if (PointerType *ptrTy = ty->asPointerType()) {
p.setType(ptrTy->elementType());
added = true;
} else if (namedTy != 0) {
} else if (namedTy != nullptr) {
const Name *starOp = control()->operatorNameId(OperatorNameId::StarOp);
if (ClassOrNamespace *b = _context.lookupType(namedTy->name(), p.scope(), p.binding())) {
foreach (const LookupItem &r, b->find(starOp)) {
@@ -719,7 +719,7 @@ bool ResolveExpression::visit(SimpleNameAST *ast)
if (!item.type()->isUndefinedType())
continue;
if (item.declaration() == 0)
if (item.declaration() == nullptr)
continue;
if (item.type().isAuto()) {
@@ -732,7 +732,7 @@ bool ResolveExpression::visit(SimpleNameAST *ast)
continue;
const StringLiteral *initializationString = decl->getInitializer();
if (initializationString == 0)
if (initializationString == nullptr)
continue;
const QByteArray &initializer =
@@ -765,7 +765,7 @@ bool ResolveExpression::visit(SimpleNameAST *ast)
Clone cloner(_context.bindings()->control().data());
for (int n = 0; n < typeItems.size(); ++ n) {
FullySpecifiedType newType = cloner.type(typeItems[n].type(), 0);
FullySpecifiedType newType = cloner.type(typeItems[n].type(), nullptr);
if (n == 0) {
item.setType(newType);
item.setScope(typeItems[n].scope());
@@ -1017,7 +1017,7 @@ bool ResolveExpression::visit(MemberAccessAST *ast)
const QList<LookupItem> baseResults = resolve(ast->base_expression, _scope);
// Evaluate the expression-id that follows the access operator.
const Name *memberName = 0;
const Name *memberName = nullptr;
if (ast->member_name)
memberName = ast->member_name->name;
@@ -1034,7 +1034,7 @@ ClassOrNamespace *ResolveExpression::findClass(const FullySpecifiedType &origina
ClassOrNamespace *enclosingBinding) const
{
FullySpecifiedType ty = originalTy.simplified();
ClassOrNamespace *binding = 0;
ClassOrNamespace *binding = nullptr;
if (Class *klass = ty->asClassType()) {
if (scope->isBlock())
@@ -1113,7 +1113,7 @@ ClassOrNamespace *ResolveExpression::baseExpression(const QList<LookupItem> &bas
FullySpecifiedType overloadTy
= instantiate(binding->templateId(), overload);
Function *instantiatedFunction = overloadTy->asFunctionType();
Q_ASSERT(instantiatedFunction != 0);
Q_ASSERT(instantiatedFunction != nullptr);
FullySpecifiedType retTy
= instantiatedFunction->returnType().simplified();
@@ -1162,7 +1162,7 @@ ClassOrNamespace *ResolveExpression::baseExpression(const QList<LookupItem> &bas
return binding;
}
ClassOrNamespace *enclosingBinding = 0;
ClassOrNamespace *enclosingBinding = nullptr;
if (ClassOrNamespace *binding = r.binding()) {
if (binding->instantiationOrigin())
enclosingBinding = binding;
@@ -1173,7 +1173,7 @@ ClassOrNamespace *ResolveExpression::baseExpression(const QList<LookupItem> &bas
}
}
return 0;
return nullptr;
}
ClassOrNamespace *ResolveExpression::findClassForTemplateParameterInExpressionScope(
@@ -1191,7 +1191,7 @@ ClassOrNamespace *ResolveExpression::findClassForTemplateParameterInExpressionSc
}
}
return 0;
return nullptr;
}
FullySpecifiedType ResolveExpression::instantiate(const Name *className, Symbol *candidate) const
@@ -1213,7 +1213,7 @@ bool ResolveExpression::visit(ObjCMessageExpressionAST *ast)
foreach (const LookupItem &result, receiverResults) {
FullySpecifiedType ty = result.type().simplified();
ClassOrNamespace *binding = 0;
ClassOrNamespace *binding = nullptr;
if (ObjCClass *clazz = ty->asObjCClassType()) {
// static access, e.g.:

View File

@@ -49,13 +49,13 @@ public:
ClassOrNamespace *baseExpression(const QList<LookupItem> &baseResults,
int accessOp,
bool *replacedDotOperator = 0) const;
bool *replacedDotOperator = nullptr) const;
const LookupContext &context() const;
protected:
ClassOrNamespace *findClass(const FullySpecifiedType &ty, Scope *scope,
ClassOrNamespace *enclosingBinding = 0) const;
ClassOrNamespace *enclosingBinding = nullptr) const;
QList<LookupItem> expression(ExpressionAST *ast);
@@ -66,7 +66,7 @@ protected:
void thisObject();
void addResult(const FullySpecifiedType &ty, Scope *scope, ClassOrNamespace *binding = 0);
void addResult(const FullySpecifiedType &ty, Scope *scope, ClassOrNamespace *binding = nullptr);
void addResults(const QList<Symbol *> &symbols);
void addResults(const QList<LookupItem> &items);

View File

@@ -31,7 +31,7 @@
using namespace CPlusPlus;
SymbolNameVisitor::SymbolNameVisitor()
: _symbol(0)
: _symbol(nullptr)
{
}

View File

@@ -38,8 +38,8 @@
using namespace CPlusPlus;
TypeOfExpression::TypeOfExpression():
m_ast(0),
m_scope(0),
m_ast(nullptr),
m_scope(nullptr),
m_expandTemplates(false)
{
}
@@ -50,8 +50,8 @@ void TypeOfExpression::init(Document::Ptr thisDocument, const Snapshot &snapshot
{
m_thisDocument = thisDocument;
m_snapshot = snapshot;
m_ast = 0;
m_scope = 0;
m_ast = nullptr;
m_scope = nullptr;
m_lookupContext = LookupContext();
Q_ASSERT(m_bindings.isNull());
@@ -178,7 +178,7 @@ QByteArray TypeOfExpression::preprocessedExpression(const QByteArray &utf8code)
m_environment = QSharedPointer<Environment>(env);
}
Preprocessor preproc(0, m_environment.data());
Preprocessor preproc(nullptr, m_environment.data());
return preproc.run(QLatin1String("<expression>"), utf8code);
}
@@ -187,7 +187,7 @@ namespace CPlusPlus {
ExpressionAST *extractExpressionAST(Document::Ptr doc)
{
if (! doc->translationUnit()->ast())
return 0;
return nullptr;
return doc->translationUnit()->ast()->asExpression();
}

View File

@@ -445,7 +445,7 @@ void TypePrettyPrinter::visit(Function *type)
if (index + 1 == _overview->markedArgument)
const_cast<Overview*>(_overview)->markedArgumentBegin = _text.length();
const Name *name = 0;
const Name *name = nullptr;
if (_overview->showArgumentNames)
name = arg->name();

View File

@@ -27,7 +27,7 @@
namespace CPlusPlus {
static CppModelManagerBase *g_instance = 0;
static CppModelManagerBase *g_instance = nullptr;
CppModelManagerBase::CppModelManagerBase(QObject *parent)
: QObject(parent)
@@ -39,7 +39,7 @@ CppModelManagerBase::CppModelManagerBase(QObject *parent)
CppModelManagerBase::~CppModelManagerBase()
{
Q_ASSERT(g_instance == this);
g_instance = 0;
g_instance = nullptr;
}
CppModelManagerBase *CppModelManagerBase::instance()

View File

@@ -40,7 +40,7 @@ class CPLUSPLUS_EXPORT CppModelManagerBase : public QObject
{
Q_OBJECT
public:
CppModelManagerBase(QObject *parent = 0);
CppModelManagerBase(QObject *parent = nullptr);
~CppModelManagerBase();
static CppModelManagerBase *instance();

View File

@@ -343,7 +343,7 @@ class ExpressionEvaluator
public:
ExpressionEvaluator(Client *client, Environment *env)
: client(client), env(env), _lex(0)
: client(client), env(env), _lex(nullptr)
{ }
Value operator()(const Token *firstToken, const Token *lastToken,
@@ -422,7 +422,7 @@ protected:
(*_lex)->byteOffset,
(*_lex)->utf16charOffset,
(*_lex)->lineno, env, client)
!= 0);
!= nullptr);
++(*_lex);
} else if ((*_lex)->is(T_LPAREN)) {
++(*_lex);
@@ -432,7 +432,7 @@ protected:
(*_lex)->utf16charOffset,
(*_lex)->lineno,
env, client)
!= 0);
!= nullptr);
++(*_lex);
if ((*_lex)->is(T_RPAREN))
++(*_lex);
@@ -600,21 +600,21 @@ private:
} // end of anonymous namespace
Preprocessor::State::State()
: m_lexer(0)
: m_lexer(nullptr)
, m_skipping(MAX_LEVEL)
, m_trueTest(MAX_LEVEL)
, m_ifLevel(0)
, m_tokenBufferDepth(0)
, m_tokenBuffer(0)
, m_tokenBuffer(nullptr)
, m_inPreprocessorDirective(false)
, m_markExpandedTokens(true)
, m_noLines(false)
, m_inCondition(false)
, m_bytesOffsetRef(0)
, m_utf16charsOffsetRef(0)
, m_result(0)
, m_result(nullptr)
, m_lineRef(1)
, m_currentExpansion(0)
, m_currentExpansion(nullptr)
, m_includeGuardState(IncludeGuardState_BeforeIfndef)
{
m_skipping[m_ifLevel] = false;
@@ -848,7 +848,7 @@ void Preprocessor::handleDefined(PPToken *tk)
void Preprocessor::pushToken(Preprocessor::PPToken *tk)
{
const PPToken currentTokenBuffer[] = {*tk};
m_state.pushTokenBuffer(currentTokenBuffer, currentTokenBuffer + 1, 0);
m_state.pushTokenBuffer(currentTokenBuffer, currentTokenBuffer + 1, nullptr);
}
void Preprocessor::lex(PPToken *tk)
@@ -1774,7 +1774,7 @@ void Preprocessor::handleDefineDirective(PPToken *tk)
unsigned previousBytesOffset = 0;
unsigned previousUtf16charsOffset = 0;
unsigned previousLine = 0;
Macro *macroReference = 0;
Macro *macroReference = nullptr;
while (isContinuationToken(*tk)) {
// Macro tokens are always marked as expanded. However, only for object-like macros
// we mark them as generated too. For function-like macros we postpone it until the
@@ -1791,7 +1791,7 @@ void Preprocessor::handleDefineDirective(PPToken *tk)
if (!macroReference->isFunctionLike()) {
m_client->notifyMacroReference(tk->byteOffset, tk->utf16charOffset,
tk->lineno, *macroReference);
macroReference = 0;
macroReference = nullptr;
}
}
} else if (macroReference) {
@@ -1799,7 +1799,7 @@ void Preprocessor::handleDefineDirective(PPToken *tk)
m_client->notifyMacroReference(previousBytesOffset, previousUtf16charsOffset,
previousLine, *macroReference);
}
macroReference = 0;
macroReference = nullptr;
}
previousBytesOffset = tk->byteOffset;
@@ -1870,7 +1870,7 @@ QByteArray Preprocessor::expand(PPToken *tk, PPToken *lastConditionToken)
// qDebug("*** Condition before: [%s]", condition.constData());
QByteArray result;
result.reserve(256);
preprocess(m_state.m_currentFileName, condition, &result, 0, true, false, true,
preprocess(m_state.m_currentFileName, condition, &result, nullptr, true, false, true,
bytesBegin, utf16charsBegin, line);
result.squeeze();
// qDebug("*** Condition after: [%s]", result.constData());

View File

@@ -181,7 +181,7 @@ private:
/// \param idToken the identifier token that ought to be in the input
/// after a #ifndef or a #define .
inline void updateIncludeGuardState(IncludeGuardStateHint hint,
PPToken *idToken = 0)
PPToken *idToken = nullptr)
{
// some quick checks for the majority of the uninteresting cases:
if (m_includeGuardState == IncludeGuardState_NoGuard)
@@ -227,7 +227,7 @@ private:
void handlePreprocessorDirective(PPToken *tk);
void handleIncludeDirective(PPToken *tk, bool includeNext);
void handleDefineDirective(PPToken *tk);
QByteArray expand(PPToken *tk, PPToken *lastConditionToken = 0);
QByteArray expand(PPToken *tk, PPToken *lastConditionToken = nullptr);
const Internal::PPToken evalExpression(PPToken *tk, Value &result);
void handleIfDirective(PPToken *tk);
void handleElifDirective(PPToken *tk, const PPToken &poundToken);

View File

@@ -325,7 +325,7 @@ void StructTypeAST::Field::setInnerType(TypeAST *innerType)
return;
TypeAST **parent = &type;
TypeAST *inner = type;
while (inner != 0) {
while (inner != nullptr) {
ArrayTypeAST *array = inner->asArrayType();
if (!array)
break;
@@ -388,7 +388,7 @@ void VariableDeclarationAST::accept0(Visitor *visitor)
TypeAST *VariableDeclarationAST::declarationType(List<DeclarationAST *> *decls)
{
VariableDeclarationAST *var = decls->value->asVariableDeclaration();
return var ? var->type : 0;
return var ? var->type : nullptr;
}
void TypeDeclarationAST::accept0(Visitor *visitor)

View File

@@ -49,7 +49,7 @@ bool ASTDump::preVisit(AST *ast)
{
const char *id = typeid(*ast).name();
#ifdef Q_CC_GNU
char *cppId = abi::__cxa_demangle(id, 0, 0, 0);
char *cppId = abi::__cxa_demangle(id, nullptr, nullptr, nullptr);
id = cppId;
#endif
out << QByteArray(_depth, ' ') << id << endl;

View File

@@ -112,9 +112,9 @@ public:
// symbols
Namespace *newNamespace();
Struct *newStruct(Scope *scope = 0);
Block *newBlock(Scope *scope = 0);
Function *newFunction(Scope *scope = 0);
Struct *newStruct(Scope *scope = nullptr);
Block *newBlock(Scope *scope = nullptr);
Function *newFunction(Scope *scope = nullptr);
Argument *newArgument(Function *function, const QString &name, const Type *type);
Variable *newVariable(Scope *scope, const QString &name, const Type *type, int qualifiers = 0);

View File

@@ -60,9 +60,9 @@ void Lexer::yyinp()
int Lexer::yylex(Token *tk)
{
const char *pos = 0;
const char *pos = nullptr;
int line = 0;
_yyval.ptr = 0;
_yyval.ptr = nullptr;
const int kind = yylex_helper(&pos, &line);
tk->kind = kind;
tk->position = pos - _source;

View File

@@ -47,7 +47,7 @@ public:
};
Token()
: kind(0), position(0), length(0), line(0), ptr(0) {}
: kind(0), position(0), length(0), line(0), ptr(nullptr) {}
bool is(int k) const { return k == kind; }
bool isNot(int k) const { return k != kind; }

View File

@@ -30,11 +30,11 @@
using namespace GLSL;
MemoryPool::MemoryPool()
: _blocks(0),
: _blocks(nullptr),
_allocatedBlocks(0),
_blockCount(-1),
_ptr(0),
_end(0)
_ptr(nullptr),
_end(nullptr)
{ }
MemoryPool::~MemoryPool()
@@ -52,7 +52,7 @@ MemoryPool::~MemoryPool()
void MemoryPool::reset()
{
_blockCount = -1;
_ptr = _end = 0;
_ptr = _end = nullptr;
}
void *MemoryPool::allocate_helper(size_t size)
@@ -68,7 +68,7 @@ void *MemoryPool::allocate_helper(size_t size)
_blocks = (char **) realloc(_blocks, sizeof(char *) * _allocatedBlocks);
for (int index = _blockCount; index < _allocatedBlocks; ++index)
_blocks[index] = 0;
_blocks[index] = nullptr;
}
char *&block = _blocks[_blockCount];

View File

@@ -104,7 +104,7 @@ AST *Parser::parse(int startToken)
int action = 0;
yytoken = -1;
yyloc = -1;
void *yyval = 0; // value of the current token.
void *yyval = nullptr; // value of the current token.
_recovered = false;
_tos = -1;
@@ -204,7 +204,7 @@ AST *Parser::parse(int startToken)
else if (*tptr == T_NUMBER || *tptr == T_TYPE_NAME)
yyval = (void *) _engine->identifier(QLatin1String("$0"));
else
yyval = 0;
yyval = nullptr;
_symStack[_tos].ptr = yyval;
_locationStack[_tos] = yyloc;
@@ -224,7 +224,7 @@ AST *Parser::parse(int startToken)
} while (action);
return 0;
return nullptr;
}
#line 643 "./glsl.g"
@@ -347,14 +347,14 @@ case 17: {
case 18: {
sym(1).function.id = sym(1).function_identifier;
sym(1).function.arguments = 0;
sym(1).function.arguments = nullptr;
} break;
#line 788 "./glsl.g"
case 19: {
sym(1).function.id = sym(1).function_identifier;
sym(1).function.arguments = 0;
sym(1).function.arguments = nullptr;
} break;
#line 796 "./glsl.g"
@@ -815,7 +815,7 @@ case 87: {
case 88: {
TypeAST *type = makeAstNode<QualifiedTypeAST>
(sym(1).type_qualifier.qualifier, (TypeAST *)0,
(sym(1).type_qualifier.qualifier, (TypeAST *)nullptr,
sym(1).type_qualifier.layout_list);
ast(1) = makeAstNode<TypeDeclarationAST>(type);
} break;
@@ -878,7 +878,7 @@ case 97: {
ast(1) = makeAstNode<ParameterDeclarationAST>
(makeAstNode<QualifiedTypeAST>
(sym(1).qualifier, sym(3).param_declarator.type,
(List<LayoutQualifierAST *> *)0),
(List<LayoutQualifierAST *> *)nullptr),
ParameterDeclarationAST::Qualifier(sym(2).qualifier),
sym(3).param_declarator.name);
} break;
@@ -897,9 +897,9 @@ case 98: {
case 99: {
ast(1) = makeAstNode<ParameterDeclarationAST>
(makeAstNode<QualifiedTypeAST>
(sym(1).qualifier, type(3), (List<LayoutQualifierAST *> *)0),
(sym(1).qualifier, type(3), (List<LayoutQualifierAST *> *)nullptr),
ParameterDeclarationAST::Qualifier(sym(2).qualifier),
(const QString *)0);
(const QString *)nullptr);
} break;
#line 1421 "./glsl.g"
@@ -907,7 +907,7 @@ case 99: {
case 100: {
ast(1) = makeAstNode<ParameterDeclarationAST>
(type(2), ParameterDeclarationAST::Qualifier(sym(1).qualifier),
(const QString *)0);
(const QString *)nullptr);
} break;
#line 1430 "./glsl.g"
@@ -1065,7 +1065,7 @@ case 120: {
#line 1602 "./glsl.g"
case 121: {
ast(1) = makeAstNode<QualifiedTypeAST>(0, type(1), (List<LayoutQualifierAST *> *)0);
ast(1) = makeAstNode<QualifiedTypeAST>(0, type(1), (List<LayoutQualifierAST *> *)nullptr);
} break;
#line 1609 "./glsl.g"
@@ -1121,7 +1121,7 @@ case 129: {
#line 1667 "./glsl.g"
case 130: {
sym(1).layout = makeAstNode<LayoutQualifierAST>(string(1), (const QString *)0);
sym(1).layout = makeAstNode<LayoutQualifierAST>(string(1), (const QString *)nullptr);
} break;
#line 1674 "./glsl.g"
@@ -1140,7 +1140,7 @@ case 132: {
case 133: {
sym(1).type_qualifier.qualifier = sym(1).qualifier;
sym(1).type_qualifier.layout_list = 0;
sym(1).type_qualifier.layout_list = nullptr;
} break;
#line 1696 "./glsl.g"
@@ -1161,35 +1161,35 @@ case 135: {
case 136: {
sym(1).type_qualifier.qualifier = sym(1).qualifier | sym(2).qualifier;
sym(1).type_qualifier.layout_list = 0;
sym(1).type_qualifier.layout_list = nullptr;
} break;
#line 1720 "./glsl.g"
case 137: {
sym(1).type_qualifier.qualifier = sym(1).qualifier;
sym(1).type_qualifier.layout_list = 0;
sym(1).type_qualifier.layout_list = nullptr;
} break;
#line 1728 "./glsl.g"
case 138: {
sym(1).type_qualifier.qualifier = sym(1).qualifier | sym(2).qualifier;
sym(1).type_qualifier.layout_list = 0;
sym(1).type_qualifier.layout_list = nullptr;
} break;
#line 1736 "./glsl.g"
case 139: {
sym(1).type_qualifier.qualifier = sym(1).qualifier | sym(2).qualifier | sym(3).qualifier;
sym(1).type_qualifier.layout_list = 0;
sym(1).type_qualifier.layout_list = nullptr;
} break;
#line 1744 "./glsl.g"
case 140: {
sym(1).type_qualifier.qualifier = QualifiedTypeAST::Invariant;
sym(1).type_qualifier.layout_list = 0;
sym(1).type_qualifier.layout_list = nullptr;
} break;
#line 1752 "./glsl.g"
@@ -1905,14 +1905,14 @@ case 257: {
case 258: {
sym(1).field = makeAstNode<StructTypeAST::Field>
(string(1), makeAstNode<ArrayTypeAST>((TypeAST *)0));
(string(1), makeAstNode<ArrayTypeAST>((TypeAST *)nullptr));
} break;
#line 2586 "./glsl.g"
case 259: {
sym(1).field = makeAstNode<StructTypeAST::Field>
(string(1), makeAstNode<ArrayTypeAST>((TypeAST *)0, expression(3)));
(string(1), makeAstNode<ArrayTypeAST>((TypeAST *)nullptr, expression(3)));
} break;
#line 2594 "./glsl.g"
@@ -2070,7 +2070,7 @@ case 282: {
case 283: {
sym(1).ifstmt.thenClause = statement(1);
sym(1).ifstmt.elseClause = 0;
sym(1).ifstmt.elseClause = nullptr;
} break;
#line 2776 "./glsl.g"
@@ -2162,7 +2162,7 @@ case 297: {
case 298: {
sym(1).forstmt.condition = expression(1);
sym(1).forstmt.increment = 0;
sym(1).forstmt.increment = nullptr;
} break;
#line 2883 "./glsl.g"
@@ -2215,7 +2215,7 @@ case 306: {
sym(1).declaration_list = makeAstNode< List<DeclarationAST *> >
(sym(1).declaration);
} else {
sym(1).declaration_list = 0;
sym(1).declaration_list = nullptr;
}
} break;
@@ -2230,7 +2230,7 @@ case 307: {
sym(1).declaration_list = makeAstNode< List<DeclarationAST *> >
(sym(2).declaration);
} else {
sym(1).declaration_list = 0;
sym(1).declaration_list = nullptr;
}
}
} break;
@@ -2250,7 +2250,7 @@ case 309: {
#line 2976 "./glsl.g"
case 310: {
ast(1) = 0;
ast(1) = nullptr;
} break;
#line 2983 "./glsl.g"
@@ -2262,7 +2262,7 @@ case 311: {
#line 2990 "./glsl.g"
case 312: {
ast(1) = 0;
ast(1) = nullptr;
} break;
#line 2998 "./glsl.g"

View File

@@ -91,13 +91,13 @@ public:
TranslationUnitAST *parse() {
if (AST *u = parse(T_FEED_GLSL))
return u->asTranslationUnit();
return 0;
return nullptr;
}
ExpressionAST *parseExpression() {
if (AST *u = parse(T_FEED_EXPRESSION))
return u->asExpression();
return 0;
return nullptr;
}
AST *parse(int startToken);

View File

@@ -33,9 +33,9 @@
using namespace GLSL;
Semantic::Semantic()
: _engine(0)
, _scope(0)
, _type(0)
: _engine(nullptr)
, _scope(nullptr)
, _type(nullptr)
{
}
@@ -118,7 +118,7 @@ Semantic::ExprResult Semantic::functionIdentifier(FunctionIdentifierAST *ast)
if (ast) {
if (ast->name) {
if (Symbol *s = _scope->lookup(*ast->name)) {
if (s->asOverloadSet() != 0 || s->asFunction() != 0)
if (s->asOverloadSet() != nullptr || s->asFunction() != nullptr)
result.type = s->type();
else
_engine->error(ast->lineno, QString::fromLatin1("`%1' cannot be used as a function").arg(*ast->name));
@@ -308,33 +308,33 @@ bool Semantic::implicitCast(const Type *type, const Type *target) const
return false;
} else if (type->isEqualTo(target)) {
return true;
} else if (target->asUIntType() != 0) {
return type->asIntType() != 0;
} else if (target->asFloatType() != 0) {
return type->asIntType() != 0 ||
type->asUIntType() != 0;
} else if (target->asDoubleType() != 0) {
return type->asIntType() != 0 ||
type->asUIntType() != 0 ||
type->asFloatType() != 0;
} else if (target->asUIntType() != nullptr) {
return type->asIntType() != nullptr;
} else if (target->asFloatType() != nullptr) {
return type->asIntType() != nullptr ||
type->asUIntType() != nullptr;
} else if (target->asDoubleType() != nullptr) {
return type->asIntType() != nullptr ||
type->asUIntType() != nullptr ||
type->asFloatType() != nullptr;
} else if (const VectorType *targetVecTy = target->asVectorType()) {
if (const VectorType *vecTy = type->asVectorType()) {
if (targetVecTy->dimension() == vecTy->dimension()) {
const Type *targetElementType = targetVecTy->elementType();
const Type *elementType = vecTy->elementType();
if (targetElementType->asUIntType() != 0) {
if (targetElementType->asUIntType() != nullptr) {
// uvec* -> ivec*
return elementType->asIntType() != 0;
} else if (targetElementType->asFloatType() != 0) {
return elementType->asIntType() != nullptr;
} else if (targetElementType->asFloatType() != nullptr) {
// vec* -> ivec* | uvec*
return elementType->asIntType() != 0 ||
elementType->asUIntType() != 0;
} else if (targetElementType->asDoubleType() != 0) {
return elementType->asIntType() != nullptr ||
elementType->asUIntType() != nullptr;
} else if (targetElementType->asDoubleType() != nullptr) {
// dvec* -> ivec* | uvec* | fvec*
return elementType->asIntType() != 0 ||
elementType->asUIntType() != 0 ||
elementType->asFloatType() != 0;
return elementType->asIntType() != nullptr ||
elementType->asUIntType() != nullptr ||
elementType->asFloatType() != nullptr;
}
}
}
@@ -345,9 +345,9 @@ bool Semantic::implicitCast(const Type *type, const Type *target) const
const Type *targetElementType = targetMatTy->elementType();
const Type *elementType = matTy->elementType();
if (targetElementType->asDoubleType() != 0) {
if (targetElementType->asDoubleType() != nullptr) {
// dmat* -> mat*
return elementType->asFloatType() != 0;
return elementType->asFloatType() != nullptr;
}
}
}

View File

@@ -37,7 +37,7 @@ public:
~Semantic() override;
struct ExprResult {
ExprResult(const Type *type = 0, bool isConstant = false)
ExprResult(const Type *type = nullptr, bool isConstant = false)
: type(type), isConstant(isConstant) {}
~ExprResult() { }
@@ -45,7 +45,7 @@ public:
bool isValid() const {
if (! type)
return false;
else if (type->asUndefinedType() != 0)
else if (type->asUndefinedType() != nullptr)
return false;
return true;
}

View File

@@ -69,7 +69,7 @@ Symbol *Scope::lookup(const QString &name) const
else if (Scope *s = scope())
return s->lookup(name);
else
return 0;
return nullptr;
}
QList<Symbol *> Scope::members() const

View File

@@ -36,7 +36,7 @@ class Scope;
class GLSL_EXPORT Symbol
{
public:
Symbol(Scope *scope = 0);
Symbol(Scope *scope = nullptr);
virtual ~Symbol();
Scope *scope() const;
@@ -45,14 +45,14 @@ public:
QString name() const;
void setName(const QString &name);
virtual Scope *asScope() { return 0; }
virtual Struct *asStruct() { return 0; }
virtual Function *asFunction() { return 0; }
virtual Argument *asArgument() { return 0; }
virtual Block *asBlock() { return 0; }
virtual Variable *asVariable() { return 0; }
virtual OverloadSet *asOverloadSet() { return 0; }
virtual Namespace *asNamespace() { return 0; }
virtual Scope *asScope() { return nullptr; }
virtual Struct *asStruct() { return nullptr; }
virtual Function *asFunction() { return nullptr; }
virtual Argument *asArgument() { return nullptr; }
virtual Block *asBlock() { return nullptr; }
virtual Variable *asVariable() { return nullptr; }
virtual OverloadSet *asOverloadSet() { return nullptr; }
virtual Namespace *asNamespace() { return nullptr; }
virtual const Type *type() const = 0;
@@ -64,7 +64,7 @@ private:
class GLSL_EXPORT Scope: public Symbol
{
public:
Scope(Scope *sscope = 0);
Scope(Scope *sscope = nullptr);
Symbol *lookup(const QString &name) const;

View File

@@ -31,7 +31,7 @@ using namespace GLSL;
Argument::Argument(Function *scope)
: Symbol(scope)
, _type(0)
, _type(nullptr)
{
}
@@ -63,7 +63,7 @@ void Block::add(Symbol *symbol)
const Type *Block::type() const
{
// ### assert?
return 0;
return nullptr;
}
Symbol *Block::find(const QString &name) const
@@ -73,7 +73,7 @@ Symbol *Block::find(const QString &name) const
Variable::Variable(Scope *scope)
: Symbol(scope)
, _type(0)
, _type(nullptr)
, _qualifiers(0)
{
}
@@ -127,7 +127,7 @@ void Namespace::add(Symbol *symbol)
const Type *Namespace::type() const
{
return 0;
return nullptr;
}
Symbol *Namespace::find(const QString &name) const

View File

@@ -68,7 +68,7 @@ private:
class GLSL_EXPORT Block: public Scope
{
public:
Block(Scope *enclosingScope = 0);
Block(Scope *enclosingScope = nullptr);
QList<Symbol *> members() const override;
void add(Symbol *symbol) override;

View File

@@ -36,23 +36,23 @@ public:
virtual QString toString() const = 0;
virtual const UndefinedType *asUndefinedType() const { return 0; }
virtual const VoidType *asVoidType() const { return 0; }
virtual const BoolType *asBoolType() const { return 0; }
virtual const IntType *asIntType() const { return 0; }
virtual const UIntType *asUIntType() const { return 0; }
virtual const FloatType *asFloatType() const { return 0; }
virtual const DoubleType *asDoubleType() const { return 0; }
virtual const ScalarType *asScalarType() const { return 0; }
virtual const IndexType *asIndexType() const { return 0; }
virtual const VectorType *asVectorType() const { return 0; }
virtual const MatrixType *asMatrixType() const { return 0; }
virtual const ArrayType *asArrayType() const { return 0; }
virtual const SamplerType *asSamplerType() const { return 0; }
virtual const OverloadSet *asOverloadSetType() const { return 0; }
virtual const UndefinedType *asUndefinedType() const { return nullptr; }
virtual const VoidType *asVoidType() const { return nullptr; }
virtual const BoolType *asBoolType() const { return nullptr; }
virtual const IntType *asIntType() const { return nullptr; }
virtual const UIntType *asUIntType() const { return nullptr; }
virtual const FloatType *asFloatType() const { return nullptr; }
virtual const DoubleType *asDoubleType() const { return nullptr; }
virtual const ScalarType *asScalarType() const { return nullptr; }
virtual const IndexType *asIndexType() const { return nullptr; }
virtual const VectorType *asVectorType() const { return nullptr; }
virtual const MatrixType *asMatrixType() const { return nullptr; }
virtual const ArrayType *asArrayType() const { return nullptr; }
virtual const SamplerType *asSamplerType() const { return nullptr; }
virtual const OverloadSet *asOverloadSetType() const { return nullptr; }
virtual const Struct *asStructType() const { return 0; }
virtual const Function *asFunctionType() const { return 0; }
virtual const Struct *asStructType() const { return nullptr; }
virtual const Function *asFunctionType() const { return nullptr; }
virtual bool isEqualTo(const Type *other) const = 0;
virtual bool isLessThan(const Type *other) const = 0;

View File

@@ -32,7 +32,7 @@ using namespace GLSL;
bool UndefinedType::isEqualTo(const Type *other) const
{
if (other && other->asUndefinedType() != 0)
if (other && other->asUndefinedType() != nullptr)
return true;
return false;
}
@@ -40,14 +40,14 @@ bool UndefinedType::isEqualTo(const Type *other) const
bool UndefinedType::isLessThan(const Type *other) const
{
Q_UNUSED(other)
Q_ASSERT(other != 0);
Q_ASSERT(other->asUndefinedType() != 0);
Q_ASSERT(other != nullptr);
Q_ASSERT(other->asUndefinedType() != nullptr);
return false;
}
bool VoidType::isEqualTo(const Type *other) const
{
if (other && other->asVoidType() != 0)
if (other && other->asVoidType() != nullptr)
return true;
return false;
}
@@ -55,14 +55,14 @@ bool VoidType::isEqualTo(const Type *other) const
bool VoidType::isLessThan(const Type *other) const
{
Q_UNUSED(other)
Q_ASSERT(other != 0);
Q_ASSERT(other->asVoidType() != 0);
Q_ASSERT(other != nullptr);
Q_ASSERT(other->asVoidType() != nullptr);
return false;
}
bool BoolType::isEqualTo(const Type *other) const
{
if (other && other->asBoolType() != 0)
if (other && other->asBoolType() != nullptr)
return true;
return false;
}
@@ -70,14 +70,14 @@ bool BoolType::isEqualTo(const Type *other) const
bool BoolType::isLessThan(const Type *other) const
{
Q_UNUSED(other)
Q_ASSERT(other != 0);
Q_ASSERT(other->asBoolType() != 0);
Q_ASSERT(other != nullptr);
Q_ASSERT(other->asBoolType() != nullptr);
return false;
}
bool IntType::isEqualTo(const Type *other) const
{
if (other && other->asIntType() != 0)
if (other && other->asIntType() != nullptr)
return true;
return false;
}
@@ -85,14 +85,14 @@ bool IntType::isEqualTo(const Type *other) const
bool IntType::isLessThan(const Type *other) const
{
Q_UNUSED(other)
Q_ASSERT(other != 0);
Q_ASSERT(other->asIntType() != 0);
Q_ASSERT(other != nullptr);
Q_ASSERT(other->asIntType() != nullptr);
return false;
}
bool UIntType::isEqualTo(const Type *other) const
{
if (other && other->asUIntType() != 0)
if (other && other->asUIntType() != nullptr)
return true;
return false;
}
@@ -100,14 +100,14 @@ bool UIntType::isEqualTo(const Type *other) const
bool UIntType::isLessThan(const Type *other) const
{
Q_UNUSED(other)
Q_ASSERT(other != 0);
Q_ASSERT(other->asUIntType() != 0);
Q_ASSERT(other != nullptr);
Q_ASSERT(other->asUIntType() != nullptr);
return false;
}
bool FloatType::isEqualTo(const Type *other) const
{
if (other && other->asFloatType() != 0)
if (other && other->asFloatType() != nullptr)
return true;
return false;
}
@@ -115,14 +115,14 @@ bool FloatType::isEqualTo(const Type *other) const
bool FloatType::isLessThan(const Type *other) const
{
Q_UNUSED(other)
Q_ASSERT(other != 0);
Q_ASSERT(other->asFloatType() != 0);
Q_ASSERT(other != nullptr);
Q_ASSERT(other->asFloatType() != nullptr);
return false;
}
bool DoubleType::isEqualTo(const Type *other) const
{
if (other && other->asDoubleType() != 0)
if (other && other->asDoubleType() != nullptr)
return true;
return false;
}
@@ -130,21 +130,21 @@ bool DoubleType::isEqualTo(const Type *other) const
bool DoubleType::isLessThan(const Type *other) const
{
Q_UNUSED(other)
Q_ASSERT(other != 0);
Q_ASSERT(other->asDoubleType() != 0);
Q_ASSERT(other != nullptr);
Q_ASSERT(other->asDoubleType() != nullptr);
return false;
}
QString VectorType::toString() const
{
const char *prefix = "";
if (elementType()->asBoolType() != 0)
if (elementType()->asBoolType() != nullptr)
prefix = "b";
else if (elementType()->asIntType() != 0)
else if (elementType()->asIntType() != nullptr)
prefix = "i'";
else if (elementType()->asUIntType() != 0)
else if (elementType()->asUIntType() != nullptr)
prefix = "u";
else if (elementType()->asDoubleType() != 0)
else if (elementType()->asDoubleType() != nullptr)
prefix = "d";
return QString::fromLatin1("%1vec%2").arg(QLatin1String(prefix)).arg(_dimension);
}
@@ -249,9 +249,9 @@ bool VectorType::isEqualTo(const Type *other) const
bool VectorType::isLessThan(const Type *other) const
{
Q_ASSERT(other != 0);
Q_ASSERT(other != nullptr);
const VectorType *vec = other->asVectorType();
Q_ASSERT(vec != 0);
Q_ASSERT(vec != nullptr);
if (_dimension < vec->dimension())
return true;
else if (_dimension == vec->dimension() && elementType() < vec->elementType())
@@ -262,13 +262,13 @@ bool VectorType::isLessThan(const Type *other) const
QString MatrixType::toString() const
{
const char *prefix = "";
if (elementType()->asBoolType() != 0)
if (elementType()->asBoolType() != nullptr)
prefix = "b";
else if (elementType()->asIntType() != 0)
else if (elementType()->asIntType() != nullptr)
prefix = "i";
else if (elementType()->asUIntType() != 0)
else if (elementType()->asUIntType() != nullptr)
prefix = "u";
else if (elementType()->asDoubleType() != 0)
else if (elementType()->asDoubleType() != nullptr)
prefix = "d";
return QString::fromLatin1("%1mat%2x%3").arg(QLatin1String(prefix)).arg(_columns).arg(_rows);
}
@@ -291,9 +291,9 @@ bool MatrixType::isEqualTo(const Type *other) const
bool MatrixType::isLessThan(const Type *other) const
{
Q_ASSERT(other != 0);
Q_ASSERT(other != nullptr);
const MatrixType *mat = other->asMatrixType();
Q_ASSERT(mat != 0);
Q_ASSERT(mat != nullptr);
if (_columns < mat->columns()) {
return true;
} else if (_columns == mat->columns()) {
@@ -321,9 +321,9 @@ bool ArrayType::isEqualTo(const Type *other) const
bool ArrayType::isLessThan(const Type *other) const
{
Q_ASSERT(other != 0);
Q_ASSERT(other != nullptr);
const ArrayType *array = other->asArrayType();
Q_ASSERT(array != 0);
Q_ASSERT(array != nullptr);
return elementType() < array->elementType();
}
@@ -348,7 +348,7 @@ Symbol *Struct::find(const QString &name) const
if (s->name() == name)
return s;
}
return 0;
return nullptr;
}
bool Struct::isEqualTo(const Type *other) const
@@ -446,7 +446,7 @@ Symbol *Function::find(const QString &name) const
if (arg->name() == name)
return arg;
}
return 0;
return nullptr;
}
QString SamplerType::toString() const
@@ -465,9 +465,9 @@ bool SamplerType::isEqualTo(const Type *other) const
bool SamplerType::isLessThan(const Type *other) const
{
Q_ASSERT(other != 0);
Q_ASSERT(other != nullptr);
const SamplerType *samp = other->asSamplerType();
Q_ASSERT(samp != 0);
Q_ASSERT(samp != nullptr);
return _kind < samp->kind();
}
@@ -493,7 +493,7 @@ const Type *OverloadSet::type() const
Symbol *OverloadSet::find(const QString &) const
{
return 0;
return nullptr;
}
void OverloadSet::add(Symbol *symbol)

View File

@@ -186,7 +186,7 @@ public:
class GLSL_EXPORT Struct: public Type, public Scope
{
public:
Struct(Scope *scope = 0)
Struct(Scope *scope = nullptr)
: Scope(scope) {}
QList<Symbol *> members() const override;
@@ -210,7 +210,7 @@ private:
class GLSL_EXPORT Function: public Type, public Scope
{
public:
Function(Scope *scope = 0)
Function(Scope *scope = nullptr)
: Scope(scope) {}
const Type *returnType() const;
@@ -267,7 +267,7 @@ private:
class GLSL_EXPORT OverloadSet: public Type, public Scope
{
public:
OverloadSet(Scope *enclosingScope = 0);
OverloadSet(Scope *enclosingScope = nullptr);
QVector<Function *> functions() const;
void addFunction(Function *function);

View File

@@ -38,7 +38,7 @@ class QMLDEBUG_EXPORT QmlDebugConnectionManager : public QObject
{
Q_OBJECT
public:
explicit QmlDebugConnectionManager(QObject *parent = 0);
explicit QmlDebugConnectionManager(QObject *parent = nullptr);
~QmlDebugConnectionManager() override;
void connectToServer(const QUrl &server);

View File

@@ -36,7 +36,7 @@ class QMLDEBUG_EXPORT QmlOutputParser : public QObject
{
Q_OBJECT
public:
QmlOutputParser(QObject *parent = 0);
QmlOutputParser(QObject *parent = nullptr);
void setNoOutputText(const QString &text);
void processOutput(const QString &output);

View File

@@ -43,7 +43,7 @@ class QMLDEBUG_EXPORT QPacketProtocol : public QObject
Q_OBJECT
Q_DECLARE_PRIVATE(QPacketProtocol)
public:
explicit QPacketProtocol(QIODevice *dev, QObject *parent = 0);
explicit QPacketProtocol(QIODevice *dev, QObject *parent = nullptr);
void send(const QByteArray &data);
qint64 packetsAvailable() const;

View File

@@ -42,7 +42,7 @@ class QMLEDITORWIDGETS_EXPORT ColorBox : public QWidget
Q_PROPERTY(int alpha READ alpha WRITE setAlpha NOTIFY alphaChanged)
public:
ColorBox(QWidget *parent = 0) : QWidget(parent), m_color(Qt::white), m_saturatedColor(Qt::white), m_mousePressed(false), m_lastHue(0)
ColorBox(QWidget *parent = nullptr) : QWidget(parent), m_color(Qt::white), m_saturatedColor(Qt::white), m_mousePressed(false), m_lastHue(0)
{
setFixedWidth(130);
setFixedHeight(130);

View File

@@ -40,7 +40,7 @@ Q_PROPERTY(bool noColor READ noColor WRITE setNoColor)
Q_PROPERTY(bool showArrow READ showArrow WRITE setShowArrow)
public:
ColorButton(QWidget *parent = 0) :
ColorButton(QWidget *parent = nullptr) :
QToolButton (parent),
m_colorString(QLatin1String("#ffffff")),
m_noColor(false),

View File

@@ -44,7 +44,7 @@ class QMLEDITORWIDGETS_EXPORT ContextPaneTextWidget : public QWidget
Q_OBJECT
public:
explicit ContextPaneTextWidget(QWidget *parent = 0);
explicit ContextPaneTextWidget(QWidget *parent = nullptr);
~ContextPaneTextWidget();
void setProperties(QmlJS::PropertyReader *propertyReader);
void setVerticalAlignmentVisible(bool);

View File

@@ -155,7 +155,7 @@ void DragWidget::enterEvent(QEvent *)
setCursor(Qt::ArrowCursor);
}
ContextPaneWidget::ContextPaneWidget(QWidget *parent) : DragWidget(parent), m_currentWidget(0)
ContextPaneWidget::ContextPaneWidget(QWidget *parent) : DragWidget(parent), m_currentWidget(nullptr)
{
QGridLayout *layout = new QGridLayout(this);
layout->setMargin(0);
@@ -207,7 +207,7 @@ ContextPaneWidget::~ContextPaneWidget()
//if the pane was never activated the widget is not in a widget tree
if (!m_bauhausColorDialog.isNull()) {
delete m_bauhausColorDialog.data();
m_bauhausColorDialog = 0;
m_bauhausColorDialog = nullptr;
}
}

View File

@@ -51,7 +51,7 @@ class QMLEDITORWIDGETS_EXPORT DragWidget : public QFrame
Q_OBJECT
public:
explicit DragWidget(QWidget *parent = 0);
explicit DragWidget(QWidget *parent = nullptr);
void setSecondaryTarget(QWidget* w)
{ m_secondaryTarget = w; }
@@ -76,7 +76,7 @@ class QMLEDITORWIDGETS_EXPORT ContextPaneWidget : public DragWidget
Q_OBJECT
public:
explicit ContextPaneWidget(QWidget *parent = 0);
explicit ContextPaneWidget(QWidget *parent = nullptr);
~ContextPaneWidget() override;
void activate(const QPoint &pos, const QPoint &alternative, const QPoint &alternative2, bool pinned);
void rePosition(const QPoint &pos, const QPoint &alternative , const QPoint &alternative3, bool pinned);

View File

@@ -52,7 +52,7 @@ class PreviewLabel : public QLabel
Q_OBJECT
public:
PreviewLabel(QWidget *parent = 0);
PreviewLabel(QWidget *parent = nullptr);
void setZoom(int);
void setIsBorderImage(bool b);
void setMargins(int left, int top, int right, int bottom);
@@ -91,7 +91,7 @@ class PreviewDialog : public DragWidget
Q_OBJECT
public:
PreviewDialog(QWidget *parent = 0);
PreviewDialog(QWidget *parent = nullptr);
void setPixmap(const QPixmap &p, int zoom = 1);
void setZoom(int z);
void setIsBorderImage(bool b);
@@ -118,7 +118,7 @@ class QMLEDITORWIDGETS_EXPORT ContextPaneWidgetImage : public QWidget
Q_OBJECT
public:
explicit ContextPaneWidgetImage(QWidget *parent = 0, bool borderImage = false);
explicit ContextPaneWidgetImage(QWidget *parent = nullptr, bool borderImage = false);
~ContextPaneWidgetImage();
void setProperties(QmlJS::PropertyReader *propertyReader);
void setPath(const QString& path);
@@ -161,7 +161,7 @@ class LabelFilter: public QObject {
Q_OBJECT
public:
LabelFilter(QObject* parent =0) : QObject(parent) {}
LabelFilter(QObject* parent =nullptr) : QObject(parent) {}
signals:
void doubleClicked();
protected:
@@ -172,7 +172,7 @@ class WheelFilter: public QObject {
Q_OBJECT
public:
WheelFilter(QObject* parent =0) : QObject(parent) {}
WheelFilter(QObject* parent =nullptr) : QObject(parent) {}
void setTarget(QObject *target) { m_target = target; }
protected:
bool eventFilter(QObject *obj, QEvent *event);

View File

@@ -41,7 +41,7 @@ class QMLEDITORWIDGETS_EXPORT ContextPaneWidgetRectangle : public QWidget
Q_OBJECT
public:
explicit ContextPaneWidgetRectangle(QWidget *parent = 0);
explicit ContextPaneWidgetRectangle(QWidget *parent = nullptr);
~ContextPaneWidgetRectangle();
void setProperties(QmlJS::PropertyReader *propertyReader);
void enabableGradientEditing(bool);

View File

@@ -43,7 +43,7 @@ class QMLEDITORWIDGETS_EXPORT CustomColorDialog : public QFrame {
Q_PROPERTY(QColor color READ color WRITE setColor NOTIFY colorChanged)
public:
CustomColorDialog(QWidget *parent = 0);
CustomColorDialog(QWidget *parent = nullptr);
QColor color() const { return m_color; }
void setupColor(const QColor &color);
void setColor(const QColor &color)

View File

@@ -48,12 +48,12 @@ class EasingSimulation : public QObject
Q_OBJECT
public:
QGraphicsView *m_g;
EasingSimulation(QObject *parent=0, QGraphicsView *v=0):QObject(parent) {
EasingSimulation(QObject *parent=nullptr, QGraphicsView *v=nullptr):QObject(parent) {
m_qtLogo = new PixmapItem(QPixmap(":/qmleditorwidgets/qt_logo.png"));
m_scene.addItem(m_qtLogo);
m_scene.setSceneRect(0,0,v->viewport()->width(),m_qtLogo->boundingRect().height());
m_qtLogo->hide();
m_sequential = 0;
m_sequential = nullptr;
m_g = v;
m_g->setScene(&m_scene);
}

View File

@@ -45,7 +45,7 @@ class EasingContextPane : public QWidget
enum GraphDisplayMode { GraphMode, SimulationMode };
public:
explicit EasingContextPane(QWidget *parent = 0);
explicit EasingContextPane(QWidget *parent = nullptr);
~EasingContextPane() override;
void setProperties(QmlJS::PropertyReader *propertyReader);

View File

@@ -49,7 +49,7 @@ class EasingGraph: public QWidget
Q_PROPERTY (QColor zeroColor READ zeroColor WRITE setZeroColor NOTIFY zeroColorChanged)
public:
EasingGraph(QWidget *parent=0);
EasingGraph(QWidget *parent=nullptr);
~EasingGraph() override;
QEasingCurve::Type easingType() const;

View File

@@ -52,7 +52,7 @@ class QMLEDITORWIDGETS_EXPORT FileWidget : public QWidget
public:
FileWidget(QWidget *parent = 0);
FileWidget(QWidget *parent = nullptr);
~FileWidget() override;
QString fileName() const

View File

@@ -92,7 +92,7 @@ void FontSizeSpinBox::onEditingFinished()
QValidator::State FontSizeSpinBox::validate (QString &input, int &p) const
{
QRegExp rx(QLatin1String("\\d+\\s*(px|pt)"));
QRegExpValidator v(rx, 0);
QRegExpValidator v(rx, nullptr);
return v.validate(input, p);
}

View File

@@ -39,7 +39,7 @@ class QMLEDITORWIDGETS_EXPORT FontSizeSpinBox : public QAbstractSpinBox
Q_PROPERTY(int value READ value WRITE setValue NOTIFY valueChanged)
public:
explicit FontSizeSpinBox(QWidget *parent = 0);
explicit FontSizeSpinBox(QWidget *parent = nullptr);
bool isPixelSize() { return !m_isPointSize; }
bool isPointSize() { return m_isPointSize; }

View File

@@ -39,7 +39,7 @@ class QMLEDITORWIDGETS_EXPORT GradientLine : public QWidget {
Q_PROPERTY(QLinearGradient gradient READ gradient WRITE setGradient NOTIFY gradientChanged)
public:
GradientLine(QWidget *parent = 0);
GradientLine(QWidget *parent = nullptr);
QString gradientName() const { return m_gradientName; }
void setGradientName(const QString &newName);

View File

@@ -36,7 +36,7 @@ class QMLEDITORWIDGETS_EXPORT HueControl : public QWidget
Q_PROPERTY(qreal hue READ hue WRITE setHue NOTIFY hueChanged)
public:
HueControl(QWidget *parent = 0) : QWidget(parent), m_color(Qt::white), m_mousePressed(false)
HueControl(QWidget *parent = nullptr) : QWidget(parent), m_color(Qt::white), m_mousePressed(false)
{
setFixedWidth(28);
setFixedHeight(130);

Some files were not shown because too many files have changed in this diff Show More