aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--share/qtcreator/qml/qmlpuppet/instances/nodeinstanceclientproxy.cpp6
-rw-r--r--share/qtcreator/qml/qmlpuppet/instances/nodeinstanceclientproxy.h2
-rw-r--r--share/qtcreator/qml/qmlpuppet/qml2puppet/instances/dummycontextobject.h2
-rw-r--r--share/qtcreator/qml/qmlpuppet/qml2puppet/instances/objectnodeinstance.cpp16
-rw-r--r--share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5nodeinstanceclientproxy.h2
-rw-r--r--share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5nodeinstanceserver.cpp4
-rw-r--r--share/qtcreator/qml/qmlpuppet/qml2puppet/instances/quickitemnodeinstance.cpp6
-rw-r--r--share/qtcreator/qml/qmlpuppet/qml2puppet/instances/servernodeinstance.cpp16
-rw-r--r--share/qtcreator/qml/qmlpuppet/qml2puppet/instances/servernodeinstance.h2
-rw-r--r--share/qtcreator/qml/qmlpuppet/qmlprivategate/qmlprivategate.h4
-rw-r--r--src/app/main.cpp8
-rw-r--r--src/libs/3rdparty/cplusplus/ASTClone.cpp156
-rw-r--r--src/libs/3rdparty/cplusplus/ASTPatternBuilder.h50
-rw-r--r--src/libs/3rdparty/cplusplus/ASTVisitor.cpp2
-rw-r--r--src/libs/3rdparty/cplusplus/Bind.cpp90
-rw-r--r--src/libs/3rdparty/cplusplus/Control.cpp36
-rw-r--r--src/libs/3rdparty/cplusplus/Control.h40
-rw-r--r--src/libs/3rdparty/cplusplus/FullySpecifiedType.h4
-rw-r--r--src/libs/3rdparty/cplusplus/Lexer.cpp8
-rw-r--r--src/libs/3rdparty/cplusplus/LiteralTable.h10
-rw-r--r--src/libs/3rdparty/cplusplus/Literals.cpp2
-rw-r--r--src/libs/3rdparty/cplusplus/Matcher.h4
-rw-r--r--src/libs/3rdparty/cplusplus/MemoryPool.cpp10
-rw-r--r--src/libs/3rdparty/cplusplus/Name.cpp28
-rw-r--r--src/libs/3rdparty/cplusplus/Name.h18
-rw-r--r--src/libs/3rdparty/cplusplus/Names.cpp22
-rw-r--r--src/libs/3rdparty/cplusplus/Parser.cpp284
-rw-r--r--src/libs/3rdparty/cplusplus/Parser.h12
-rw-r--r--src/libs/3rdparty/cplusplus/Scope.cpp28
-rw-r--r--src/libs/3rdparty/cplusplus/Symbol.cpp80
-rw-r--r--src/libs/3rdparty/cplusplus/Symbol.h102
-rw-r--r--src/libs/3rdparty/cplusplus/Symbols.cpp42
-rw-r--r--src/libs/3rdparty/cplusplus/Symbols.h6
-rw-r--r--src/libs/3rdparty/cplusplus/Templates.cpp36
-rw-r--r--src/libs/3rdparty/cplusplus/Templates.h4
-rw-r--r--src/libs/3rdparty/cplusplus/Token.cpp2
-rw-r--r--src/libs/3rdparty/cplusplus/Token.h2
-rw-r--r--src/libs/3rdparty/cplusplus/TranslationUnit.cpp42
-rw-r--r--src/libs/3rdparty/cplusplus/TranslationUnit.h2
-rw-r--r--src/libs/3rdparty/cplusplus/Type.cpp38
-rw-r--r--src/libs/3rdparty/cplusplus/Type.h82
-rw-r--r--src/libs/clangsupport/clangsupportdebugutils.h2
-rw-r--r--src/libs/cplusplus/AlreadyConsideredClassContainer.h2
-rw-r--r--src/libs/cplusplus/CppDocument.cpp20
-rw-r--r--src/libs/cplusplus/CppRewriter.cpp12
-rw-r--r--src/libs/cplusplus/DeprecatedGenTemplateInstance.cpp4
-rw-r--r--src/libs/cplusplus/FindUsages.cpp8
-rw-r--r--src/libs/cplusplus/FindUsages.h8
-rw-r--r--src/libs/cplusplus/LookupContext.cpp80
-rw-r--r--src/libs/cplusplus/LookupContext.h12
-rw-r--r--src/libs/cplusplus/LookupItem.cpp2
-rw-r--r--src/libs/cplusplus/Macro.cpp2
-rw-r--r--src/libs/cplusplus/MatchingText.h2
-rw-r--r--src/libs/cplusplus/Overview.h4
-rw-r--r--src/libs/cplusplus/PreprocessorEnvironment.cpp12
-rw-r--r--src/libs/cplusplus/ResolveExpression.cpp40
-rw-r--r--src/libs/cplusplus/ResolveExpression.h6
-rw-r--r--src/libs/cplusplus/SymbolNameVisitor.cpp2
-rw-r--r--src/libs/cplusplus/TypeOfExpression.cpp12
-rw-r--r--src/libs/cplusplus/TypePrettyPrinter.cpp2
-rw-r--r--src/libs/cplusplus/cppmodelmanagerbase.cpp4
-rw-r--r--src/libs/cplusplus/cppmodelmanagerbase.h2
-rw-r--r--src/libs/cplusplus/pp-engine.cpp24
-rw-r--r--src/libs/cplusplus/pp-engine.h4
-rw-r--r--src/libs/glsl/glslast.cpp4
-rw-r--r--src/libs/glsl/glslastdump.cpp2
-rw-r--r--src/libs/glsl/glslengine.h6
-rw-r--r--src/libs/glsl/glsllexer.cpp4
-rw-r--r--src/libs/glsl/glsllexer.h2
-rw-r--r--src/libs/glsl/glslmemorypool.cpp10
-rw-r--r--src/libs/glsl/glslparser.cpp52
-rw-r--r--src/libs/glsl/glslparser.h4
-rw-r--r--src/libs/glsl/glslsemantic.cpp48
-rw-r--r--src/libs/glsl/glslsemantic.h4
-rw-r--r--src/libs/glsl/glslsymbol.cpp2
-rw-r--r--src/libs/glsl/glslsymbol.h20
-rw-r--r--src/libs/glsl/glslsymbols.cpp8
-rw-r--r--src/libs/glsl/glslsymbols.h2
-rw-r--r--src/libs/glsl/glsltype.h34
-rw-r--r--src/libs/glsl/glsltypes.cpp80
-rw-r--r--src/libs/glsl/glsltypes.h6
-rw-r--r--src/libs/qmldebug/qmldebugconnectionmanager.h2
-rw-r--r--src/libs/qmldebug/qmloutputparser.h2
-rw-r--r--src/libs/qmldebug/qpacketprotocol.h2
-rw-r--r--src/libs/qmleditorwidgets/colorbox.h2
-rw-r--r--src/libs/qmleditorwidgets/colorbutton.h2
-rw-r--r--src/libs/qmleditorwidgets/contextpanetextwidget.h2
-rw-r--r--src/libs/qmleditorwidgets/contextpanewidget.cpp4
-rw-r--r--src/libs/qmleditorwidgets/contextpanewidget.h4
-rw-r--r--src/libs/qmleditorwidgets/contextpanewidgetimage.h10
-rw-r--r--src/libs/qmleditorwidgets/contextpanewidgetrectangle.h2
-rw-r--r--src/libs/qmleditorwidgets/customcolordialog.h2
-rw-r--r--src/libs/qmleditorwidgets/easingpane/easingcontextpane.cpp4
-rw-r--r--src/libs/qmleditorwidgets/easingpane/easingcontextpane.h2
-rw-r--r--src/libs/qmleditorwidgets/easingpane/easinggraph.h2
-rw-r--r--src/libs/qmleditorwidgets/filewidget.h2
-rw-r--r--src/libs/qmleditorwidgets/fontsizespinbox.cpp2
-rw-r--r--src/libs/qmleditorwidgets/fontsizespinbox.h2
-rw-r--r--src/libs/qmleditorwidgets/gradientline.h2
-rw-r--r--src/libs/qmleditorwidgets/huecontrol.h2
-rw-r--r--src/libs/qmljs/jsoncheck.cpp2
-rw-r--r--src/libs/qmljs/persistenttrie.cpp10
-rw-r--r--src/libs/qmljs/qmljsbind.cpp22
-rw-r--r--src/libs/qmljs/qmljsbundle.cpp14
-rw-r--r--src/libs/qmljs/qmljscontext.cpp18
-rw-r--r--src/libs/qmljs/qmljscontext.h2
-rw-r--r--src/libs/qmljs/qmljsdocument.cpp8
-rw-r--r--src/libs/qmljs/qmljsevaluate.cpp8
-rw-r--r--src/libs/qmljs/qmljsevaluate.h2
-rw-r--r--src/libs/qmljs/qmljsfindexportedcpptypes.cpp30
-rw-r--r--src/libs/qmljs/qmljsicons.cpp4
-rw-r--r--src/libs/qmljs/qmljsicontextpane.h2
-rw-r--r--src/libs/qmljs/qmljsinterpreter.cpp122
-rw-r--r--src/libs/qmljs/qmljsinterpreter.h74
-rw-r--r--src/libs/qmljs/qmljslineinfo.cpp6
-rw-r--r--src/libs/qmljs/qmljslink.cpp12
-rw-r--r--src/libs/qmljs/qmljslink.h2
-rw-r--r--src/libs/qmljs/qmljsplugindumper.cpp4
-rw-r--r--src/libs/qmljs/qmljsrewriter.cpp26
-rw-r--r--src/libs/qmljs/qmljsscopebuilder.cpp12
-rw-r--r--src/libs/qmljs/qmljsscopechain.cpp18
-rw-r--r--src/libs/qmljs/qmljsscopechain.h2
-rw-r--r--src/libs/qmljs/qmljstypedescriptionreader.cpp2
-rw-r--r--src/libs/qmljs/qmljsutils.cpp6
-rw-r--r--src/libs/qmljs/qmljsutils.h2
-rw-r--r--src/libs/qmljs/qmljsvalueowner.cpp24
-rw-r--r--src/libs/qmljs/qmljsvalueowner.h2
-rw-r--r--src/libs/sqlite/sqlitedatabasebackend.cpp2
-rw-r--r--src/libs/ssh/sftpfilesystemmodel.cpp16
-rw-r--r--src/libs/ssh/sftpfilesystemmodel.h2
-rw-r--r--src/libs/ssh/sshconnection.h2
-rw-r--r--src/libs/ssh/sshconnectionmanager.cpp10
-rw-r--r--src/libs/ssh/sshkeycreationdialog.h2
-rw-r--r--src/libs/ssh/sshremoteprocessrunner.cpp4
-rw-r--r--src/libs/ssh/sshremoteprocessrunner.h2
-rw-r--r--src/libs/tracing/timelineabstractrenderer.cpp2
-rw-r--r--src/libs/tracing/timelineitemsrenderpass.cpp6
-rw-r--r--src/libs/tracing/timelinenotesrenderpass.cpp4
-rw-r--r--src/libs/tracing/timelineoverviewrenderer.cpp10
-rw-r--r--src/libs/tracing/timelinerenderer.cpp10
-rw-r--r--src/libs/tracing/timelinerenderpass.cpp4
-rw-r--r--src/libs/tracing/timelinerenderstate.cpp2
-rw-r--r--src/libs/tracing/timelineselectionrenderpass.cpp4
-rw-r--r--src/libs/utils/qrcparser.cpp18
-rw-r--r--src/libs/utils/qrcparser.h8
-rw-r--r--src/libs/utils/savefile.cpp18
-rw-r--r--src/plugins/bineditor/bineditorwidget.cpp2
-rw-r--r--src/plugins/clangrefactoring/clangqueryprojectsfindfilter.cpp2
-rw-r--r--src/plugins/clangrefactoring/clangqueryprojectsfindfilter.h2
-rw-r--r--src/plugins/clangrefactoring/qtcreatorclangqueryfindfilter.h2
-rw-r--r--src/plugins/clangrefactoring/qtcreatorsearchhandle.cpp2
-rw-r--r--src/plugins/debugger/breakpoint.cpp2
-rw-r--r--src/plugins/debugger/shared/backtrace.cpp2
-rw-r--r--src/plugins/designer/editordata.h2
-rw-r--r--src/plugins/designer/formeditorstack.cpp6
-rw-r--r--src/plugins/designer/formeditorw.cpp30
-rw-r--r--src/plugins/designer/formtemplatewizardpage.cpp2
-rw-r--r--src/plugins/designer/formwindoweditor.cpp2
-rw-r--r--src/plugins/designer/formwindowfile.cpp2
-rw-r--r--src/plugins/designer/qtcreatorintegration.cpp8
-rw-r--r--src/plugins/designer/settingspage.cpp2
-rw-r--r--src/plugins/modeleditor/modeleditor.cpp6
-rw-r--r--src/plugins/projectexplorer/devicesupport/localprocesslist.cpp2
-rw-r--r--src/plugins/projectexplorer/devicesupport/sshsettingspage.h2
-rw-r--r--src/plugins/qmlpreview/qmlpreviewfileontargetfinder.h4
-rw-r--r--src/plugins/qtsupport/qscxmlcgenerator.h4
-rw-r--r--src/plugins/qtsupport/qtoptionspage.cpp18
-rw-r--r--src/plugins/qtsupport/qtoptionspage.h2
-rw-r--r--src/plugins/qtsupport/qtversionfactory.cpp4
-rw-r--r--src/plugins/qtsupport/uicgenerator.h4
-rw-r--r--src/plugins/resourceeditor/qrceditor/resourceview.cpp2
-rw-r--r--src/plugins/valgrind/callgrind/callgrinddatamodel.cpp2
-rw-r--r--src/plugins/valgrind/callgrind/callgrindparser.cpp2
-rw-r--r--src/plugins/vcsbase/wizard/vcscommandpage.cpp4
-rw-r--r--src/plugins/vcsbase/wizard/vcsconfigurationpage.cpp8
-rw-r--r--src/plugins/winrt/winrtdevice.cpp4
-rw-r--r--src/tools/clangbackend/source/clangtranslationunitupdater.cpp2
-rw-r--r--src/tools/clangbackend/source/utf8positionfromlinecolumn.h6
-rw-r--r--src/tools/sdktool/settings.cpp4
-rw-r--r--src/tools/valgrindfake/outputgenerator.cpp2
180 files changed, 1314 insertions, 1314 deletions
diff --git a/share/qtcreator/qml/qmlpuppet/instances/nodeinstanceclientproxy.cpp b/share/qtcreator/qml/qmlpuppet/instances/nodeinstanceclientproxy.cpp
index a14a6d627f..5ac0e1057b 100644
--- a/share/qtcreator/qml/qmlpuppet/instances/nodeinstanceclientproxy.cpp
+++ b/share/qtcreator/qml/qmlpuppet/instances/nodeinstanceclientproxy.cpp
@@ -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)
{
diff --git a/share/qtcreator/qml/qmlpuppet/instances/nodeinstanceclientproxy.h b/share/qtcreator/qml/qmlpuppet/instances/nodeinstanceclientproxy.h
index a14bbb3b45..2c53a77c90 100644
--- a/share/qtcreator/qml/qmlpuppet/instances/nodeinstanceclientproxy.h
+++ b/share/qtcreator/qml/qmlpuppet/instances/nodeinstanceclientproxy.h
@@ -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;
diff --git a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/dummycontextobject.h b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/dummycontextobject.h
index a5257a2086..6afb5ad0ff 100644
--- a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/dummycontextobject.h
+++ b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/dummycontextobject.h
@@ -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);
diff --git a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/objectnodeinstance.cpp b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/objectnodeinstance.cpp
index 5f88683ffa..ec453956df 100644
--- a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/objectnodeinstance.cpp
+++ b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/objectnodeinstance.cpp
@@ -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();
}
diff --git a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5nodeinstanceclientproxy.h b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5nodeinstanceclientproxy.h
index b8efccc7ec..0b6b696e1a 100644
--- a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5nodeinstanceclientproxy.h
+++ b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5nodeinstanceclientproxy.h
@@ -33,7 +33,7 @@ class Qt5NodeInstanceClientProxy : public NodeInstanceClientProxy
{
Q_OBJECT
public:
- explicit Qt5NodeInstanceClientProxy(QObject *parent = 0);
+ explicit Qt5NodeInstanceClientProxy(QObject *parent = nullptr);
};
} // namespace QmlDesigner
diff --git a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5nodeinstanceserver.cpp b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5nodeinstanceserver.cpp
index 2a9118625c..d8d45c4803 100644
--- a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5nodeinstanceserver.cpp
+++ b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5nodeinstanceserver.cpp
@@ -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()
diff --git a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/quickitemnodeinstance.cpp b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/quickitemnodeinstance.cpp
index 761ad9cdfe..d061cdfc5d 100644
--- a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/quickitemnodeinstance.cpp
+++ b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/quickitemnodeinstance.cpp
@@ -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());
}
diff --git a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/servernodeinstance.cpp b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/servernodeinstance.cpp
index 11234b9521..87aea97d8d 100644
--- a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/servernodeinstance.cpp
+++ b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/servernodeinstance.cpp
@@ -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();
}
diff --git a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/servernodeinstance.h b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/servernodeinstance.h
index c0c3f87608..b37c153f65 100644
--- a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/servernodeinstance.h
+++ b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/servernodeinstance.h
@@ -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();
diff --git a/share/qtcreator/qml/qmlpuppet/qmlprivategate/qmlprivategate.h b/share/qtcreator/qml/qmlpuppet/qmlprivategate/qmlprivategate.h
index 4e90bad1fc..b0b68907ed 100644
--- a/share/qtcreator/qml/qmlpuppet/qmlprivategate/qmlprivategate.h
+++ b/share/qtcreator/qml/qmlpuppet/qmlprivategate/qmlprivategate.h
@@ -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);
diff --git a/src/app/main.cpp b/src/app/main.cpp
index 7e8552841d..359bb673b5 100644
--- a/src/app/main.cpp
+++ b/src/app/main.cpp
@@ -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;
diff --git a/src/libs/3rdparty/cplusplus/ASTClone.cpp b/src/libs/3rdparty/cplusplus/ASTClone.cpp
index 17a1af18d9..65350e3eab 100644
--- a/src/libs/3rdparty/cplusplus/ASTClone.cpp
+++ b/src/libs/3rdparty/cplusplus/ASTClone.cpp
@@ -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);
diff --git a/src/libs/3rdparty/cplusplus/ASTPatternBuilder.h b/src/libs/3rdparty/cplusplus/ASTPatternBuilder.h
index f9ede8834d..c2888b3e2e 100644
--- a/src/libs/3rdparty/cplusplus/ASTPatternBuilder.h
+++ b/src/libs/3rdparty/cplusplus/ASTPatternBuilder.h
@@ -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;
diff --git a/src/libs/3rdparty/cplusplus/ASTVisitor.cpp b/src/libs/3rdparty/cplusplus/ASTVisitor.cpp
index 3e0d62c9f2..efd5ff1d53 100644
--- a/src/libs/3rdparty/cplusplus/ASTVisitor.cpp
+++ b/src/libs/3rdparty/cplusplus/ASTVisitor.cpp
@@ -40,7 +40,7 @@ Control *ASTVisitor::control() const
if (_translationUnit)
return _translationUnit->control();
- return 0;
+ return nullptr;
}
TranslationUnit *ASTVisitor::translationUnit() const
diff --git a/src/libs/3rdparty/cplusplus/Bind.cpp b/src/libs/3rdparty/cplusplus/Bind.cpp
index 80f02304d8..053d4f1388 100644
--- a/src/libs/3rdparty/cplusplus/Bind.cpp
+++ b/src/libs/3rdparty/cplusplus/Bind.cpp
@@ -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);
}
diff --git a/src/libs/3rdparty/cplusplus/Control.cpp b/src/libs/3rdparty/cplusplus/Control.cpp
index 195cc34641..2bbe00c293 100644
--- a/src/libs/3rdparty/cplusplus/Control.cpp
+++ b/src/libs/3rdparty/cplusplus/Control.cpp
@@ -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();
}
diff --git a/src/libs/3rdparty/cplusplus/Control.h b/src/libs/3rdparty/cplusplus/Control.h
index e4020e2653..348864a402 100644
--- a/src/libs/3rdparty/cplusplus/Control.h
+++ b/src/libs/3rdparty/cplusplus/Control.h
@@ -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);
diff --git a/src/libs/3rdparty/cplusplus/FullySpecifiedType.h b/src/libs/3rdparty/cplusplus/FullySpecifiedType.h
index 5a7e33a2db..aa983ada10 100644
--- a/src/libs/3rdparty/cplusplus/FullySpecifiedType.h
+++ b/src/libs/3rdparty/cplusplus/FullySpecifiedType.h
@@ -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;
diff --git a/src/libs/3rdparty/cplusplus/Lexer.cpp b/src/libs/3rdparty/cplusplus/Lexer.cpp
index d1858f007c..dc24f5e96c 100644
--- a/src/libs/3rdparty/cplusplus/Lexer.cpp
+++ b/src/libs/3rdparty/cplusplus/Lexer.cpp
@@ -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();
}
diff --git a/src/libs/3rdparty/cplusplus/LiteralTable.h b/src/libs/3rdparty/cplusplus/LiteralTable.h
index e40055b7ce..494bc928bd 100644
--- a/src/libs/3rdparty/cplusplus/LiteralTable.h
+++ b/src/libs/3rdparty/cplusplus/LiteralTable.h
@@ -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)
diff --git a/src/libs/3rdparty/cplusplus/Literals.cpp b/src/libs/3rdparty/cplusplus/Literals.cpp
index 3300d47c31..d778c2f0cc 100644
--- a/src/libs/3rdparty/cplusplus/Literals.cpp
+++ b/src/libs/3rdparty/cplusplus/Literals.cpp
@@ -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];
diff --git a/src/libs/3rdparty/cplusplus/Matcher.h b/src/libs/3rdparty/cplusplus/Matcher.h
index 6a8da9a7b7..4fc3fb1054 100644
--- a/src/libs/3rdparty/cplusplus/Matcher.h
+++ b/src/libs/3rdparty/cplusplus/Matcher.h
@@ -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);
diff --git a/src/libs/3rdparty/cplusplus/MemoryPool.cpp b/src/libs/3rdparty/cplusplus/MemoryPool.cpp
index bcd5154b72..af6f7ebddb 100644
--- a/src/libs/3rdparty/cplusplus/MemoryPool.cpp
+++ b/src/libs/3rdparty/cplusplus/MemoryPool.cpp
@@ -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];
diff --git a/src/libs/3rdparty/cplusplus/Name.cpp b/src/libs/3rdparty/cplusplus/Name.cpp
index 1016586c89..815b74bbed 100644
--- a/src/libs/3rdparty/cplusplus/Name.cpp
+++ b/src/libs/3rdparty/cplusplus/Name.cpp
@@ -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;
diff --git a/src/libs/3rdparty/cplusplus/Name.h b/src/libs/3rdparty/cplusplus/Name.h
index 460f0bca11..7a4a159ffe 100644
--- a/src/libs/3rdparty/cplusplus/Name.h
+++ b/src/libs/3rdparty/cplusplus/Name.h
@@ -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 {
diff --git a/src/libs/3rdparty/cplusplus/Names.cpp b/src/libs/3rdparty/cplusplus/Names.cpp
index b41234647d..6bcc988f37 100644
--- a/src/libs/3rdparty/cplusplus/Names.cpp
+++ b/src/libs/3rdparty/cplusplus/Names.cpp
@@ -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; }
diff --git a/src/libs/3rdparty/cplusplus/Parser.cpp b/src/libs/3rdparty/cplusplus/Parser.cpp
index 0db3eb4348..fd7b963a87 100644
--- a/src/libs/3rdparty/cplusplus/Parser.cpp
+++ b/src/libs/3rdparty/cplusplus/Parser.cpp
@@ -202,7 +202,7 @@ public:
const auto it = _cache.find(key);
if (it == _cache.end()) {
*foundInCache = false;
- return 0;
+ return nullptr;
} else {
*foundInCache = true;
*resultingTokenIndex = it->second.resultingTokenIndex;
@@ -554,7 +554,7 @@ bool Parser::parseTemplateId(NameAST *&node, int template_token)
}
const bool result = false;
- _astCache->insert(ASTCache::TemplateId, start, 0, cursor(), result);
+ _astCache->insert(ASTCache::TemplateId, start, nullptr, cursor(), result);
rewind(start);
return result;
}
@@ -564,7 +564,7 @@ bool Parser::parseNestedNameSpecifier(NestedNameSpecifierListAST *&node,
{
DEBUG_THIS_RULE();
NestedNameSpecifierListAST **nested_name_specifier = &node;
- NameAST *class_or_namespace_name = 0;
+ NameAST *class_or_namespace_name = nullptr;
if (parseClassOrNamespaceName(class_or_namespace_name) && LA() == T_COLON_COLON) {
int scope_token = consumeToken();
@@ -623,13 +623,13 @@ bool Parser::parseName(NameAST *&node, bool acceptTemplateId)
if (LA() == T_COLON_COLON)
global_scope_token = consumeToken();
- NestedNameSpecifierListAST *nested_name_specifier = 0;
+ NestedNameSpecifierListAST *nested_name_specifier = nullptr;
parseNestedNameSpecifierOpt(nested_name_specifier,
/*acceptTemplateId=*/ true);
- NameAST *unqualified_name = 0;
+ NameAST *unqualified_name = nullptr;
if (parseUnqualifiedName(unqualified_name,
- /*acceptTemplateId=*/ acceptTemplateId || nested_name_specifier != 0)) {
+ /*acceptTemplateId=*/ acceptTemplateId || nested_name_specifier != nullptr)) {
if (! global_scope_token && ! nested_name_specifier) {
node = unqualified_name;
return true;
@@ -655,7 +655,7 @@ bool Parser::parseTranslationUnit(TranslationUnitAST *&node)
while (LA()) {
int start_declaration = cursor();
- DeclarationAST *declaration = 0;
+ DeclarationAST *declaration = nullptr;
if (parseDeclaration(declaration)) {
*decl = new (_pool) DeclarationListAST;
@@ -731,7 +731,7 @@ bool Parser::parseDeclaration(DeclarationAST *&node)
consumeToken();
int lparen_token = 0;
match(T_LPAREN, &lparen_token);
- NameAST *name = 0;
+ NameAST *name = nullptr;
parseName(name);
int comma_token = 0;
match(T_COMMA, &comma_token);
@@ -760,7 +760,7 @@ bool Parser::parseDeclaration(DeclarationAST *&node)
default: {
if (_languageFeatures.objCEnabled && LA() == T___ATTRIBUTE__) {
const int start = cursor();
- SpecifierListAST *attributes = 0, **attr = &attributes;
+ SpecifierListAST *attributes = nullptr, **attr = &attributes;
while (parseGnuAttributeSpecifier(*attr))
attr = &(*attr)->next;
if (LA() == T_AT_INTERFACE)
@@ -818,7 +818,7 @@ bool Parser::parseLinkageBody(DeclarationAST *&node)
break;
int start_declaration = cursor();
- DeclarationAST *declaration = 0;
+ DeclarationAST *declaration = nullptr;
if (parseDeclaration(declaration)) {
*declaration_ptr = new (_pool) DeclarationListAST;
(*declaration_ptr)->value = declaration;
@@ -932,7 +932,7 @@ bool Parser::isNestedNamespace() const
bool Parser::parseNestedNamespace(DeclarationAST *&node)
{
DEBUG_THIS_RULE();
- DeclarationAST *ast = 0;
+ DeclarationAST *ast = nullptr;
if (isNestedNamespace() && parseNamespace(ast)) {
node = ast;
return true;
@@ -1003,7 +1003,7 @@ bool Parser::parseAliasDeclaration(DeclarationAST *&node)
alias->equal_token = consumeToken();
- ExpressionAST *expr = 0;
+ ExpressionAST *expr = nullptr;
parseTypeId(expr);
if (expr)
alias->typeId = expr->asTypeId();
@@ -1020,10 +1020,10 @@ bool Parser::parseConversionFunctionId(NameAST *&node)
if (LA() != T_OPERATOR)
return false;
int operator_token = consumeToken();
- SpecifierListAST *type_specifier = 0;
+ SpecifierListAST *type_specifier = nullptr;
if (! parseTypeSpecifier(type_specifier))
return false;
- PtrOperatorListAST *ptr_operators = 0, **ptr_operators_tail = &ptr_operators;
+ PtrOperatorListAST *ptr_operators = nullptr, **ptr_operators_tail = &ptr_operators;
while (parsePtrOperator(*ptr_operators_tail))
ptr_operators_tail = &(*ptr_operators_tail)->next;
@@ -1042,7 +1042,7 @@ bool Parser::parseOperatorFunctionId(NameAST *&node)
return false;
int operator_token = consumeToken();
- OperatorAST *op = 0;
+ OperatorAST *op = nullptr;
if (! parseOperator(op))
return false;
@@ -1059,7 +1059,7 @@ Parser::TemplateArgumentListEntry *Parser::templateArgumentListEntry(int tokenIn
if (it != _templateArgumentList.end())
return &it->second;
- return 0;
+ return nullptr;
}
bool Parser::parseTemplateArgumentList(ExpressionListAST *&node)
@@ -1069,13 +1069,13 @@ bool Parser::parseTemplateArgumentList(ExpressionListAST *&node)
if (TemplateArgumentListEntry *entry = templateArgumentListEntry(cursor())) {
rewind(entry->cursor);
node = entry->ast;
- return entry->ast != 0;
+ return entry->ast != nullptr;
}
int start = cursor();
ExpressionListAST **template_argument_ptr = &node;
- ExpressionAST *template_argument = 0;
+ ExpressionAST *template_argument = nullptr;
const bool cxx11Enabled = _languageFeatures.cxx11Enabled;
if (parseTemplateArgument(template_argument)) {
*template_argument_ptr = new (_pool) ExpressionListAST;
@@ -1103,14 +1103,14 @@ bool Parser::parseTemplateArgumentList(ExpressionListAST *&node)
ExpressionListAST *template_argument_list = node;
for (ExpressionListAST *iter = template_argument_list, **ast_iter = &node;
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);
}
_templateArgumentList.insert(std::make_pair(start, TemplateArgumentListEntry(start, cursor(), node)));
return true;
}
- _templateArgumentList.insert(std::make_pair(start, TemplateArgumentListEntry(start, cursor(), 0)));
+ _templateArgumentList.insert(std::make_pair(start, TemplateArgumentListEntry(start, cursor(), nullptr)));
return false;
}
@@ -1193,7 +1193,7 @@ bool Parser::parseAsmOperand()
int lparen_token = 0, rparen_token = 0;
match(T_LPAREN, &lparen_token);
- ExpressionAST *expression = 0;
+ ExpressionAST *expression = nullptr;
parseExpression(expression);
match(T_RPAREN, &rparen_token);
return true;
@@ -1238,7 +1238,7 @@ bool Parser::parseTemplateDeclaration(DeclarationAST *&node)
while (LA()) {
int start_declaration = cursor();
- ast->declaration = 0;
+ ast->declaration = nullptr;
if (parseDeclaration(ast->declaration))
break;
@@ -1427,7 +1427,7 @@ bool Parser::parsePtrOperator(PtrOperatorListAST *&node)
if (LA() == T_COLON_COLON)
global_scope_token = consumeToken();
- NestedNameSpecifierListAST *nested_name_specifiers = 0;
+ NestedNameSpecifierListAST *nested_name_specifiers = nullptr;
bool has_nested_name_specifier = parseNestedNameSpecifier(nested_name_specifiers, true);
if (has_nested_name_specifier && LA() == T_STAR) {
PointerToMemberAST *ast = new (_pool) PointerToMemberAST;
@@ -1482,7 +1482,7 @@ bool Parser::parseDeclSpecifierSeq(SpecifierListAST *&decl_specifier_seq,
{
DEBUG_THIS_RULE();
bool has_type_specifier = false;
- NameAST *named_type_specifier = 0;
+ NameAST *named_type_specifier = nullptr;
SpecifierListAST **decl_specifier_seq_ptr = &decl_specifier_seq;
for (;;) {
if (! noStorageSpecifiers && ! onlySimpleTypeSpecifiers && lookAtStorageClassSpecifier()) {
@@ -1526,7 +1526,7 @@ bool Parser::parseDeclSpecifierSeq(SpecifierListAST *&decl_specifier_seq,
break;
}
- return decl_specifier_seq != 0;
+ return decl_specifier_seq != nullptr;
}
bool Parser::parseDeclaratorOrAbstractDeclarator(DeclaratorAST *&node, SpecifierListAST *decl_specifier_list)
@@ -1547,10 +1547,10 @@ bool Parser::parseCoreDeclarator(DeclaratorAST *&node, SpecifierListAST *decl_sp
{
DEBUG_THIS_RULE();
int start = cursor();
- SpecifierListAST *attributes = 0;
+ SpecifierListAST *attributes = nullptr;
parseOptionalAttributeSpecifierSequence(attributes);
- PtrOperatorListAST *ptr_operators = 0, **ptr_operators_tail = &ptr_operators;
+ PtrOperatorListAST *ptr_operators = nullptr, **ptr_operators_tail = &ptr_operators;
while (parsePtrOperator(*ptr_operators_tail))
ptr_operators_tail = &(*ptr_operators_tail)->next;
@@ -1562,7 +1562,7 @@ bool Parser::parseCoreDeclarator(DeclaratorAST *&node, SpecifierListAST *decl_sp
if (LA() == T_DOT_DOT_DOT)
dot_dot_dot_token = consumeToken();
- NameAST *name = 0;
+ NameAST *name = nullptr;
if (parseName(name)) {
DeclaratorIdAST *declarator_id = new (_pool) DeclaratorIdAST;
declarator_id->dot_dot_dot_token = dot_dot_dot_token;
@@ -1579,7 +1579,7 @@ bool Parser::parseCoreDeclarator(DeclaratorAST *&node, SpecifierListAST *decl_sp
warning(attributes->firstToken(), "unexpected attribtues");
int lparen_token = consumeToken();
- DeclaratorAST *declarator = 0;
+ DeclaratorAST *declarator = nullptr;
if (parseDeclarator(declarator, decl_specifier_list) && LA() == T_RPAREN) {
NestedDeclaratorAST *nested_declarator = new (_pool) NestedDeclaratorAST;
nested_declarator->lparen_token = lparen_token;
@@ -1628,12 +1628,12 @@ bool Parser::parseDeclarator(DeclaratorAST *&node, SpecifierListAST *decl_specif
if (LA() == T_LPAREN) {
if (! declaringClass && LA(2) != T_RPAREN && maybeCppInitializer(node)) {
int lparen_token = cursor();
- ExpressionAST *initializer = 0;
+ ExpressionAST *initializer = nullptr;
bool blocked = blockErrors(true);
if (parseInitializer(initializer, &node->equal_token)) {
// maybe the initializer also parses as a FunctionDeclarator?
- ExpressionListParenAST *expr = 0;
+ ExpressionListParenAST *expr = nullptr;
if (initializer)
expr = initializer->asExpressionListParen();
if (expr) {
@@ -1643,7 +1643,7 @@ bool Parser::parseDeclarator(DeclaratorAST *&node, SpecifierListAST *decl_specif
// check for ambiguous declarators.
consumeToken();
- ParameterDeclarationClauseAST *parameter_declaration_clause = 0;
+ ParameterDeclarationClauseAST *parameter_declaration_clause = nullptr;
if (parseParameterDeclarationClause(parameter_declaration_clause) && LA() == T_RPAREN) {
int rparen_token = consumeToken();
@@ -1730,7 +1730,7 @@ bool Parser::parseAbstractCoreDeclarator(DeclaratorAST *&node, SpecifierListAST
{
DEBUG_THIS_RULE();
- PtrOperatorListAST *ptr_operators = 0, **ptr_operators_tail = &ptr_operators;
+ PtrOperatorListAST *ptr_operators = nullptr, **ptr_operators_tail = &ptr_operators;
while (parsePtrOperator(*ptr_operators_tail))
ptr_operators_tail = &(*ptr_operators_tail)->next;
@@ -1738,7 +1738,7 @@ bool Parser::parseAbstractCoreDeclarator(DeclaratorAST *&node, SpecifierListAST
if (LA() == T_LPAREN && LA(2) != T_RPAREN) {
int lparen_token = consumeToken();
- DeclaratorAST *declarator = 0;
+ DeclaratorAST *declarator = nullptr;
if (parseAbstractDeclarator(declarator, decl_specifier_list) && LA() == T_RPAREN) {
NestedDeclaratorAST *nested_declarator = new (_pool) NestedDeclaratorAST;
nested_declarator->lparen_token = lparen_token;
@@ -1768,7 +1768,7 @@ bool Parser::parseAbstractDeclarator(DeclaratorAST *&node, SpecifierListAST *dec
if (! parseAbstractCoreDeclarator(node, decl_specifier_list))
return false;
- PostfixDeclaratorListAST *postfix_declarators = 0,
+ PostfixDeclaratorListAST *postfix_declarators = nullptr,
**postfix_ptr = &postfix_declarators;
for (;;) {
@@ -1879,7 +1879,7 @@ bool Parser::parseTemplateParameterList(DeclarationListAST *&node)
{
DEBUG_THIS_RULE();
DeclarationListAST **template_parameter_ptr = &node;
- DeclarationAST *declaration = 0;
+ DeclarationAST *declaration = nullptr;
if (parseTemplateParameter(declaration)) {
*template_parameter_ptr = new (_pool) DeclarationListAST;
(*template_parameter_ptr)->value = declaration;
@@ -1888,7 +1888,7 @@ bool Parser::parseTemplateParameterList(DeclarationListAST *&node)
while (LA() == T_COMMA) {
consumeToken(); // XXX Store this token somewhere
- declaration = 0;
+ declaration = nullptr;
if (parseTemplateParameter(declaration)) {
*template_parameter_ptr = new (_pool) DeclarationListAST;
(*template_parameter_ptr)->value = declaration;
@@ -1906,7 +1906,7 @@ bool Parser::parseTemplateParameter(DeclarationAST *&node)
if (parseTypeParameter(node))
return true;
bool previousTemplateArguments = switchTemplateArguments(true);
- ParameterDeclarationAST *ast = 0;
+ ParameterDeclarationAST *ast = nullptr;
bool parsed = parseParameterDeclaration(ast);
node = ast;
(void) switchTemplateArguments(previousTemplateArguments);
@@ -2005,7 +2005,7 @@ bool Parser::parseTypeId(ExpressionAST *&node)
DEBUG_THIS_RULE();
CHECK_CACHE(ASTCache::TypeId, ExpressionAST);
- SpecifierListAST *type_specifier = 0;
+ SpecifierListAST *type_specifier = nullptr;
if (parseTypeSpecifier(type_specifier)) {
TypeIdAST *ast = new (_pool) TypeIdAST;
ast->type_specifier_list = type_specifier;
@@ -2024,7 +2024,7 @@ bool Parser::parseParameterDeclarationClause(ParameterDeclarationClauseAST *&nod
CHECK_CACHE(ASTCache::ParameterDeclarationClause, ParameterDeclarationClauseAST);
const int initialCursor = cursor();
- ParameterDeclarationListAST *parameter_declarations = 0;
+ ParameterDeclarationListAST *parameter_declarations = nullptr;
int dot_dot_dot_token = 0;
if (LA() == T_DOT_DOT_DOT)
@@ -2059,7 +2059,7 @@ bool Parser::parseParameterDeclarationList(ParameterDeclarationListAST *&node)
return false; // nothing to do.
ParameterDeclarationListAST **parameter_declaration_ptr = &node;
- ParameterDeclarationAST *declaration = 0;
+ ParameterDeclarationAST *declaration = nullptr;
if (parseParameterDeclaration(declaration)) {
*parameter_declaration_ptr = new (_pool) ParameterDeclarationListAST;
(*parameter_declaration_ptr)->value = declaration;
@@ -2070,7 +2070,7 @@ bool Parser::parseParameterDeclarationList(ParameterDeclarationListAST *&node)
if (LA() == T_DOT_DOT_DOT)
break;
- declaration = 0;
+ declaration = nullptr;
if (parseParameterDeclaration(declaration)) {
*parameter_declaration_ptr = new (_pool) ParameterDeclarationListAST;
(*parameter_declaration_ptr)->value = declaration;
@@ -2085,7 +2085,7 @@ bool Parser::parseParameterDeclarationList(ParameterDeclarationListAST *&node)
bool Parser::parseParameterDeclaration(ParameterDeclarationAST *&node)
{
DEBUG_THIS_RULE();
- SpecifierListAST *decl_specifier_seq = 0;
+ SpecifierListAST *decl_specifier_seq = nullptr;
if (parseDeclSpecifierSeq(decl_specifier_seq)) {
ParameterDeclarationAST *ast = new (_pool) ParameterDeclarationAST;
ast->type_specifier_list = decl_specifier_seq;
@@ -2107,7 +2107,7 @@ bool Parser::parseParameterDeclaration(ParameterDeclarationAST *&node)
const Identifier *Parser::className(ClassSpecifierAST *ast) const
{
if (! ast)
- return 0;
+ return nullptr;
return identifier(ast->name);
}
@@ -2115,7 +2115,7 @@ const Identifier *Parser::className(ClassSpecifierAST *ast) const
const Identifier *Parser::identifier(NameAST *name) const
{
if (! name)
- return 0;
+ return nullptr;
if (QualifiedNameAST *q = name->asQualifiedName())
name = q->unqualified_name;
@@ -2127,7 +2127,7 @@ const Identifier *Parser::identifier(NameAST *name) const
return _translationUnit->identifier(template_id->identifier_token);
}
- return 0;
+ return nullptr;
}
bool Parser::parseClassSpecifier(SpecifierListAST *&node)
@@ -2138,7 +2138,7 @@ bool Parser::parseClassSpecifier(SpecifierListAST *&node)
int classkey_token = consumeToken();
- SpecifierListAST *attributes = 0;
+ SpecifierListAST *attributes = nullptr;
parseOptionalAttributeSpecifierSequence(attributes);
if (LA(1) == T_IDENTIFIER && LA(2) == T_IDENTIFIER) {
@@ -2150,7 +2150,7 @@ bool Parser::parseClassSpecifier(SpecifierListAST *&node)
}
}
- NameAST *name = 0;
+ NameAST *name = nullptr;
parseName(name);
bool parsed = false;
@@ -2175,7 +2175,7 @@ bool Parser::parseClassSpecifier(SpecifierListAST *&node)
name = ast;
}
- BaseSpecifierListAST *base_clause_list = 0;
+ BaseSpecifierListAST *base_clause_list = nullptr;
if (LA() == T_COLON) {
colon_token = cursor();
@@ -2220,7 +2220,7 @@ bool Parser::parseClassSpecifier(SpecifierListAST *&node)
}
int start_declaration = cursor();
- DeclarationAST *declaration = 0;
+ DeclarationAST *declaration = nullptr;
if (parseMemberSpecification(declaration, ast)) {
if (declaration) { // paranoia check
*declaration_ptr = new (_pool) DeclarationListAST;
@@ -2325,7 +2325,7 @@ bool Parser::parseQtPropertyDeclaration(DeclarationAST *&node)
node = ast;
break;
} else if (LA() == T_IDENTIFIER) {
- QtPropertyDeclarationItemAST *item = 0;
+ QtPropertyDeclarationItemAST *item = nullptr;
switch (peekAtQtContextKeyword()) {
case Token_READ:
case Token_WRITE:
@@ -2338,7 +2338,7 @@ bool Parser::parseQtPropertyDeclaration(DeclarationAST *&node)
case Token_STORED:
case Token_USER: {
int item_name_token = consumeToken();
- ExpressionAST *expr = 0;
+ ExpressionAST *expr = nullptr;
if (parsePostfixExpression(expr)) {
QtPropertyDeclarationItemAST *bItem =
new (_pool) QtPropertyDeclarationItemAST;
@@ -2403,7 +2403,7 @@ bool Parser::parseQtEnumDeclaration(DeclarationAST *&node)
ast->enum_specifier_token = consumeToken();
match(T_LPAREN, &ast->lparen_token);
for (NameListAST **iter = &ast->enumerator_list; LA() && LA() != T_RPAREN; iter = &(*iter)->next) {
- NameAST *name_ast = 0;
+ NameAST *name_ast = nullptr;
if (!parseName(name_ast))
break;
*iter = new (_pool) NameListAST;
@@ -2436,7 +2436,7 @@ bool Parser::parseQtFlags(DeclarationAST *&node)
ast->flags_specifier_token = consumeToken();
match(T_LPAREN, &ast->lparen_token);
for (NameListAST **iter = &ast->flag_enums_list; LA() && LA() != T_RPAREN; iter = &(*iter)->next) {
- NameAST *name_ast = 0;
+ NameAST *name_ast = nullptr;
if (!parseName(name_ast))
break;
*iter = new (_pool) NameListAST;
@@ -2486,7 +2486,7 @@ bool Parser::parseQtInterfaces(DeclarationAST *&node)
ast->interfaces_token = consumeToken();
match(T_LPAREN, &ast->lparen_token);
for (QtInterfaceNameListAST **iter = &ast->interface_name_list; LA() && LA() != T_RPAREN; iter = &(*iter)->next) {
- NameAST *name_ast = 0;
+ NameAST *name_ast = nullptr;
if (!parseName(name_ast))
break;
*iter = new (_pool) QtInterfaceNameListAST;
@@ -2494,7 +2494,7 @@ bool Parser::parseQtInterfaces(DeclarationAST *&node)
(*iter)->value->interface_name = name_ast;
for (NameListAST **iter2 = &(*iter)->value->constraint_list; LA() && LA() == T_COLON; iter2 = &(*iter2)->next) {
/*int colon_token =*/ consumeToken();
- NameAST *name_ast2 = 0;
+ NameAST *name_ast2 = nullptr;
if (!parseName(name_ast2))
break;
*iter2 = new (_pool) NameListAST;
@@ -2617,9 +2617,9 @@ bool Parser::parseElaboratedTypeSpecifier(SpecifierListAST *&node)
if (lookAtClassKey() || LA() == T_ENUM || LA() == T_TYPENAME) {
int classkey_token = consumeToken();
- SpecifierListAST *attributes = 0;
+ SpecifierListAST *attributes = nullptr;
parseOptionalAttributeSpecifierSequence(attributes);
- NameAST *name = 0;
+ NameAST *name = nullptr;
if (parseName(name)) {
ElaboratedTypeSpecifierAST *ast = new (_pool) ElaboratedTypeSpecifierAST;
ast->classkey_token = classkey_token;
@@ -2707,7 +2707,7 @@ bool Parser::parseInitDeclarator(DeclaratorAST *&node, SpecifierListAST *decl_sp
if (declaringClass && LA() == T_COLON
&& (! node || ! node->postfix_declarator_list)) {
int colon_token = consumeToken();
- ExpressionAST *expression = 0;
+ ExpressionAST *expression = nullptr;
if (parseConstantExpression(expression) && (LA() == T_COMMA ||
LA() == T_SEMICOLON)) {
// recognized a bitfielddeclarator.
@@ -2835,7 +2835,7 @@ bool Parser::parseInitializerList0x(ExpressionListAST *&node)
{
DEBUG_THIS_RULE();
ExpressionListAST **expression_list_ptr = &node;
- ExpressionAST *expression = 0;
+ ExpressionAST *expression = nullptr;
_initializerClauseDepth.push(1);
@@ -2941,7 +2941,7 @@ bool Parser::parseMemInitializerList(MemInitializerListAST *&node)
bool Parser::parseMemInitializer(MemInitializerListAST *&node)
{
DEBUG_THIS_RULE();
- NameAST *name = 0;
+ NameAST *name = nullptr;
if (! parseName(name))
return false;
@@ -2969,7 +2969,7 @@ bool Parser::parseTypeIdList(ExpressionListAST *&node)
{
DEBUG_THIS_RULE();
ExpressionListAST **expression_list_ptr = &node;
- ExpressionAST *typeId = 0;
+ ExpressionAST *typeId = nullptr;
if (parseTypeId(typeId)) {
*expression_list_ptr = new (_pool) ExpressionListAST;
(*expression_list_ptr)->value = typeId;
@@ -3009,7 +3009,7 @@ bool Parser::parseExpressionList(ExpressionListAST *&node)
}
ExpressionListAST **expression_list_ptr = &node;
- ExpressionAST *expression = 0;
+ ExpressionAST *expression = nullptr;
if (parseAssignmentExpression(expression)) {
*expression_list_ptr = new (_pool) ExpressionListAST;
(*expression_list_ptr)->value = expression;
@@ -3029,7 +3029,7 @@ bool Parser::parseExpressionList(ExpressionListAST *&node)
}
const bool result = false;
- _astCache->insert(ASTCache::ExpressionList, initialCursor, 0, cursor(), result);
+ _astCache->insert(ASTCache::ExpressionList, initialCursor, nullptr, cursor(), result);
return result;
}
@@ -3071,14 +3071,14 @@ bool Parser::parseInitializerList(ExpressionListAST *&node)
{
DEBUG_THIS_RULE();
ExpressionListAST **initializer_ptr = &node;
- ExpressionAST *initializer = 0;
+ ExpressionAST *initializer = nullptr;
if (parseInitializerClause(initializer)) {
*initializer_ptr = new (_pool) ExpressionListAST;
(*initializer_ptr)->value = initializer;
initializer_ptr = &(*initializer_ptr)->next;
while (LA() == T_COMMA) {
consumeToken(); // consume T_COMMA
- initializer = 0;
+ initializer = nullptr;
parseInitializerClause(initializer);
*initializer_ptr = new (_pool) ExpressionListAST;
(*initializer_ptr)->value = initializer;
@@ -3205,7 +3205,7 @@ bool Parser::parseExpressionStatement(StatementAST *&node)
bool parsed = false;
- ExpressionAST *expression = 0;
+ ExpressionAST *expression = nullptr;
if (parseExpression(expression)) {
ExpressionStatementAST *ast = new (previousPool) ExpressionStatementAST;
if (expression)
@@ -3253,7 +3253,7 @@ bool Parser::parseStatement(StatementAST *&node, bool blockLabeledStatement)
return parseSwitchStatement(node);
case T_TRY:
- return parseTryBlockStatement(node, 0);
+ return parseTryBlockStatement(node, nullptr);
case T_CASE:
case T_DEFAULT:
@@ -3314,7 +3314,7 @@ bool Parser::parseStatement(StatementAST *&node, bool blockLabeledStatement)
// Simply skip the emit token and parse as an expression statement - no strong
// reason to have an specific ast type.
consumeToken();
- ExpressionAST *expression = 0;
+ ExpressionAST *expression = nullptr;
if (parsePostfixExpression(expression)) {
ExpressionStatementAST *ast = new (_pool) ExpressionStatementAST;
ast->expression = expression;
@@ -3403,7 +3403,7 @@ bool Parser::maybeAmbiguousStatement(DeclarationStatementAST *ast, StatementAST
bool maybeAmbiguous = false;
- StatementAST *stmt = 0;
+ StatementAST *stmt = nullptr;
if (parseExpressionStatement(stmt)) {
if (stmt->firstToken() == start && stmt->lastToken() == end) {
maybeAmbiguous = true;
@@ -3438,7 +3438,7 @@ bool Parser::parseExpressionOrDeclarationStatement(StatementAST *&node)
if (LA() == T_IDENTIFIER || (LA() == T_COLON_COLON && LA(2) == T_IDENTIFIER)) {
const bool blocked = blockErrors(true);
- ExpressionAST *expression = 0;
+ ExpressionAST *expression = nullptr;
const bool hasExpression = parseExpression(expression);
const int afterExpression = cursor();
@@ -3467,7 +3467,7 @@ bool Parser::parseExpressionOrDeclarationStatement(StatementAST *&node)
}
}
} else if (CallAST *call = expression->asCall()) {
- if (call->base_expression->asIdExpression() != 0) {
+ if (call->base_expression->asIdExpression() != nullptr) {
(void) blockErrors(blocked);
node = as_expression;
match(T_SEMICOLON, &as_expression->semicolon_token);
@@ -3477,14 +3477,14 @@ bool Parser::parseExpressionOrDeclarationStatement(StatementAST *&node)
rewind(start);
- DeclarationAST *declaration = 0;
+ DeclarationAST *declaration = nullptr;
if (parseSimpleDeclaration(declaration)) {
DeclarationStatementAST *as_declaration = new (_pool) DeclarationStatementAST;
as_declaration->declaration = declaration;
SimpleDeclarationAST *simple = declaration->asSimpleDeclaration();
if (! semicolon_token || invalidAssignment || semicolon_token != simple->semicolon_token ||
- (simple->decl_specifier_list != 0 && simple->declarator_list != 0)) {
+ (simple->decl_specifier_list != nullptr && simple->declarator_list != nullptr)) {
node = as_declaration;
(void) blockErrors(blocked);
return true;
@@ -3521,10 +3521,10 @@ bool Parser::parseCondition(ExpressionAST *&node)
int start = cursor();
bool blocked = blockErrors(true);
- SpecifierListAST *type_specifier = 0;
+ SpecifierListAST *type_specifier = nullptr;
if (parseTypeSpecifier(type_specifier)) {
- DeclaratorAST *declarator = 0;
- if (parseInitDeclarator(declarator, type_specifier, /*declaringClass=*/ 0)) {
+ DeclaratorAST *declarator = nullptr;
+ if (parseInitDeclarator(declarator, type_specifier, /*declaringClass=*/ nullptr)) {
if (declarator->initializer && declarator->equal_token) {
ConditionAST *ast = new (_pool) ConditionAST;
ast->type_specifier_list = type_specifier;
@@ -3590,8 +3590,8 @@ bool Parser::parseForeachStatement(StatementAST *&node)
parseDeclarator(ast->declarator, ast->type_specifier_list);
if (! ast->type_specifier_list || ! ast->declarator) {
- ast->type_specifier_list = 0;
- ast->declarator = 0;
+ ast->type_specifier_list = nullptr;
+ ast->declarator = nullptr;
blockErrors(blocked);
rewind(startOfTypeSpecifier);
@@ -3634,16 +3634,16 @@ bool Parser::parseForStatement(StatementAST *&node)
if ((ast->type_specifier_list || ast->declarator) && !peekAtObjCContextKeyword(Token_in)) {
// woops, probably parsed too much: "in" got parsed as a declarator. Let's redo it:
- ast->type_specifier_list = 0;
- ast->declarator = 0;
+ ast->type_specifier_list = nullptr;
+ ast->declarator = nullptr;
rewind(startOfTypeSpecifier);
parseDeclarator(ast->declarator, ast->type_specifier_list);
}
if (! ast->type_specifier_list || ! ast->declarator) {
- ast->type_specifier_list = 0;
- ast->declarator = 0;
+ ast->type_specifier_list = nullptr;
+ ast->declarator = nullptr;
rewind(startOfTypeSpecifier);
parseAssignmentExpression(ast->initializer);
@@ -3737,7 +3737,7 @@ bool Parser::parseCompoundStatement(StatementAST *&node)
break;
int start_statement = cursor();
- StatementAST *statement = 0;
+ StatementAST *statement = nullptr;
if (! parseStatement(statement)) {
rewind(start_statement + 1);
skipUntilStatement();
@@ -3877,7 +3877,7 @@ bool Parser::parseDeclarationStatement(StatementAST *&node)
{
DEBUG_THIS_RULE();
int start = cursor();
- DeclarationAST *declaration = 0;
+ DeclarationAST *declaration = nullptr;
if (! parseBlockDeclaration(declaration))
return false;
@@ -4131,8 +4131,8 @@ bool Parser::parseSimpleDeclaration(DeclarationAST *&node, ClassSpecifierAST *de
bool has_type_specifier = false;
bool has_complex_type_specifier = false;
int startOfNamedTypeSpecifier = 0;
- NameAST *named_type_specifier = 0;
- SpecifierListAST *decl_specifier_seq = 0,
+ NameAST *named_type_specifier = nullptr;
+ SpecifierListAST *decl_specifier_seq = nullptr,
**decl_specifier_seq_ptr = &decl_specifier_seq;
for (;;) {
if (lookAtCVQualifier() || lookAtFunctionSpecifier()
@@ -4216,22 +4216,22 @@ bool Parser::parseSimpleDeclaration(DeclarationAST *&node, ClassSpecifierAST *de
break;
}
- DeclaratorListAST *declarator_list = 0,
+ DeclaratorListAST *declarator_list = nullptr,
**declarator_ptr = &declarator_list;
- DeclaratorAST *declarator = 0;
+ DeclaratorAST *declarator = nullptr;
if (LA() != T_SEMICOLON) {
const bool maybeCtor = (LA() == T_LPAREN && named_type_specifier);
bool didParseInitDeclarator = parseInitDeclarator(declarator, decl_specifier_seq, declaringClass);
if ((! didParseInitDeclarator && maybeCtor) || (didParseInitDeclarator && maybeCtor && LA() == T_COLON)){
rewind(startOfNamedTypeSpecifier);
- named_type_specifier = 0;
+ named_type_specifier = nullptr;
// pop the named type specifier from the decl-specifier-seq
SpecifierListAST **spec_ptr = &decl_specifier_seq;
for (; *spec_ptr; spec_ptr = &(*spec_ptr)->next) {
if (! (*spec_ptr)->next) {
- *spec_ptr = 0;
+ *spec_ptr = nullptr;
break;
}
}
@@ -4258,7 +4258,7 @@ bool Parser::parseSimpleDeclaration(DeclarationAST *&node, ClassSpecifierAST *de
while (LA() == T_COMMA) {
consumeToken(); // consume T_COMMA
- declarator = 0;
+ declarator = nullptr;
if (parseInitDeclarator(declarator, decl_specifier_seq, declaringClass)) {
*declarator_ptr = new (_pool) DeclaratorListAST;
(*declarator_ptr)->value = declarator;
@@ -4282,7 +4282,7 @@ bool Parser::parseSimpleDeclaration(DeclarationAST *&node, ClassSpecifierAST *de
node = ast;
CACHE_AND_RETURN(cacheKey, true); // recognized a function definition.
} else {
- CtorInitializerAST *ctor_initializer = 0;
+ CtorInitializerAST *ctor_initializer = nullptr;
bool hasCtorInitializer = false;
if (LA() == T_COLON) {
@@ -4339,7 +4339,7 @@ bool Parser::maybeForwardOrClassDeclaration(SpecifierListAST *decl_specifier_seq
spec->asEnumSpecifier() ||
spec->asClassSpecifier()) {
for (it = it->next; it; it = it->next)
- if (it->value->asAttributeSpecifier() == 0)
+ if (it->value->asAttributeSpecifier() == nullptr)
return false;
return true;
}
@@ -4392,7 +4392,7 @@ bool Parser::parseTryBlockStatement(StatementAST *&node, CtorInitializerAST **pl
// [ctor-initializer]
if (LA() == T_COLON) {
const int colonPos = cursor();
- CtorInitializerAST *ctor_initializer = 0;
+ CtorInitializerAST *ctor_initializer = nullptr;
parseCtorInitializer(ctor_initializer);
if (LA() != T_LBRACE) {
@@ -4451,7 +4451,7 @@ bool Parser::parseExceptionDeclaration(ExceptionDeclarationAST *&node)
return true;
}
- SpecifierListAST *type_specifier = 0;
+ SpecifierListAST *type_specifier = nullptr;
if (parseTypeSpecifier(type_specifier)) {
ExceptionDeclarationAST *ast = new (_pool) ExceptionDeclarationAST;
ast->type_specifier_list = type_specifier;
@@ -4554,7 +4554,7 @@ bool Parser::parsePrimaryExpression(ExpressionAST *&node)
// GNU extension: '(' '{' statement-list '}' ')'
CompoundExpressionAST *ast = new (_pool) CompoundExpressionAST;
ast->lparen_token = consumeToken();
- StatementAST *statement = 0;
+ StatementAST *statement = nullptr;
parseCompoundStatement(statement);
ast->statement = statement->asCompoundStatement();
match(T_RPAREN, &ast->rparen_token);
@@ -4589,7 +4589,7 @@ bool Parser::parsePrimaryExpression(ExpressionAST *&node)
return parseObjCExpression(node);
default: {
- NameAST *name = 0;
+ NameAST *name = nullptr;
if (parseNameId(name)) {
IdExpressionAST *ast = new (_pool) IdExpressionAST;
ast->name = name;
@@ -4810,9 +4810,9 @@ bool Parser::parseObjCMessageExpression(ExpressionAST *&node)
int start = cursor();
int lbracket_token = consumeToken();
- ExpressionAST *receiver_expression = 0;
- ObjCSelectorAST *selector = 0;
- ObjCMessageArgumentListAST *argument_list = 0;
+ ExpressionAST *receiver_expression = nullptr;
+ ObjCSelectorAST *selector = nullptr;
+ ObjCMessageArgumentListAST *argument_list = nullptr;
if (parseObjCMessageReceiver(receiver_expression) &&
parseObjCMessageArguments(selector, argument_list)) {
@@ -4847,8 +4847,8 @@ bool Parser::parseObjCMessageArguments(ObjCSelectorAST *&selNode, ObjCMessageArg
int start = cursor();
- ObjCSelectorArgumentAST *selectorArgument = 0;
- ObjCMessageArgumentAST *messageArgument = 0;
+ ObjCSelectorArgumentAST *selectorArgument = nullptr;
+ ObjCMessageArgumentAST *messageArgument = nullptr;
if (parseObjCSelectorArg(selectorArgument, messageArgument)) {
ObjCSelectorArgumentListAST *selAst = new (_pool) ObjCSelectorArgumentListAST;
@@ -4898,7 +4898,7 @@ bool Parser::parseObjCMessageArguments(ObjCSelectorAST *&selNode, ObjCMessageArg
sel->selector_argument_list->value = new (_pool) ObjCSelectorArgumentAST;
sel->selector_argument_list->value->name_token = name_token;
selNode = sel;
- argNode = 0;
+ argNode = nullptr;
return true;
}
@@ -4942,7 +4942,7 @@ bool Parser::parseNameId(NameAST *&name)
QualifiedNameAST *qualified_name_id = name->asQualifiedName();
- TemplateIdAST *template_id = 0;
+ TemplateIdAST *template_id = nullptr;
if (qualified_name_id) {
if (NameAST *unqualified_name = qualified_name_id->unqualified_name)
template_id = unqualified_name->asTemplateId();
@@ -4960,7 +4960,7 @@ bool Parser::parseNameId(NameAST *&name)
template_arguments->value->asBinaryExpression()) {
int saved = cursor();
- ExpressionAST *expr = 0;
+ ExpressionAST *expr = nullptr;
bool blocked = blockErrors(true);
bool lookAtCastExpression = parseCastExpression(expr);
@@ -4972,7 +4972,7 @@ bool Parser::parseNameId(NameAST *&name)
&& cast_expression->type_id && cast_expression->expression) {
rewind(start);
- name = 0;
+ name = nullptr;
return parseName(name, false);
}
}
@@ -5016,7 +5016,7 @@ bool Parser::parseNestedExpression(ExpressionAST *&node)
int lparen_token = consumeToken();
bool previousTemplateArguments = switchTemplateArguments(false);
- ExpressionAST *expression = 0;
+ ExpressionAST *expression = nullptr;
if (parseExpression(expression) && LA() == T_RPAREN) {
NestedExpressionAST *ast = new (_pool) NestedExpressionAST;
ast->lparen_token = lparen_token;
@@ -5057,7 +5057,7 @@ bool Parser::parseTypenameCallExpression(ExpressionAST *&node)
DEBUG_THIS_RULE();
if (LA() == T_TYPENAME) {
int typename_token = consumeToken();
- NameAST *name = 0;
+ NameAST *name = nullptr;
if (parseName(name)
&& (LA() == T_LPAREN || (_languageFeatures.cxx11Enabled && LA() == T_LBRACE))) {
TypenameCallExpressionAST *ast = new (_pool) TypenameCallExpressionAST;
@@ -5116,12 +5116,12 @@ bool Parser::parseCorePostfixExpression(ExpressionAST *&node)
default: {
int start = cursor();
- SpecifierListAST *type_specifier = 0;
+ SpecifierListAST *type_specifier = nullptr;
bool blocked = blockErrors(true);
if (lookAtBuiltinTypeSpecifier() &&
parseSimpleTypeSpecifier(type_specifier) &&
(LA() == T_LPAREN || (_languageFeatures.cxx11Enabled && LA() == T_LBRACE))) {
- ExpressionAST *expr = 0;
+ ExpressionAST *expr = nullptr;
if (LA() == T_LPAREN) {
parseExpressionListParen(expr);
} else { // T_LBRACE
@@ -5139,7 +5139,7 @@ bool Parser::parseCorePostfixExpression(ExpressionAST *&node)
// look for compound literals
if (LA() == T_LPAREN) {
int lparen_token = consumeToken();
- ExpressionAST *type_id = 0;
+ ExpressionAST *type_id = nullptr;
if (parseTypeId(type_id) && LA() == T_RPAREN) {
int rparen_token = consumeToken();
if (LA() == T_LBRACE) {
@@ -5281,7 +5281,7 @@ bool Parser::parseUnaryExpression(ExpressionAST *&node)
ast->alignof_token = consumeToken();
match(T_LPAREN, &ast->lparen_token);
- ExpressionAST *temp = 0;
+ ExpressionAST *temp = nullptr;
parseTypeId(temp);
if (temp)
ast->typeId = temp->asTypeId();
@@ -5319,7 +5319,7 @@ bool Parser::parseExpressionListParen(ExpressionAST *&node)
DEBUG_THIS_RULE();
if (LA() == T_LPAREN) {
int lparen_token = consumeToken();
- ExpressionListAST *expression_list = 0;
+ ExpressionListAST *expression_list = nullptr;
if (parseExpressionList(expression_list) && LA() == T_RPAREN) {
int rparen_token = consumeToken();
ExpressionListParenAST *ast = new (_pool) ExpressionListParenAST;
@@ -5351,12 +5351,12 @@ bool Parser::parseNewExpression(ExpressionAST *&node)
ast->new_token = consumeToken();
- ExpressionAST *parenExpressionList = 0;
+ ExpressionAST *parenExpressionList = nullptr;
if (parseExpressionListParen(parenExpressionList)) {
int after_new_placement = cursor();
- NewTypeIdAST *new_type_id = 0;
+ NewTypeIdAST *new_type_id = nullptr;
if (parseNewTypeId(new_type_id)) {
ast->new_placement = parenExpressionList->asExpressionListParen();
ast->new_type_id = new_type_id;
@@ -5369,7 +5369,7 @@ bool Parser::parseNewExpression(ExpressionAST *&node)
rewind(after_new_placement);
if (LA() == T_LPAREN) {
int lparen_token = consumeToken();
- ExpressionAST *type_id = 0;
+ ExpressionAST *type_id = nullptr;
if (parseTypeId(type_id) && LA() == T_RPAREN) {
ast->new_placement = parenExpressionList->asExpressionListParen();
ast->lparen_token = lparen_token;
@@ -5386,7 +5386,7 @@ bool Parser::parseNewExpression(ExpressionAST *&node)
if (LA() == T_LPAREN) {
int lparen_token = consumeToken();
- ExpressionAST *type_id = 0;
+ ExpressionAST *type_id = nullptr;
if (parseTypeId(type_id) && LA() == T_RPAREN) {
ast->lparen_token = lparen_token;
ast->type_id = type_id;
@@ -5406,7 +5406,7 @@ bool Parser::parseNewExpression(ExpressionAST *&node)
bool Parser::parseNewTypeId(NewTypeIdAST *&node)
{
DEBUG_THIS_RULE();
- SpecifierListAST *typeSpec = 0;
+ SpecifierListAST *typeSpec = nullptr;
if (! parseTypeSpecifier(typeSpec))
return false;
@@ -5481,7 +5481,7 @@ bool Parser::parseCastExpression(ExpressionAST *&node)
if (LA() == T_LPAREN) {
int lparen_token = consumeToken();
int initialCursor = cursor();
- ExpressionAST *type_id = 0;
+ ExpressionAST *type_id = nullptr;
if (parseTypeId(type_id) && LA() == T_RPAREN) {
if (TypeIdAST *tid = type_id->asTypeId()) {
@@ -5496,7 +5496,7 @@ bool Parser::parseCastExpression(ExpressionAST *&node)
const int rparen_token = consumeToken();
const bool blocked = blockErrors(true);
- ExpressionAST *unary = 0;
+ ExpressionAST *unary = nullptr;
bool followedByUnaryExpression = parseUnaryExpression(unary);
blockErrors(blocked);
rewind(rparen_token);
@@ -5505,7 +5505,7 @@ bool Parser::parseCastExpression(ExpressionAST *&node)
if (! unary)
followedByUnaryExpression = false;
else if (UnaryExpressionAST *u = unary->asUnaryExpression())
- followedByUnaryExpression = u->expression != 0;
+ followedByUnaryExpression = u->expression != nullptr;
}
if (! followedByUnaryExpression)
@@ -5522,7 +5522,7 @@ bool Parser::parseCastExpression(ExpressionAST *&node)
}
int rparen_token = consumeToken();
- ExpressionAST *expression = 0;
+ ExpressionAST *expression = nullptr;
if (parseCastExpression(expression)) {
CastExpressionAST *ast = new (_pool) CastExpressionAST;
ast->lparen_token = lparen_token;
@@ -5535,7 +5535,7 @@ bool Parser::parseCastExpression(ExpressionAST *&node)
}
parse_as_unary_expression:
- _astCache->insert(ASTCache::TypeId, initialCursor, 0, cursor(), false);
+ _astCache->insert(ASTCache::TypeId, initialCursor, nullptr, cursor(), false);
rewind(lparen_token);
}
@@ -5618,7 +5618,7 @@ bool Parser::parseQtMethod(ExpressionAST *&node)
QtMethodAST *ast = new (_pool) QtMethodAST;
ast->method_token = consumeToken();
match(T_LPAREN, &ast->lparen_token);
- if (! parseDeclarator(ast->declarator, /*decl_specifier_seq =*/ 0))
+ if (! parseDeclarator(ast->declarator, /*decl_specifier_seq =*/ nullptr))
error(cursor(), "expected a function declarator before token `%s'", tok().spell());
match(T_RPAREN, &ast->rparen_token);
node = ast;
@@ -5664,21 +5664,21 @@ void Parser::parseExpressionWithOperatorPrecedence(ExpressionAST *&lhs, int minP
const int operPrecedence = precedence(tok().kind(), _templateArguments);
const int oper = consumeToken();
- ConditionalExpressionAST *condExpr = 0;
+ ConditionalExpressionAST *condExpr = nullptr;
if (operPrecedence == Prec::Conditional) {
condExpr = new (_pool) ConditionalExpressionAST;
condExpr->question_token = oper;
if (tok().kind() == T_COLON) {
// GNU extension:
// logical-or-expression '?' ':' conditional-expression
- condExpr->left_expression = 0;
+ condExpr->left_expression = nullptr;
} else {
parseExpression(condExpr->left_expression);
}
match(T_COLON, &condExpr->colon_token);
}
- ExpressionAST *rhs = 0;
+ ExpressionAST *rhs = nullptr;
const bool isCPlusPlus = true;
if (operPrecedence <= Prec::Conditional && isCPlusPlus) {
// in C++ you can put a throw in the right-most expression of a conditional expression,
@@ -5783,7 +5783,7 @@ bool Parser::parseDesignatedInitializer(ExpressionAST *&node)
DesignatedInitializerAST *ast = new (_pool) DesignatedInitializerAST;
DesignatorListAST **designator_list_ptr = &ast->designator_list;
- DesignatorAST *designator = 0;
+ DesignatorAST *designator = nullptr;
const int start = cursor();
while (parseDesignator(designator)) {
*designator_list_ptr = new (_pool) DesignatorListAST;
@@ -5931,7 +5931,7 @@ bool Parser::parseObjCInterface(DeclarationAST *&node,
parseObjCProtocolRefs(ast->protocol_refs);
DeclarationListAST **nextMembers = &ast->member_declaration_list;
- DeclarationAST *declaration = 0;
+ DeclarationAST *declaration = nullptr;
while (parseObjCInterfaceMemberDeclaration(declaration)) {
*nextMembers = new (_pool) DeclarationListAST;
(*nextMembers)->value = declaration;
@@ -5962,7 +5962,7 @@ bool Parser::parseObjCInterface(DeclarationAST *&node,
parseObjClassInstanceVariables(ast->inst_vars_decl);
DeclarationListAST **nextMembers = &ast->member_declaration_list;
- DeclarationAST *declaration = 0;
+ DeclarationAST *declaration = nullptr;
while (parseObjCInterfaceMemberDeclaration(declaration)) {
*nextMembers = new (_pool) DeclarationListAST;
(*nextMembers)->value = declaration;
@@ -6033,7 +6033,7 @@ bool Parser::parseObjCProtocol(DeclarationAST *&node,
parseObjCProtocolRefs(ast->protocol_refs);
DeclarationListAST **nextMembers = &ast->member_declaration_list;
- DeclarationAST *declaration = 0;
+ DeclarationAST *declaration = nullptr;
while (parseObjCInterfaceMemberDeclaration(declaration)) {
*nextMembers = new (_pool) DeclarationListAST;
(*nextMembers)->value = declaration;
@@ -6111,7 +6111,7 @@ bool Parser::parseObjCMethodDefinitionList(DeclarationListAST *&node)
while (LA() && LA() != T_AT_END) {
int start = cursor();
- DeclarationAST *declaration = 0;
+ DeclarationAST *declaration = nullptr;
switch (LA()) {
case T_PLUS:
@@ -6213,7 +6213,7 @@ bool Parser::parseObjCMethodDefinitionList(DeclarationListAST *&node)
bool Parser::parseObjCMethodDefinition(DeclarationAST *&node)
{
DEBUG_THIS_RULE();
- ObjCMethodPrototypeAST *method_prototype = 0;
+ ObjCMethodPrototypeAST *method_prototype = nullptr;
if (! parseObjCMethodPrototype(method_prototype))
return false;
@@ -6393,7 +6393,7 @@ bool Parser::parseObjCPropertyDeclaration(DeclarationAST *&node, SpecifierListAS
if (LA() == T_LPAREN) {
match(T_LPAREN, &ast->lparen_token);
- ObjCPropertyAttributeAST *property_attribute = 0;
+ ObjCPropertyAttributeAST *property_attribute = nullptr;
if (parseObjCPropertyAttribute(property_attribute)) {
ast->property_attribute_list = new (_pool) ObjCPropertyAttributeListAST;
ast->property_attribute_list->value = property_attribute;
@@ -6439,8 +6439,8 @@ bool Parser::parseObjCMethodPrototype(ObjCMethodPrototypeAST *&node)
parseObjCTypeName(ast->type_name);
if ((lookAtObjCSelector() && LA(2) == T_COLON) || LA() == T_COLON) {
- ObjCSelectorArgumentAST *argument = 0;
- ObjCMessageArgumentDeclarationAST *declaration = 0;
+ ObjCSelectorArgumentAST *argument = nullptr;
+ ObjCMessageArgumentDeclarationAST *declaration = nullptr;
parseObjCKeywordDeclaration(argument, declaration);
ObjCSelectorAST *sel = new (_pool) ObjCSelectorAST;
@@ -6472,7 +6472,7 @@ bool Parser::parseObjCMethodPrototype(ObjCMethodPrototypeAST *&node)
}
// TODO: Is this still valid, and if so, should it be stored in the AST? (EV)
- ParameterDeclarationAST *parameter_declaration = 0;
+ ParameterDeclarationAST *parameter_declaration = nullptr;
parseParameterDeclaration(parameter_declaration);
}
} else if (lookAtObjCSelector()) {
@@ -6661,7 +6661,7 @@ bool Parser::parseLambdaExpression(ExpressionAST *&node)
{
DEBUG_THIS_RULE();
- LambdaIntroducerAST *lambda_introducer = 0;
+ LambdaIntroducerAST *lambda_introducer = nullptr;
if (parseLambdaIntroducer(lambda_introducer)) {
LambdaExpressionAST *ast = new (_pool) LambdaExpressionAST;
ast->lambda_introducer = lambda_introducer;
@@ -6704,7 +6704,7 @@ bool Parser::parseLambdaCapture(LambdaCaptureAST *&node)
bool startsWithDefaultCapture = false;
int default_capture = 0;
- CaptureListAST *capture_list = 0;
+ CaptureListAST *capture_list = nullptr;
if (LA() == T_AMPER || LA() == T_EQUAL) {
if (LA(2) == T_COMMA || LA(2) == T_RBRACKET) {
@@ -6758,7 +6758,7 @@ bool Parser::parseCaptureList(CaptureListAST *&node)
{
DEBUG_THIS_RULE();
- CaptureAST *capture = 0;
+ CaptureAST *capture = nullptr;
if (parseCapture(capture)) {
node = new (_pool) CaptureListAST;
@@ -6767,7 +6767,7 @@ bool Parser::parseCaptureList(CaptureListAST *&node)
CaptureListAST **l = &node->next;
while (LA() == T_COMMA) {
consumeToken(); // consume `,'
- CaptureAST *capture = 0;
+ CaptureAST *capture = nullptr;
parseCapture(capture);
if (capture) {
*l = new (_pool) CaptureListAST;
diff --git a/src/libs/3rdparty/cplusplus/Parser.h b/src/libs/3rdparty/cplusplus/Parser.h
index fc2bffaf54..750c590b40 100644
--- a/src/libs/3rdparty/cplusplus/Parser.h
+++ b/src/libs/3rdparty/cplusplus/Parser.h
@@ -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) {}
};
diff --git a/src/libs/3rdparty/cplusplus/Scope.cpp b/src/libs/3rdparty/cplusplus/Scope.cpp
index a6aa43ca97..43d8c98965 100644
--- a/src/libs/3rdparty/cplusplus/Scope.cpp
+++ b/src/libs/3rdparty/cplusplus/Scope.cpp
@@ -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
diff --git a/src/libs/3rdparty/cplusplus/Symbol.cpp b/src/libs/3rdparty/cplusplus/Symbol.cpp
index e93060a57b..62100474b4 100644
--- a/src/libs/3rdparty/cplusplus/Symbol.cpp
+++ b/src/libs/3rdparty/cplusplus/Symbol.cpp
@@ -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)
{
diff --git a/src/libs/3rdparty/cplusplus/Symbol.h b/src/libs/3rdparty/cplusplus/Symbol.h
index 9d2777132b..ae441b339b 100644
--- a/src/libs/3rdparty/cplusplus/Symbol.h
+++ b/src/libs/3rdparty/cplusplus/Symbol.h
@@ -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 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 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 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;
diff --git a/src/libs/3rdparty/cplusplus/Symbols.cpp b/src/libs/3rdparty/cplusplus/Symbols.cpp
index 6e156685ac..a895f7ed6c 100644
--- a/src/libs/3rdparty/cplusplus/Symbols.cpp
+++ b/src/libs/3rdparty/cplusplus/Symbols.cpp
@@ -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)
{}
diff --git a/src/libs/3rdparty/cplusplus/Symbols.h b/src/libs/3rdparty/cplusplus/Symbols.h
index 070b64634b..fd9417984e 100644
--- a/src/libs/3rdparty/cplusplus/Symbols.h
+++ b/src/libs/3rdparty/cplusplus/Symbols.h
@@ -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
diff --git a/src/libs/3rdparty/cplusplus/Templates.cpp b/src/libs/3rdparty/cplusplus/Templates.cpp
index 6c03e83fdf..75ee4e95fa 100644
--- a/src/libs/3rdparty/cplusplus/Templates.cpp
+++ b/src/libs/3rdparty/cplusplus/Templates.cpp
@@ -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());
diff --git a/src/libs/3rdparty/cplusplus/Templates.h b/src/libs/3rdparty/cplusplus/Templates.h
index afd67f7e81..b1da4ef4d0 100644
--- a/src/libs/3rdparty/cplusplus/Templates.h
+++ b/src/libs/3rdparty/cplusplus/Templates.h
@@ -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;
diff --git a/src/libs/3rdparty/cplusplus/Token.cpp b/src/libs/3rdparty/cplusplus/Token.cpp
index ecc7a8487b..0159b1ed7d 100644
--- a/src/libs/3rdparty/cplusplus/Token.cpp
+++ b/src/libs/3rdparty/cplusplus/Token.cpp
@@ -247,7 +247,7 @@ void Token::reset()
flags = 0;
byteOffset = 0;
utf16charOffset = 0;
- ptr = 0;
+ ptr = nullptr;
}
const char *Token::name(int kind)
diff --git a/src/libs/3rdparty/cplusplus/Token.h b/src/libs/3rdparty/cplusplus/Token.h
index 8c809661b4..0f0f76d3cf 100644
--- a/src/libs/3rdparty/cplusplus/Token.h
+++ b/src/libs/3rdparty/cplusplus/Token.h
@@ -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; }
diff --git a/src/libs/3rdparty/cplusplus/TranslationUnit.cpp b/src/libs/3rdparty/cplusplus/TranslationUnit.cpp
index e3c992ccbc..d5f299750e 100644
--- a/src/libs/3rdparty/cplusplus/TranslationUnit.cpp
+++ b/src/libs/3rdparty/cplusplus/TranslationUnit.cpp
@@ -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()
diff --git a/src/libs/3rdparty/cplusplus/TranslationUnit.h b/src/libs/3rdparty/cplusplus/TranslationUnit.h
index 16e9f4de31..7422885a7e 100644
--- a/src/libs/3rdparty/cplusplus/TranslationUnit.h
+++ b/src/libs/3rdparty/cplusplus/TranslationUnit.h
@@ -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)
{ }
diff --git a/src/libs/3rdparty/cplusplus/Type.cpp b/src/libs/3rdparty/cplusplus/Type.cpp
index bad4d42eeb..e9b0f2d3c1 100644
--- a/src/libs/3rdparty/cplusplus/Type.cpp
+++ b/src/libs/3rdparty/cplusplus/Type.cpp
@@ -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)
{
diff --git a/src/libs/3rdparty/cplusplus/Type.h b/src/libs/3rdparty/cplusplus/Type.h
index 25f260c2cd..72116daf37 100644
--- a/src/libs/3rdparty/cplusplus/Type.h
+++ b/src/libs/3rdparty/cplusplus/Type.h
@@ -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;
diff --git a/src/libs/clangsupport/clangsupportdebugutils.h b/src/libs/clangsupport/clangsupportdebugutils.h
index 5f1751aeac..0e4a6da9a8 100644
--- a/src/libs/clangsupport/clangsupportdebugutils.h
+++ b/src/libs/clangsupport/clangsupportdebugutils.h
@@ -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:
diff --git a/src/libs/cplusplus/AlreadyConsideredClassContainer.h b/src/libs/cplusplus/AlreadyConsideredClassContainer.h
index fd35291c2a..01260c0348 100644
--- a/src/libs/cplusplus/AlreadyConsideredClassContainer.h
+++ b/src/libs/cplusplus/AlreadyConsideredClassContainer.h
@@ -35,7 +35,7 @@ template<typename T>
class AlreadyConsideredClassContainer
{
public:
- AlreadyConsideredClassContainer() : _class(0) {}
+ AlreadyConsideredClassContainer() : _class(nullptr) {}
void insert(const T *item)
{
if (_container.isEmpty())
diff --git a/src/libs/cplusplus/CppDocument.cpp b/src/libs/cplusplus/CppDocument.cpp
index fec44e8421..578a6a117f 100644
--- a/src/libs/cplusplus/CppDocument.cpp
+++ b/src/libs/cplusplus/CppDocument.cpp
@@ -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)
diff --git a/src/libs/cplusplus/CppRewriter.cpp b/src/libs/cplusplus/CppRewriter.cpp
index 2c554e3dd1..fdb5de3851 100644
--- a/src/libs/cplusplus/CppRewriter.cpp
+++ b/src/libs/cplusplus/CppRewriter.cpp
@@ -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)
{
}
diff --git a/src/libs/cplusplus/DeprecatedGenTemplateInstance.cpp b/src/libs/cplusplus/DeprecatedGenTemplateInstance.cpp
index 3992740b22..d3653137b3 100644
--- a/src/libs/cplusplus/DeprecatedGenTemplateInstance.cpp
+++ b/src/libs/cplusplus/DeprecatedGenTemplateInstance.cpp
@@ -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);
diff --git a/src/libs/cplusplus/FindUsages.cpp b/src/libs/cplusplus/FindUsages.cpp
index 3a82ee2d2b..addaac7134 100644
--- a/src/libs/cplusplus/FindUsages.cpp
+++ b/src/libs/cplusplus/FindUsages.cpp
@@ -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();
diff --git a/src/libs/cplusplus/FindUsages.h b/src/libs/cplusplus/FindUsages.h
index 2b6880a55c..3fd13a30a2 100644
--- a/src/libs/cplusplus/FindUsages.h
+++ b/src/libs/cplusplus/FindUsages.h
@@ -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);
diff --git a/src/libs/cplusplus/LookupContext.cpp b/src/libs/cplusplus/LookupContext.cpp
index d58bc212c4..451e3d3a78 100644
--- a/src/libs/cplusplus/LookupContext.cpp
+++ b/src/libs/cplusplus/LookupContext.cpp
@@ -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;
diff --git a/src/libs/cplusplus/LookupContext.h b/src/libs/cplusplus/LookupContext.h
index b13df5da29..22035362fd 100644
--- a/src/libs/cplusplus/LookupContext.h
+++ b/src/libs/cplusplus/LookupContext.h
@@ -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
diff --git a/src/libs/cplusplus/LookupItem.cpp b/src/libs/cplusplus/LookupItem.cpp
index 5890664051..7fc73ba240 100644
--- a/src/libs/cplusplus/LookupItem.cpp
+++ b/src/libs/cplusplus/LookupItem.cpp
@@ -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
diff --git a/src/libs/cplusplus/Macro.cpp b/src/libs/cplusplus/Macro.cpp
index 6e1a46c8a0..d0c905edf1 100644
--- a/src/libs/cplusplus/Macro.cpp
+++ b/src/libs/cplusplus/Macro.cpp
@@ -48,7 +48,7 @@
using namespace CPlusPlus;
Macro::Macro()
- : _next(0),
+ : _next(nullptr),
_hashcode(0),
_fileRevision(0),
_line(0),
diff --git a/src/libs/cplusplus/MatchingText.h b/src/libs/cplusplus/MatchingText.h
index b394e342af..aab8365e15 100644
--- a/src/libs/cplusplus/MatchingText.h
+++ b/src/libs/cplusplus/MatchingText.h
@@ -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,
diff --git a/src/libs/cplusplus/Overview.h b/src/libs/cplusplus/Overview.h
index 546a04f5bc..243390cd8a 100644
--- a/src/libs/cplusplus/Overview.h
+++ b/src/libs/cplusplus/Overview.h
@@ -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:
diff --git a/src/libs/cplusplus/PreprocessorEnvironment.cpp b/src/libs/cplusplus/PreprocessorEnvironment.cpp
index 6d7464d799..4ffc127a19 100644
--- a/src/libs/cplusplus/PreprocessorEnvironment.cpp
+++ b/src/libs/cplusplus/PreprocessorEnvironment.cpp
@@ -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;
diff --git a/src/libs/cplusplus/ResolveExpression.cpp b/src/libs/cplusplus/ResolveExpression.cpp
index 9dbeebc5ea..2eca9b53f3 100644
--- a/src/libs/cplusplus/ResolveExpression.cpp
+++ b/src/libs/cplusplus/ResolveExpression.cpp
@@ -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.:
diff --git a/src/libs/cplusplus/ResolveExpression.h b/src/libs/cplusplus/ResolveExpression.h
index f53caf26aa..41f91c049f 100644
--- a/src/libs/cplusplus/ResolveExpression.h
+++ b/src/libs/cplusplus/ResolveExpression.h
@@ -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);
diff --git a/src/libs/cplusplus/SymbolNameVisitor.cpp b/src/libs/cplusplus/SymbolNameVisitor.cpp
index fe2b36f3d8..b34bf2f42a 100644
--- a/src/libs/cplusplus/SymbolNameVisitor.cpp
+++ b/src/libs/cplusplus/SymbolNameVisitor.cpp
@@ -31,7 +31,7 @@
using namespace CPlusPlus;
SymbolNameVisitor::SymbolNameVisitor()
- : _symbol(0)
+ : _symbol(nullptr)
{
}
diff --git a/src/libs/cplusplus/TypeOfExpression.cpp b/src/libs/cplusplus/TypeOfExpression.cpp
index 1b3dda8b1c..02f838542c 100644
--- a/src/libs/cplusplus/TypeOfExpression.cpp
+++ b/src/libs/cplusplus/TypeOfExpression.cpp
@@ -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();
}
diff --git a/src/libs/cplusplus/TypePrettyPrinter.cpp b/src/libs/cplusplus/TypePrettyPrinter.cpp
index a2368e91c8..c46117dde7 100644
--- a/src/libs/cplusplus/TypePrettyPrinter.cpp
+++ b/src/libs/cplusplus/TypePrettyPrinter.cpp
@@ -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();
diff --git a/src/libs/cplusplus/cppmodelmanagerbase.cpp b/src/libs/cplusplus/cppmodelmanagerbase.cpp
index 28b4100777..3d8d43d709 100644
--- a/src/libs/cplusplus/cppmodelmanagerbase.cpp
+++ b/src/libs/cplusplus/cppmodelmanagerbase.cpp
@@ -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()
diff --git a/src/libs/cplusplus/cppmodelmanagerbase.h b/src/libs/cplusplus/cppmodelmanagerbase.h
index 680e7e2d06..52d9c9ace2 100644
--- a/src/libs/cplusplus/cppmodelmanagerbase.h
+++ b/src/libs/cplusplus/cppmodelmanagerbase.h
@@ -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();
diff --git a/src/libs/cplusplus/pp-engine.cpp b/src/libs/cplusplus/pp-engine.cpp
index 6b882e73b9..d1f2d3eaf5 100644
--- a/src/libs/cplusplus/pp-engine.cpp
+++ b/src/libs/cplusplus/pp-engine.cpp
@@ -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());
diff --git a/src/libs/cplusplus/pp-engine.h b/src/libs/cplusplus/pp-engine.h
index 0ca559d431..8902cb7624 100644
--- a/src/libs/cplusplus/pp-engine.h
+++ b/src/libs/cplusplus/pp-engine.h
@@ -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);
diff --git a/src/libs/glsl/glslast.cpp b/src/libs/glsl/glslast.cpp
index f85486a836..d3375bee43 100644
--- a/src/libs/glsl/glslast.cpp
+++ b/src/libs/glsl/glslast.cpp
@@ -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)
diff --git a/src/libs/glsl/glslastdump.cpp b/src/libs/glsl/glslastdump.cpp
index 9cd210dabe..9cc25c4f06 100644
--- a/src/libs/glsl/glslastdump.cpp
+++ b/src/libs/glsl/glslastdump.cpp
@@ -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;
diff --git a/src/libs/glsl/glslengine.h b/src/libs/glsl/glslengine.h
index 7cf6e2d164..0942d5ef57 100644
--- a/src/libs/glsl/glslengine.h
+++ b/src/libs/glsl/glslengine.h
@@ -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);
diff --git a/src/libs/glsl/glsllexer.cpp b/src/libs/glsl/glsllexer.cpp
index 6042e3ddee..afaad6dc9d 100644
--- a/src/libs/glsl/glsllexer.cpp
+++ b/src/libs/glsl/glsllexer.cpp
@@ -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;
diff --git a/src/libs/glsl/glsllexer.h b/src/libs/glsl/glsllexer.h
index 2b0ad83fed..3dcbe2168b 100644
--- a/src/libs/glsl/glsllexer.h
+++ b/src/libs/glsl/glsllexer.h
@@ -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; }
diff --git a/src/libs/glsl/glslmemorypool.cpp b/src/libs/glsl/glslmemorypool.cpp
index dc681565df..7e4829a6e6 100644
--- a/src/libs/glsl/glslmemorypool.cpp
+++ b/src/libs/glsl/glslmemorypool.cpp
@@ -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];
diff --git a/src/libs/glsl/glslparser.cpp b/src/libs/glsl/glslparser.cpp
index f435032999..17dc26c61f 100644
--- a/src/libs/glsl/glslparser.cpp
+++ b/src/libs/glsl/glslparser.cpp
@@ -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"
diff --git a/src/libs/glsl/glslparser.h b/src/libs/glsl/glslparser.h
index 5e148c298b..65003e6974 100644
--- a/src/libs/glsl/glslparser.h
+++ b/src/libs/glsl/glslparser.h
@@ -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);
diff --git a/src/libs/glsl/glslsemantic.cpp b/src/libs/glsl/glslsemantic.cpp
index 0b4643cfe8..4db1c0e32c 100644
--- a/src/libs/glsl/glslsemantic.cpp
+++ b/src/libs/glsl/glslsemantic.cpp
@@ -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;
}
}
}
diff --git a/src/libs/glsl/glslsemantic.h b/src/libs/glsl/glslsemantic.h
index 05d1c664a4..78eec83843 100644
--- a/src/libs/glsl/glslsemantic.h
+++ b/src/libs/glsl/glslsemantic.h
@@ -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;
}
diff --git a/src/libs/glsl/glslsymbol.cpp b/src/libs/glsl/glslsymbol.cpp
index 80f310ecad..30808f4e63 100644
--- a/src/libs/glsl/glslsymbol.cpp
+++ b/src/libs/glsl/glslsymbol.cpp
@@ -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
diff --git a/src/libs/glsl/glslsymbol.h b/src/libs/glsl/glslsymbol.h
index 51bb070e5a..4d965fce1e 100644
--- a/src/libs/glsl/glslsymbol.h
+++ b/src/libs/glsl/glslsymbol.h
@@ -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;
diff --git a/src/libs/glsl/glslsymbols.cpp b/src/libs/glsl/glslsymbols.cpp
index 20d7084c2d..6dc5ec60e2 100644
--- a/src/libs/glsl/glslsymbols.cpp
+++ b/src/libs/glsl/glslsymbols.cpp
@@ -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
diff --git a/src/libs/glsl/glslsymbols.h b/src/libs/glsl/glslsymbols.h
index 60cce39db8..84983aba4e 100644
--- a/src/libs/glsl/glslsymbols.h
+++ b/src/libs/glsl/glslsymbols.h
@@ -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;
diff --git a/src/libs/glsl/glsltype.h b/src/libs/glsl/glsltype.h
index 94aa422937..4035cc8cdb 100644
--- a/src/libs/glsl/glsltype.h
+++ b/src/libs/glsl/glsltype.h
@@ -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 Struct *asStructType() const { return 0; }
- virtual const Function *asFunctionType() 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 nullptr; }
+ virtual const Function *asFunctionType() const { return nullptr; }
virtual bool isEqualTo(const Type *other) const = 0;
virtual bool isLessThan(const Type *other) const = 0;
diff --git a/src/libs/glsl/glsltypes.cpp b/src/libs/glsl/glsltypes.cpp
index 50081dd1e9..f05bfb6784 100644
--- a/src/libs/glsl/glsltypes.cpp
+++ b/src/libs/glsl/glsltypes.cpp
@@ -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)
diff --git a/src/libs/glsl/glsltypes.h b/src/libs/glsl/glsltypes.h
index 93acb91e8e..d55d91fa16 100644
--- a/src/libs/glsl/glsltypes.h
+++ b/src/libs/glsl/glsltypes.h
@@ -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);
diff --git a/src/libs/qmldebug/qmldebugconnectionmanager.h b/src/libs/qmldebug/qmldebugconnectionmanager.h
index ccda63f38f..82c4a8bbe4 100644
--- a/src/libs/qmldebug/qmldebugconnectionmanager.h
+++ b/src/libs/qmldebug/qmldebugconnectionmanager.h
@@ -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);
diff --git a/src/libs/qmldebug/qmloutputparser.h b/src/libs/qmldebug/qmloutputparser.h
index 60db2e4d52..cf07d9c798 100644
--- a/src/libs/qmldebug/qmloutputparser.h
+++ b/src/libs/qmldebug/qmloutputparser.h
@@ -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);
diff --git a/src/libs/qmldebug/qpacketprotocol.h b/src/libs/qmldebug/qpacketprotocol.h
index 6931c05ec1..f77ef0e93d 100644
--- a/src/libs/qmldebug/qpacketprotocol.h
+++ b/src/libs/qmldebug/qpacketprotocol.h
@@ -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;
diff --git a/src/libs/qmleditorwidgets/colorbox.h b/src/libs/qmleditorwidgets/colorbox.h
index dd576f61f2..52dfdf6585 100644
--- a/src/libs/qmleditorwidgets/colorbox.h
+++ b/src/libs/qmleditorwidgets/colorbox.h
@@ -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);
diff --git a/src/libs/qmleditorwidgets/colorbutton.h b/src/libs/qmleditorwidgets/colorbutton.h
index 8928f65da3..a7ad15cc7e 100644
--- a/src/libs/qmleditorwidgets/colorbutton.h
+++ b/src/libs/qmleditorwidgets/colorbutton.h
@@ -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),
diff --git a/src/libs/qmleditorwidgets/contextpanetextwidget.h b/src/libs/qmleditorwidgets/contextpanetextwidget.h
index 6249fe4e85..ab706dc0c3 100644
--- a/src/libs/qmleditorwidgets/contextpanetextwidget.h
+++ b/src/libs/qmleditorwidgets/contextpanetextwidget.h
@@ -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);
diff --git a/src/libs/qmleditorwidgets/contextpanewidget.cpp b/src/libs/qmleditorwidgets/contextpanewidget.cpp
index d09902be1b..7566e2ac7a 100644
--- a/src/libs/qmleditorwidgets/contextpanewidget.cpp
+++ b/src/libs/qmleditorwidgets/contextpanewidget.cpp
@@ -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;
}
}
diff --git a/src/libs/qmleditorwidgets/contextpanewidget.h b/src/libs/qmleditorwidgets/contextpanewidget.h
index 84ebf85b24..deb5d45752 100644
--- a/src/libs/qmleditorwidgets/contextpanewidget.h
+++ b/src/libs/qmleditorwidgets/contextpanewidget.h
@@ -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);
diff --git a/src/libs/qmleditorwidgets/contextpanewidgetimage.h b/src/libs/qmleditorwidgets/contextpanewidgetimage.h
index a031447eec..89c7413e77 100644
--- a/src/libs/qmleditorwidgets/contextpanewidgetimage.h
+++ b/src/libs/qmleditorwidgets/contextpanewidgetimage.h
@@ -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);
diff --git a/src/libs/qmleditorwidgets/contextpanewidgetrectangle.h b/src/libs/qmleditorwidgets/contextpanewidgetrectangle.h
index b1f259ae04..1ae75cc982 100644
--- a/src/libs/qmleditorwidgets/contextpanewidgetrectangle.h
+++ b/src/libs/qmleditorwidgets/contextpanewidgetrectangle.h
@@ -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);
diff --git a/src/libs/qmleditorwidgets/customcolordialog.h b/src/libs/qmleditorwidgets/customcolordialog.h
index a6df6e692d..88564c8142 100644
--- a/src/libs/qmleditorwidgets/customcolordialog.h
+++ b/src/libs/qmleditorwidgets/customcolordialog.h
@@ -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)
diff --git a/src/libs/qmleditorwidgets/easingpane/easingcontextpane.cpp b/src/libs/qmleditorwidgets/easingpane/easingcontextpane.cpp
index d43b458881..a794b337a0 100644
--- a/src/libs/qmleditorwidgets/easingpane/easingcontextpane.cpp
+++ b/src/libs/qmleditorwidgets/easingpane/easingcontextpane.cpp
@@ -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);
}
diff --git a/src/libs/qmleditorwidgets/easingpane/easingcontextpane.h b/src/libs/qmleditorwidgets/easingpane/easingcontextpane.h
index 480860f0c5..3cab9523b5 100644
--- a/src/libs/qmleditorwidgets/easingpane/easingcontextpane.h
+++ b/src/libs/qmleditorwidgets/easingpane/easingcontextpane.h
@@ -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);
diff --git a/src/libs/qmleditorwidgets/easingpane/easinggraph.h b/src/libs/qmleditorwidgets/easingpane/easinggraph.h
index a4bfabf0db..517ee7dc1e 100644
--- a/src/libs/qmleditorwidgets/easingpane/easinggraph.h
+++ b/src/libs/qmleditorwidgets/easingpane/easinggraph.h
@@ -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;
diff --git a/src/libs/qmleditorwidgets/filewidget.h b/src/libs/qmleditorwidgets/filewidget.h
index da5c3c305d..320002a635 100644
--- a/src/libs/qmleditorwidgets/filewidget.h
+++ b/src/libs/qmleditorwidgets/filewidget.h
@@ -52,7 +52,7 @@ class QMLEDITORWIDGETS_EXPORT FileWidget : public QWidget
public:
- FileWidget(QWidget *parent = 0);
+ FileWidget(QWidget *parent = nullptr);
~FileWidget() override;
QString fileName() const
diff --git a/src/libs/qmleditorwidgets/fontsizespinbox.cpp b/src/libs/qmleditorwidgets/fontsizespinbox.cpp
index 4a8ee48427..f127b5a677 100644
--- a/src/libs/qmleditorwidgets/fontsizespinbox.cpp
+++ b/src/libs/qmleditorwidgets/fontsizespinbox.cpp
@@ -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);
}
diff --git a/src/libs/qmleditorwidgets/fontsizespinbox.h b/src/libs/qmleditorwidgets/fontsizespinbox.h
index d9ee85092c..c74e33b2fd 100644
--- a/src/libs/qmleditorwidgets/fontsizespinbox.h
+++ b/src/libs/qmleditorwidgets/fontsizespinbox.h
@@ -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; }
diff --git a/src/libs/qmleditorwidgets/gradientline.h b/src/libs/qmleditorwidgets/gradientline.h
index 0d5cff8a7f..d6f5e132f7 100644
--- a/src/libs/qmleditorwidgets/gradientline.h
+++ b/src/libs/qmleditorwidgets/gradientline.h
@@ -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);
diff --git a/src/libs/qmleditorwidgets/huecontrol.h b/src/libs/qmleditorwidgets/huecontrol.h
index f9db8790ed..902b3ceaa8 100644
--- a/src/libs/qmleditorwidgets/huecontrol.h
+++ b/src/libs/qmleditorwidgets/huecontrol.h
@@ -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);
diff --git a/src/libs/qmljs/jsoncheck.cpp b/src/libs/qmljs/jsoncheck.cpp
index 3940f46099..15d0edb1a7 100644
--- a/src/libs/qmljs/jsoncheck.cpp
+++ b/src/libs/qmljs/jsoncheck.cpp
@@ -41,7 +41,7 @@ using namespace Utils;
JsonCheck::JsonCheck(Document::Ptr doc)
: m_doc(doc)
- , m_schema(0)
+ , m_schema(nullptr)
{
QTC_CHECK(m_doc->ast());
}
diff --git a/src/libs/qmljs/persistenttrie.cpp b/src/libs/qmljs/persistenttrie.cpp
index edc3015099..1d6c9bf5ba 100644
--- a/src/libs/qmljs/persistenttrie.cpp
+++ b/src/libs/qmljs/persistenttrie.cpp
@@ -309,7 +309,7 @@ std::pair<TrieNode::Ptr,int> TrieNode::intersectF(
typedef TrieNode::Ptr P;
typedef QMap<QString,int>::const_iterator MapIterator;
if (v1.isNull() || v2.isNull())
- return std::make_pair(P(0), ((v1.isNull()) ? 1 : 0) | ((v2.isNull()) ? 2 : 0));
+ return std::make_pair(P(nullptr), ((v1.isNull()) ? 1 : 0) | ((v2.isNull()) ? 2 : 0));
QString::const_iterator i = v1->prefix.constBegin()+index1, iEnd = v1->prefix.constEnd();
QString::const_iterator j = v2->prefix.constBegin(), jEnd = v2->prefix.constEnd();
while (i != iEnd && j != jEnd) {
@@ -345,7 +345,7 @@ std::pair<TrieNode::Ptr,int> TrieNode::intersectF(
foreach (P t2, v2->postfixes)
if (t2->prefix.isEmpty())
return std::make_pair(v1,1);
- return std::make_pair(P(0), 0);
+ return std::make_pair(P(nullptr), 0);
}
QMap<QString,int> p1, p2;
QList<P> p3;
@@ -427,7 +427,7 @@ std::pair<TrieNode::Ptr,int> TrieNode::intersectF(
switch (sameV1V2) {
case 0:
if (p3.isEmpty())
- return std::make_pair(P(0),0);
+ return std::make_pair(P(nullptr),0);
else
return std::make_pair(TrieNode::create(v1->prefix,p3),0);
case 2:
@@ -451,7 +451,7 @@ std::pair<TrieNode::Ptr,int> TrieNode::intersectF(
v1->prefix.left(index1).append(res.first->prefix),
res.first->postfixes), 0);
}
- return std::make_pair(P(0), 0);
+ return std::make_pair(P(nullptr), 0);
} else {
// i != iEnd && j == jEnd
foreach (P t2, v2->postfixes)
@@ -459,7 +459,7 @@ std::pair<TrieNode::Ptr,int> TrieNode::intersectF(
std::pair<P,int> res = intersectF(v1,t2,i-v1->prefix.constBegin());
return std::make_pair(res.first, (res.second & 1));
}
- return std::make_pair(P(0), 0);
+ return std::make_pair(P(nullptr), 0);
}
}
diff --git a/src/libs/qmljs/qmljsbind.cpp b/src/libs/qmljs/qmljsbind.cpp
index 6b904da040..70912cdf21 100644
--- a/src/libs/qmljs/qmljsbind.cpp
+++ b/src/libs/qmljs/qmljsbind.cpp
@@ -53,9 +53,9 @@ using namespace QmlJS::AST;
Bind::Bind(Document *doc, QList<DiagnosticMessage> *messages, bool isJsLibrary, const QList<ImportInfo> &jsImports)
: _doc(doc),
- _currentObjectValue(0),
- _idEnvironment(0),
- _rootObjectValue(0),
+ _currentObjectValue(nullptr),
+ _idEnvironment(nullptr),
+ _rootObjectValue(nullptr),
_isJsLibrary(isJsLibrary),
_imports(jsImports),
_diagnosticMessages(messages)
@@ -134,7 +134,7 @@ ObjectValue *Bind::switchObjectValue(ObjectValue *newObjectValue)
ObjectValue *Bind::bindObject(UiQualifiedId *qualifiedTypeNameId, UiObjectInitializer *initializer)
{
- ObjectValue *parentObjectValue = 0;
+ ObjectValue *parentObjectValue = nullptr;
// normal component instance
ASTObjectValue *objectValue = new ASTObjectValue(qualifiedTypeNameId, initializer, _doc, &_valueOwner);
@@ -169,13 +169,13 @@ void Bind::accept(Node *node)
bool Bind::visit(AST::UiProgram *)
{
- _idEnvironment = _valueOwner.newObject(/*prototype =*/ 0);
+ _idEnvironment = _valueOwner.newObject(/*prototype =*/ nullptr);
return true;
}
bool Bind::visit(AST::Program *)
{
- _currentObjectValue = _valueOwner.newObject(/*prototype =*/ 0);
+ _currentObjectValue = _valueOwner.newObject(/*prototype =*/ nullptr);
_rootObjectValue = _currentObjectValue;
return true;
}
@@ -236,7 +236,7 @@ bool Bind::visit(UiPublicMember *ast)
const Block *block = AST::cast<const Block*>(ast->statement);
if (block) {
// build block scope
- ObjectValue *blockScope = _valueOwner.newObject(/*prototype=*/0);
+ ObjectValue *blockScope = _valueOwner.newObject(/*prototype=*/nullptr);
_attachedJSScopes.insert(ast, blockScope); // associated with the UiPublicMember, not with the block
ObjectValue *parent = switchObjectValue(blockScope);
accept(ast->statement);
@@ -259,7 +259,7 @@ bool Bind::visit(UiObjectDefinition *ast)
_qmlObjects.insert(ast, value);
} else {
_groupedPropertyBindings.insert(ast);
- ObjectValue *oldObjectValue = switchObjectValue(0);
+ ObjectValue *oldObjectValue = switchObjectValue(nullptr);
accept(ast->initializer);
switchObjectValue(oldObjectValue);
}
@@ -289,7 +289,7 @@ bool Bind::visit(UiScriptBinding *ast)
const Block *block = AST::cast<const Block*>(ast->statement);
if (block) {
// build block scope
- ObjectValue *blockScope = _valueOwner.newObject(/*prototype=*/0);
+ ObjectValue *blockScope = _valueOwner.newObject(/*prototype=*/nullptr);
_attachedJSScopes.insert(ast, blockScope); // associated with the UiScriptBinding, not with the block
ObjectValue *parent = switchObjectValue(blockScope);
accept(ast->statement);
@@ -328,7 +328,7 @@ bool Bind::visit(FunctionExpression *ast)
_currentObjectValue->setMember(ast->name.toString(), function);
// build function scope
- ObjectValue *functionScope = _valueOwner.newObject(/*prototype=*/0);
+ ObjectValue *functionScope = _valueOwner.newObject(/*prototype=*/nullptr);
_attachedJSScopes.insert(ast, functionScope);
ObjectValue *parent = switchObjectValue(functionScope);
@@ -345,7 +345,7 @@ bool Bind::visit(FunctionExpression *ast)
// ### TODO, currently covered by the accept(body)
// 3. Arguments object
- ObjectValue *arguments = _valueOwner.newObject(/*prototype=*/0);
+ ObjectValue *arguments = _valueOwner.newObject(/*prototype=*/nullptr);
arguments->setMember(QLatin1String("callee"), function);
arguments->setMember(QLatin1String("length"), _valueOwner.numberValue());
functionScope->setMember(QLatin1String("arguments"), arguments);
diff --git a/src/libs/qmljs/qmljsbundle.cpp b/src/libs/qmljs/qmljsbundle.cpp
index 9789d37492..6c7ee6029b 100644
--- a/src/libs/qmljs/qmljsbundle.cpp
+++ b/src/libs/qmljs/qmljsbundle.cpp
@@ -219,11 +219,11 @@ QStringList QmlBundle::maybeReadTrie(Trie &trie, Utils::JsonObjectValue *config,
return res;
}
Utils::JsonValue *imp0 = config->member(propertyName);
- Utils::JsonArrayValue *imp = ((imp0 != 0) ? imp0->toArray() : 0);
- if (imp != 0) {
+ Utils::JsonArrayValue *imp = ((imp0 != nullptr) ? imp0->toArray() : nullptr);
+ if (imp != nullptr) {
foreach (Utils::JsonValue *v, imp->elements()) {
- Utils::JsonStringValue *impStr = ((v != 0) ? v->toString() : 0);
- if (impStr != 0) {
+ Utils::JsonStringValue *impStr = ((v != nullptr) ? v->toString() : nullptr);
+ if (impStr != nullptr) {
trie.insert(impStr->value());
} else {
res.append(QString::fromLatin1("Expected all elements of array in property \"%1\" "
@@ -251,7 +251,7 @@ bool QmlBundle::readFrom(QString path, QStringList *errors)
return false;
}
JsonObjectValue *config = JsonValue::create(QString::fromUtf8(f.readAll()), &pool)->toObject();
- if (config == 0) {
+ if (config == nullptr) {
if (errors)
(*errors) << QString::fromLatin1("Could not parse json object in file at %1 .").arg(path);
return false;
@@ -259,8 +259,8 @@ bool QmlBundle::readFrom(QString path, QStringList *errors)
QStringList errs;
if (config->hasMember(QLatin1String("name"))) {
JsonValue *n0 = config->member(QLatin1String("name"));
- JsonStringValue *n = ((n0 != 0) ? n0->toString() : 0);
- if (n != 0)
+ JsonStringValue *n = ((n0 != nullptr) ? n0->toString() : nullptr);
+ if (n != nullptr)
m_name = n->value();
else
errs.append(QString::fromLatin1("Property \"name\" in QmlBundle at %1 is expected "
diff --git a/src/libs/qmljs/qmljscontext.cpp b/src/libs/qmljs/qmljscontext.cpp
index d8d0f31bbe..3e90a40db8 100644
--- a/src/libs/qmljs/qmljscontext.cpp
+++ b/src/libs/qmljs/qmljscontext.cpp
@@ -97,7 +97,7 @@ ViewerContext Context::viewerContext() const
const Imports *Context::imports(const QmlJS::Document *doc) const
{
if (!doc)
- return 0;
+ return nullptr;
return _imports.value(doc).data();
}
@@ -106,16 +106,16 @@ const ObjectValue *Context::lookupType(const QmlJS::Document *doc, UiQualifiedId
{
const Imports *importsObj = imports(doc);
if (!importsObj)
- return 0;
+ return nullptr;
const ObjectValue *objectValue = importsObj->typeScope();
if (!objectValue)
- return 0;
+ return nullptr;
for (UiQualifiedId *iter = qmlTypeName; objectValue && iter && iter != qmlTypeNameEnd;
iter = iter->next) {
- const Value *value = objectValue->lookupMember(iter->name.toString(), this, 0, false);
+ const Value *value = objectValue->lookupMember(iter->name.toString(), this, nullptr, false);
if (!value)
- return 0;
+ return nullptr;
objectValue = value->asObjectValue();
}
@@ -127,18 +127,18 @@ const ObjectValue *Context::lookupType(const QmlJS::Document *doc, const QString
{
const Imports *importsObj = imports(doc);
if (!importsObj)
- return 0;
+ return nullptr;
const ObjectValue *objectValue = importsObj->typeScope();
if (!objectValue)
- return 0;
+ return nullptr;
foreach (const QString &name, qmlTypeName) {
if (!objectValue)
- return 0;
+ return nullptr;
const Value *value = objectValue->lookupMember(name, this);
if (!value)
- return 0;
+ return nullptr;
objectValue = value->asObjectValue();
}
diff --git a/src/libs/qmljs/qmljscontext.h b/src/libs/qmljs/qmljscontext.h
index cafee3e970..0da21e8861 100644
--- a/src/libs/qmljs/qmljscontext.h
+++ b/src/libs/qmljs/qmljscontext.h
@@ -60,7 +60,7 @@ public:
const Imports *imports(const Document *doc) const;
const ObjectValue *lookupType(const Document *doc, AST::UiQualifiedId *qmlTypeName,
- AST::UiQualifiedId *qmlTypeNameEnd = 0) const;
+ AST::UiQualifiedId *qmlTypeNameEnd = nullptr) const;
const ObjectValue *lookupType(const Document *doc, const QStringList &qmlTypeName) const;
const Value *lookupReference(const Value *value) const;
diff --git a/src/libs/qmljs/qmljsdocument.cpp b/src/libs/qmljs/qmljsdocument.cpp
index 6ebe5b0b2f..2efa9c0334 100644
--- a/src/libs/qmljs/qmljsdocument.cpp
+++ b/src/libs/qmljs/qmljsdocument.cpp
@@ -86,9 +86,9 @@ using namespace QmlJS::AST;
*/
Document::Document(const QString &fileName, Dialect language)
- : _engine(0)
- , _ast(0)
- , _bind(0)
+ : _engine(nullptr)
+ , _ast(nullptr)
+ , _bind(nullptr)
, _fileName(QDir::cleanPath(fileName))
, _editorRevision(0)
, _language(language)
@@ -170,7 +170,7 @@ AST::ExpressionNode *Document::expression() const
if (_ast)
return _ast->expressionCast();
- return 0;
+ return nullptr;
}
AST::Node *Document::ast() const
diff --git a/src/libs/qmljs/qmljsevaluate.cpp b/src/libs/qmljs/qmljsevaluate.cpp
index 754113d199..4a408dac93 100644
--- a/src/libs/qmljs/qmljsevaluate.cpp
+++ b/src/libs/qmljs/qmljsevaluate.cpp
@@ -61,7 +61,7 @@ Evaluate::Evaluate(const ScopeChain *scopeChain, ReferenceContext *referenceCont
_context(scopeChain->context()),
_referenceContext(referenceContext),
_scopeChain(scopeChain),
- _result(0)
+ _result(nullptr)
{
}
@@ -95,7 +95,7 @@ const Value *Evaluate::value(AST::Node *ast)
const Value *Evaluate::reference(AST::Node *ast)
{
// save the result
- const Value *previousResult = switchResult(0);
+ const Value *previousResult = switchResult(nullptr);
// process the expression
accept(ast);
@@ -426,8 +426,8 @@ bool Evaluate::visit(AST::NotExpression *)
bool Evaluate::visit(AST::BinaryExpression *ast)
{
- const Value *lhs = 0;
- const Value *rhs = 0;
+ const Value *lhs = nullptr;
+ const Value *rhs = nullptr;
switch (ast->op) {
case QSOperator::Add:
case QSOperator::InplaceAdd:
diff --git a/src/libs/qmljs/qmljsevaluate.h b/src/libs/qmljs/qmljsevaluate.h
index 7e3a218415..45ffc2ece8 100644
--- a/src/libs/qmljs/qmljsevaluate.h
+++ b/src/libs/qmljs/qmljsevaluate.h
@@ -41,7 +41,7 @@ class FunctionValue;
class QMLJS_EXPORT Evaluate: protected AST::Visitor
{
public:
- Evaluate(const ScopeChain *scopeChain, ReferenceContext *referenceContext = 0);
+ Evaluate(const ScopeChain *scopeChain, ReferenceContext *referenceContext = nullptr);
~Evaluate();
// same as value()
diff --git a/src/libs/qmljs/qmljsfindexportedcpptypes.cpp b/src/libs/qmljs/qmljsfindexportedcpptypes.cpp
index 6dad8947b8..d9e8f5faba 100644
--- a/src/libs/qmljs/qmljsfindexportedcpptypes.cpp
+++ b/src/libs/qmljs/qmljsfindexportedcpptypes.cpp
@@ -93,7 +93,7 @@ public:
FindExportsVisitor(CPlusPlus::Document::Ptr doc)
: ASTVisitor(doc->translationUnit())
, _doc(doc)
- , _compound(0)
+ , _compound(nullptr)
{}
void operator()()
@@ -142,7 +142,7 @@ protected:
if (!idExp || !idExp->name)
return false;
RegistrationFunction registrationFunction = InvalidRegistrationFunction;
- TypeIdAST *typeId = 0;
+ TypeIdAST *typeId = nullptr;
if (TemplateIdAST *templateId = idExp->name->asTemplateId()) {
if (!templateId->identifier_token)
return false;
@@ -216,10 +216,10 @@ protected:
|| ast->expression_list->next->next->next->next->next)
return false;
}
- ExpressionAST *uriExp = 0;
- ExpressionAST *majorVersionExp = 0;
- ExpressionAST *minorVersionExp = 0;
- ExpressionAST *nameExp = 0;
+ ExpressionAST *uriExp = nullptr;
+ ExpressionAST *majorVersionExp = nullptr;
+ ExpressionAST *minorVersionExp = nullptr;
+ ExpressionAST *nameExp = nullptr;
if (registrationFunction == QmlRegisterType5) {
uriExp = ast->expression_list->next->value;
majorVersionExp = ast->expression_list->next->next->value;
@@ -241,7 +241,7 @@ protected:
minorVersionExp = ast->expression_list->next->next->value;
nameExp = ast->expression_list->next->next->next->value;
}
- const StringLiteral *nameLit = 0;
+ const StringLiteral *nameLit = nullptr;
if (StringLiteralAST *nameAst = skipStringCall(nameExp)->asStringLiteral())
nameLit = translationUnit()->stringLiteral(nameAst->literal_token);
if (!nameLit) {
@@ -318,8 +318,8 @@ protected:
}
// version arguments must be integer literals
- const NumericLiteral *majorLit = 0;
- const NumericLiteral *minorLit = 0;
+ const NumericLiteral *majorLit = nullptr;
+ const NumericLiteral *minorLit = nullptr;
if (NumericLiteralAST *majorAst = majorVersionExp->asNumericLiteral())
majorLit = translationUnit()->numericLiteral(majorAst->literal_token);
if (NumericLiteralAST *minorAst = minorVersionExp->asNumericLiteral())
@@ -377,7 +377,7 @@ protected:
return idExp->name;
if (MemberAccessAST *memberExp = exp->asMemberAccess())
return memberExp->member_name;
- return 0;
+ return nullptr;
}
static ExpressionAST *skipQVariant(ExpressionAST *ast, TranslationUnit *translationUnit)
@@ -479,7 +479,7 @@ protected:
return false;
// first argument must be a string literal
- const StringLiteral *nameLit = 0;
+ const StringLiteral *nameLit = nullptr;
if (StringLiteralAST *nameAst = skipStringCall(ast->expression_list->value)->asStringLiteral())
nameLit = translationUnit()->stringLiteral(nameAst->literal_token);
if (!nameLit) {
@@ -634,7 +634,7 @@ static QString toQmlType(const FullySpecifiedType &type)
static Class *lookupClass(const QString &expression, Scope *scope, TypeOfExpression &typeOf)
{
QList<LookupItem> results = typeOf(expression.toUtf8(), scope);
- Class *klass = 0;
+ Class *klass = nullptr;
foreach (const LookupItem &item, results) {
if (item.declaration()) {
klass = item.declaration()->asClass();
@@ -642,7 +642,7 @@ static Class *lookupClass(const QString &expression, Scope *scope, TypeOfExpress
return klass;
}
}
- return 0;
+ return nullptr;
}
static LanguageUtils::FakeMetaObject::Ptr buildFakeMetaObject(
@@ -702,7 +702,7 @@ static LanguageUtils::FakeMetaObject::Ptr buildFakeMetaObject(
}
if (QtEnum *qtEnum = member->asQtEnum()) {
// find the matching enum
- Enum *e = 0;
+ Enum *e = nullptr;
QList<LookupItem> result = typeOf(namePrinter.prettyName(qtEnum->name()).toUtf8(), klass);
foreach (const LookupItem &item, result) {
if (item.declaration()) {
@@ -754,7 +754,7 @@ static void buildExportedQmlObjects(
return;
foreach (const ExportedQmlType &exportedType, cppExports) {
- Class *klass = 0;
+ Class *klass = nullptr;
if (!exportedType.typeExpression.isEmpty())
klass = lookupClass(exportedType.typeExpression, exportedType.scope, typeOf);
// TODO: something smarter with exportedType.url
diff --git a/src/libs/qmljs/qmljsicons.cpp b/src/libs/qmljs/qmljsicons.cpp
index 71ab381108..5f3c8ab43c 100644
--- a/src/libs/qmljs/qmljsicons.cpp
+++ b/src/libs/qmljs/qmljsicons.cpp
@@ -44,7 +44,7 @@ static Q_LOGGING_CATEGORY(iconsLog, "qtc.qmljs.icons", QtWarningMsg)
namespace QmlJS {
-Icons *Icons::m_instance = 0;
+Icons *Icons::m_instance = nullptr;
class IconsPrivate
{
@@ -62,7 +62,7 @@ Icons::Icons()
Icons::~Icons()
{
- m_instance = 0;
+ m_instance = nullptr;
delete d;
}
diff --git a/src/libs/qmljs/qmljsicontextpane.h b/src/libs/qmljs/qmljsicontextpane.h
index 3a36a104ef..cc2a981040 100644
--- a/src/libs/qmljs/qmljsicontextpane.h
+++ b/src/libs/qmljs/qmljsicontextpane.h
@@ -43,7 +43,7 @@ class QMLJS_EXPORT IContextPane : public QObject
Q_OBJECT
public:
- IContextPane(QObject *parent = 0) : QObject(parent) {}
+ IContextPane(QObject *parent = nullptr) : QObject(parent) {}
virtual ~IContextPane() {}
virtual void apply(TextEditor::TextEditorWidget *editorWidget, Document::Ptr document, const ScopeChain *scopeChain, AST::Node *node, bool update, bool force = false) = 0;
virtual void setEnabled(bool) = 0;
diff --git a/src/libs/qmljs/qmljsinterpreter.cpp b/src/libs/qmljs/qmljsinterpreter.cpp
index 21a19c7ca8..825ead9109 100644
--- a/src/libs/qmljs/qmljsinterpreter.cpp
+++ b/src/libs/qmljs/qmljsinterpreter.cpp
@@ -99,7 +99,7 @@ class LookupMember: public MemberProcessor
public:
LookupMember(const QString &name)
- : m_name(name), m_value(0) {}
+ : m_name(name), m_value(nullptr) {}
const Value *value() const { return m_value; }
@@ -290,7 +290,7 @@ void CppComponentValue::processMembers(MemberProcessor *processor) const
signatures->reserve(m_metaObject->methodCount());
for (int index = 0; index < m_metaObject->methodCount(); ++index)
signatures->append(new MetaFunction(m_metaObject->method(index), valueOwner()));
- if (!m_metaSignatures.testAndSetOrdered(0, signatures)) {
+ if (!m_metaSignatures.testAndSetOrdered(nullptr, signatures)) {
delete signatures;
signatures = m_metaSignatures.load();
}
@@ -500,7 +500,7 @@ FakeMetaEnum CppComponentValue::getEnum(const QString &typeName, const CppCompon
}
}
if (foundInScope)
- *foundInScope = 0;
+ *foundInScope = nullptr;
return FakeMetaEnum();
}
@@ -514,8 +514,8 @@ const QmlEnumValue *CppComponentValue::getEnumValue(const QString &typeName, con
}
}
if (foundInScope)
- *foundInScope = 0;
- return 0;
+ *foundInScope = nullptr;
+ return nullptr;
}
const ObjectValue *CppComponentValue::signalScope(const QString &signalName) const
@@ -534,7 +534,7 @@ const ObjectValue *CppComponentValue::signalScope(const QString &signalName) con
const QStringList &parameterTypes = method.parameterTypes();
QTC_ASSERT(parameterNames.size() == parameterTypes.size(), continue);
- ObjectValue *scope = valueOwner()->newObject(/*prototype=*/0);
+ ObjectValue *scope = valueOwner()->newObject(/*prototype=*/nullptr);
for (int i = 0; i < parameterNames.size(); ++i) {
const QString &name = parameterNames.at(i);
const QString &type = parameterTypes.at(i);
@@ -544,7 +544,7 @@ const ObjectValue *CppComponentValue::signalScope(const QString &signalName) con
}
scopes->insert(generatedSlotName(method.methodName()), scope);
}
- if (!m_signalScopes.testAndSetOrdered(0, scopes)) {
+ if (!m_signalScopes.testAndSetOrdered(nullptr, scopes)) {
delete scopes;
scopes = m_signalScopes.load();
}
@@ -708,137 +708,137 @@ bool Value::getSourceLocation(QString *, int *, int *) const
const NullValue *Value::asNullValue() const
{
- return 0;
+ return nullptr;
}
const UndefinedValue *Value::asUndefinedValue() const
{
- return 0;
+ return nullptr;
}
const UnknownValue *Value::asUnknownValue() const
{
- return 0;
+ return nullptr;
}
const NumberValue *Value::asNumberValue() const
{
- return 0;
+ return nullptr;
}
const IntValue *Value::asIntValue() const
{
- return 0;
+ return nullptr;
}
const RealValue *Value::asRealValue() const
{
- return 0;
+ return nullptr;
}
const BooleanValue *Value::asBooleanValue() const
{
- return 0;
+ return nullptr;
}
const StringValue *Value::asStringValue() const
{
- return 0;
+ return nullptr;
}
const UrlValue *Value::asUrlValue() const
{
- return 0;
+ return nullptr;
}
const ObjectValue *Value::asObjectValue() const
{
- return 0;
+ return nullptr;
}
const FunctionValue *Value::asFunctionValue() const
{
- return 0;
+ return nullptr;
}
const Reference *Value::asReference() const
{
- return 0;
+ return nullptr;
}
const ColorValue *Value::asColorValue() const
{
- return 0;
+ return nullptr;
}
const AnchorLineValue *Value::asAnchorLineValue() const
{
- return 0;
+ return nullptr;
}
const CppComponentValue *Value::asCppComponentValue() const
{
- return 0;
+ return nullptr;
}
const ASTObjectValue *Value::asAstObjectValue() const
{
- return 0;
+ return nullptr;
}
const QmlEnumValue *Value::asQmlEnumValue() const
{
- return 0;
+ return nullptr;
}
const QmlPrototypeReference *Value::asQmlPrototypeReference() const
{
- return 0;
+ return nullptr;
}
const ASTPropertyReference *Value::asAstPropertyReference() const
{
- return 0;
+ return nullptr;
}
const ASTVariableReference *Value::asAstVariableReference() const
{
- return 0;
+ return nullptr;
}
const Internal::QtObjectPrototypeReference *Value::asQtObjectPrototypeReference() const
{
- return 0;
+ return nullptr;
}
const ASTSignal *Value::asAstSignal() const
{
- return 0;
+ return nullptr;
}
const ASTFunctionValue *Value::asAstFunctionValue() const
{
- return 0;
+ return nullptr;
}
const Function *Value::asFunction() const
{
- return 0;
+ return nullptr;
}
const MetaFunction *Value::asMetaFunction() const
{
- return 0;
+ return nullptr;
}
const JSImportScope *Value::asJSImportScope() const
{
- return 0;
+ return nullptr;
}
const TypeScope *Value::asTypeScope() const
{
- return 0;
+ return nullptr;
}
////////////////////////////////////////////////////////////////////////////////
@@ -1003,7 +1003,7 @@ bool MemberProcessor::processGeneratedSlot(const QString &, const Value *)
ObjectValue::ObjectValue(ValueOwner *valueOwner, const QString &originId)
: m_valueOwner(valueOwner), m_originId(originId),
- _prototype(0)
+ _prototype(nullptr)
{
valueOwner->registerValue(this);
}
@@ -1122,7 +1122,7 @@ const Value *ObjectValue::lookupMember(const QString &name, const Context *conte
}
}
- const ObjectValue *prototypeObject = 0;
+ const ObjectValue *prototypeObject = nullptr;
if (examinePrototypes && context) {
PrototypeIterator iter(this, context);
@@ -1135,13 +1135,13 @@ const Value *ObjectValue::lookupMember(const QString &name, const Context *conte
}
if (foundInObject)
- *foundInObject = 0;
+ *foundInObject = nullptr;
- return 0;
+ return nullptr;
}
PrototypeIterator::PrototypeIterator(const ObjectValue *start, const Context *context)
- : m_current(0)
+ : m_current(nullptr)
, m_next(start)
, m_context(context)
, m_error(NoError)
@@ -1151,7 +1151,7 @@ PrototypeIterator::PrototypeIterator(const ObjectValue *start, const Context *co
}
PrototypeIterator::PrototypeIterator(const ObjectValue *start, const ContextPtr &context)
- : m_current(0)
+ : m_current(nullptr)
, m_next(start)
, m_context(context.data())
, m_error(NoError)
@@ -1179,7 +1179,7 @@ bool PrototypeIterator::hasNext()
}
if (m_prototypes.contains(m_next)) {
m_error = CycleError;
- m_next = 0;
+ m_next = nullptr;
return false;
}
return true;
@@ -1190,17 +1190,17 @@ const ObjectValue *PrototypeIterator::next()
if (hasNext()) {
m_current = m_next;
m_prototypes += m_next;
- m_next = 0;
+ m_next = nullptr;
return m_current;
}
- return 0;
+ return nullptr;
}
const ObjectValue *PrototypeIterator::peekNext()
{
if (hasNext())
return m_next;
- return 0;
+ return nullptr;
}
PrototypeIterator::Error PrototypeIterator::error() const
@@ -1269,7 +1269,7 @@ void FunctionValue::accept(ValueVisitor *visitor) const
Function::Function(ValueOwner *valueOwner)
: FunctionValue(valueOwner)
- , m_returnValue(0)
+ , m_returnValue(nullptr)
, m_optionalNamedArgumentCount(0)
, m_isVariadic(false)
{
@@ -1364,7 +1364,7 @@ CppQmlTypesLoader::BuiltinObjects CppQmlTypesLoader::loadQmlTypes(const QFileInf
file.close();
- parseQmlTypeDescriptions(contents, &newObjects, 0, &newDependencies, &error, &warning,
+ parseQmlTypeDescriptions(contents, &newObjects, nullptr, &newDependencies, &error, &warning,
qmlTypeFile.absoluteFilePath());
} else {
error = file.errorString();
@@ -1417,7 +1417,7 @@ void CppQmlTypesLoader::parseQmlTypeDescriptions(const QByteArray &contents,
}
CppQmlTypes::CppQmlTypes(ValueOwner *valueOwner)
- : m_cppContextProperties(0)
+ : m_cppContextProperties(nullptr)
, m_valueOwner(valueOwner)
{
@@ -1603,13 +1603,13 @@ const ObjectValue *CppQmlTypes::cppContextProperties() const
ConvertToNumber::ConvertToNumber(ValueOwner *valueOwner)
- : m_valueOwner(valueOwner), m_result(0)
+ : m_valueOwner(valueOwner), m_result(nullptr)
{
}
const Value *ConvertToNumber::operator()(const Value *value)
{
- const Value *previousValue = switchResult(0);
+ const Value *previousValue = switchResult(nullptr);
if (value)
value->accept(this);
@@ -1666,13 +1666,13 @@ void ConvertToNumber::visit(const FunctionValue *object)
}
ConvertToString::ConvertToString(ValueOwner *valueOwner)
- : m_valueOwner(valueOwner), m_result(0)
+ : m_valueOwner(valueOwner), m_result(nullptr)
{
}
const Value *ConvertToString::operator()(const Value *value)
{
- const Value *previousValue = switchResult(0);
+ const Value *previousValue = switchResult(nullptr);
if (value)
value->accept(this);
@@ -1729,13 +1729,13 @@ void ConvertToString::visit(const FunctionValue *object)
}
ConvertToObject::ConvertToObject(ValueOwner *valueOwner)
- : m_valueOwner(valueOwner), m_result(0)
+ : m_valueOwner(valueOwner), m_result(nullptr)
{
}
const Value *ConvertToObject::operator()(const Value *value)
{
- const Value *previousValue = switchResult(0);
+ const Value *previousValue = switchResult(nullptr);
if (value)
value->accept(this);
@@ -1851,7 +1851,7 @@ ASTObjectValue::ASTObjectValue(UiQualifiedId *typeName,
const Document *doc,
ValueOwner *valueOwner)
: ObjectValue(valueOwner, doc->importId()),
- m_typeName(typeName), m_initializer(initializer), m_doc(doc), m_defaultPropertyRef(0)
+ m_typeName(typeName), m_initializer(initializer), m_doc(doc), m_defaultPropertyRef(nullptr)
{
if (m_initializer) {
for (UiObjectMemberList *it = m_initializer->members; it; it = it->next) {
@@ -2162,7 +2162,7 @@ ASTSignal::ASTSignal(UiPublicMember *ast, const Document *doc, ValueOwner *value
const QString &signalName = ast->name.toString();
m_slotName = generatedSlotName(signalName);
- ObjectValue *v = valueOwner->newObject(/*prototype=*/0);
+ ObjectValue *v = valueOwner->newObject(/*prototype=*/nullptr);
for (UiParameterList *it = ast->parameters; it; it = it->next) {
if (!it->name.isEmpty())
v->setMember(it->name.toString(), valueOwner->defaultValueForBuiltinType(it->type->name.toString()));
@@ -2218,7 +2218,7 @@ bool ASTSignal::getSourceLocation(QString *fileName, int *line, int *column) con
ImportInfo::ImportInfo()
: m_type(ImportType::Invalid)
- , m_ast(0)
+ , m_ast(nullptr)
{
}
@@ -2328,7 +2328,7 @@ UiImport *ImportInfo::ast() const
}
Import::Import()
- : object(0), valid(false), used(false)
+ : object(nullptr), valid(false), used(false)
{}
Import::Import(const Import &other)
@@ -2381,8 +2381,8 @@ const Value *TypeScope::lookupMember(const QString &name, const Context *context
}
}
if (foundInObject)
- *foundInObject = 0;
- return 0;
+ *foundInObject = nullptr;
+ return nullptr;
}
void TypeScope::processMembers(MemberProcessor *processor) const
@@ -2436,8 +2436,8 @@ const Value *JSImportScope::lookupMember(const QString &name, const Context *,
}
}
if (foundInObject)
- *foundInObject = 0;
- return 0;
+ *foundInObject = nullptr;
+ return nullptr;
}
void JSImportScope::processMembers(MemberProcessor *processor) const
diff --git a/src/libs/qmljs/qmljsinterpreter.h b/src/libs/qmljs/qmljsinterpreter.h
index f2e953180c..a726b3bff1 100644
--- a/src/libs/qmljs/qmljsinterpreter.h
+++ b/src/libs/qmljs/qmljsinterpreter.h
@@ -163,163 +163,163 @@ template <typename RetTy> const RetTy *value_cast(const Value *)
template <> Q_INLINE_TEMPLATE const NullValue *value_cast(const Value *v)
{
if (v) return v->asNullValue();
- else return 0;
+ else return nullptr;
}
template <> Q_INLINE_TEMPLATE const UndefinedValue *value_cast(const Value *v)
{
if (v) return v->asUndefinedValue();
- else return 0;
+ else return nullptr;
}
template <> Q_INLINE_TEMPLATE const UnknownValue *value_cast(const Value *v)
{
if (v) return v->asUnknownValue();
- else return 0;
+ else return nullptr;
}
template <> Q_INLINE_TEMPLATE const NumberValue *value_cast(const Value *v)
{
if (v) return v->asNumberValue();
- else return 0;
+ else return nullptr;
}
template <> Q_INLINE_TEMPLATE const IntValue *value_cast(const Value *v)
{
if (v) return v->asIntValue();
- else return 0;
+ else return nullptr;
}
template <> Q_INLINE_TEMPLATE const RealValue *value_cast(const Value *v)
{
if (v) return v->asRealValue();
- else return 0;
+ else return nullptr;
}
template <> Q_INLINE_TEMPLATE const BooleanValue *value_cast(const Value *v)
{
if (v) return v->asBooleanValue();
- else return 0;
+ else return nullptr;
}
template <> Q_INLINE_TEMPLATE const StringValue *value_cast(const Value *v)
{
if (v) return v->asStringValue();
- else return 0;
+ else return nullptr;
}
template <> Q_INLINE_TEMPLATE const UrlValue *value_cast(const Value *v)
{
if (v) return v->asUrlValue();
- else return 0;
+ else return nullptr;
}
template <> Q_INLINE_TEMPLATE const ObjectValue *value_cast(const Value *v)
{
if (v) return v->asObjectValue();
- else return 0;
+ else return nullptr;
}
template <> Q_INLINE_TEMPLATE const ASTFunctionValue *value_cast(const Value *v)
{
if (v) return v->asAstFunctionValue();
- else return 0;
+ else return nullptr;
}
template <> Q_INLINE_TEMPLATE const FunctionValue *value_cast(const Value *v)
{
if (v) return v->asFunctionValue();
- else return 0;
+ else return nullptr;
}
template <> Q_INLINE_TEMPLATE const Reference *value_cast(const Value *v)
{
if (v) return v->asReference();
- else return 0;
+ else return nullptr;
}
template <> Q_INLINE_TEMPLATE const ColorValue *value_cast(const Value *v)
{
if (v) return v->asColorValue();
- else return 0;
+ else return nullptr;
}
template <> Q_INLINE_TEMPLATE const AnchorLineValue *value_cast(const Value *v)
{
if (v) return v->asAnchorLineValue();
- else return 0;
+ else return nullptr;
}
template <> Q_INLINE_TEMPLATE const CppComponentValue *value_cast(const Value *v)
{
if (v) return v->asCppComponentValue();
- else return 0;
+ else return nullptr;
}
template <> Q_INLINE_TEMPLATE const ASTObjectValue *value_cast(const Value *v)
{
if (v) return v->asAstObjectValue();
- else return 0;
+ else return nullptr;
}
template <> Q_INLINE_TEMPLATE const QmlEnumValue *value_cast(const Value *v)
{
if (v) return v->asQmlEnumValue();
- else return 0;
+ else return nullptr;
}
template <> Q_INLINE_TEMPLATE const QmlPrototypeReference *value_cast(const Value *v)
{
if (v) return v->asQmlPrototypeReference();
- else return 0;
+ else return nullptr;
}
template <> Q_INLINE_TEMPLATE const ASTPropertyReference *value_cast(const Value *v)
{
if (v) return v->asAstPropertyReference();
- else return 0;
+ else return nullptr;
}
template <> Q_INLINE_TEMPLATE const Internal::QtObjectPrototypeReference *value_cast(const Value *v)
{
if (v) return v->asQtObjectPrototypeReference();
- else return 0;
+ else return nullptr;
}
template <> Q_INLINE_TEMPLATE const ASTVariableReference *value_cast(const Value *v)
{
if (v) return v->asAstVariableReference();
- else return 0;
+ else return nullptr;
}
template <> Q_INLINE_TEMPLATE const Function *value_cast(const Value *v)
{
if (v) return v->asFunction();
- else return 0;
+ else return nullptr;
}
template <> Q_INLINE_TEMPLATE const MetaFunction *value_cast(const Value *v)
{
if (v) return v->asMetaFunction();
- else return 0;
+ else return nullptr;
}
template <> Q_INLINE_TEMPLATE const JSImportScope *value_cast(const Value *v)
{
if (v) return v->asJSImportScope();
- else return 0;
+ else return nullptr;
}
template <> Q_INLINE_TEMPLATE const TypeScope *value_cast(const Value *v)
{
if (v) return v->asTypeScope();
- else return 0;
+ else return nullptr;
}
template <> Q_INLINE_TEMPLATE const ASTSignal *value_cast(const Value *v)
{
if (v) return v->asAstSignal();
- else return 0;
+ else return nullptr;
}
////////////////////////////////////////////////////////////////////////////////
@@ -480,7 +480,7 @@ class QMLJS_EXPORT PropertyData {
public:
const Value *value;
PropertyInfo propertyInfo;
- PropertyData(const Value *value = 0,
+ PropertyData(const Value *value = nullptr,
PropertyInfo propertyInfo = PropertyInfo(PropertyInfo::Default))
: value(value), propertyInfo(propertyInfo)
{ }
@@ -513,10 +513,10 @@ public:
virtual void removeMember(const QString &name);
virtual const Value *lookupMember(const QString &name, const Context *context,
- const ObjectValue **foundInObject = 0,
+ const ObjectValue **foundInObject = nullptr,
bool examinePrototypes = true) const;
virtual const Value *lookupMember(const QString &name, const ContextPtr &context,
- const ObjectValue **foundInObject = 0,
+ const ObjectValue **foundInObject = nullptr,
bool examinePrototypes = true) const
{ return lookupMember(name, context.data(), foundInObject, examinePrototypes); }
@@ -620,8 +620,8 @@ public:
bool hasLocalProperty(const QString &typeName) const;
bool hasProperty(const QString &typeName) const;
- LanguageUtils::FakeMetaEnum getEnum(const QString &typeName, const CppComponentValue **foundInScope = 0) const;
- const QmlEnumValue *getEnumValue(const QString &typeName, const CppComponentValue **foundInScope = 0) const;
+ LanguageUtils::FakeMetaEnum getEnum(const QString &typeName, const CppComponentValue **foundInScope = nullptr) const;
+ const QmlEnumValue *getEnumValue(const QString &typeName, const CppComponentValue **foundInScope = nullptr) const;
const ObjectValue *signalScope(const QString &signalName) const;
protected:
@@ -1000,11 +1000,11 @@ public:
ImportInfo();
static ImportInfo moduleImport(QString uri, LanguageUtils::ComponentVersion version,
- const QString &as, AST::UiImport *ast = 0);
+ const QString &as, AST::UiImport *ast = nullptr);
static ImportInfo pathImport(const QString &docPath, const QString &path,
LanguageUtils::ComponentVersion version,
- const QString &as, AST::UiImport *ast = 0);
- static ImportInfo invalidImport(AST::UiImport *ast = 0);
+ const QString &as, AST::UiImport *ast = nullptr);
+ static ImportInfo invalidImport(AST::UiImport *ast = nullptr);
static ImportInfo implicitDirectoryImport(const QString &directory);
static ImportInfo qrcDirectoryImport(const QString &directory);
@@ -1059,7 +1059,7 @@ public:
TypeScope(const Imports *imports, ValueOwner *valueOwner);
virtual const Value *lookupMember(const QString &name, const Context *context,
- const ObjectValue **foundInObject = 0,
+ const ObjectValue **foundInObject = nullptr,
bool examinePrototypes = true) const override;
void processMembers(MemberProcessor *processor) const override;
const TypeScope *asTypeScope() const override;
@@ -1073,7 +1073,7 @@ public:
JSImportScope(const Imports *imports, ValueOwner *valueOwner);
virtual const Value *lookupMember(const QString &name, const Context *context,
- const ObjectValue **foundInObject = 0,
+ const ObjectValue **foundInObject = nullptr,
bool examinePrototypes = true) const override;
void processMembers(MemberProcessor *processor) const override;
const JSImportScope *asJSImportScope() const override;
diff --git a/src/libs/qmljs/qmljslineinfo.cpp b/src/libs/qmljs/qmljslineinfo.cpp
index e3a83e1244..9a7ab32e25 100644
--- a/src/libs/qmljs/qmljslineinfo.cpp
+++ b/src/libs/qmljs/qmljslineinfo.cpp
@@ -89,9 +89,9 @@ LineInfo::LineInfo()
*/
// shorthands
- yyLine = 0;
- yyBraceDepth = 0;
- yyLeftBraceFollows = 0;
+ yyLine = nullptr;
+ yyBraceDepth = nullptr;
+ yyLeftBraceFollows = nullptr;
}
LineInfo::~LineInfo()
diff --git a/src/libs/qmljs/qmljslink.cpp b/src/libs/qmljs/qmljslink.cpp
index 6c843adb85..396e69b8e5 100644
--- a/src/libs/qmljs/qmljslink.cpp
+++ b/src/libs/qmljs/qmljslink.cpp
@@ -138,8 +138,8 @@ Link::Link(const Snapshot &snapshot, const ViewerContext &vContext, const Librar
d->builtins = builtins;
d->vContext = vContext;
- d->diagnosticMessages = 0;
- d->allDiagnosticMessages = 0;
+ d->diagnosticMessages = nullptr;
+ d->allDiagnosticMessages = nullptr;
ModelManagerInterface *modelManager = ModelManagerInterface::instance();
if (modelManager) {
@@ -151,11 +151,11 @@ Link::Link(const Snapshot &snapshot, const ViewerContext &vContext, const Librar
}
// build an object with the context properties from C++
- ObjectValue *cppContextProperties = d->valueOwner->newObject(/* prototype = */ 0);
+ ObjectValue *cppContextProperties = d->valueOwner->newObject(/* prototype = */ nullptr);
for (const ModelManagerInterface::CppData &cppData : cppDataHash) {
for (auto it = cppData.contextProperties.cbegin(), end = cppData.contextProperties.cend();
it != end; ++it) {
- const Value *value = 0;
+ const Value *value = nullptr;
const QString cppTypeName = it.value();
if (!cppTypeName.isEmpty())
value = d->valueOwner->cppQmlTypes().objectByCppName(cppTypeName);
@@ -289,7 +289,7 @@ Import LinkPrivate::importFileOrDirectory(Document::Ptr doc, const ImportInfo &i
{
Import import;
import.info = importInfo;
- import.object = 0;
+ import.object = nullptr;
import.valid = true;
QString path = importInfo.path();
@@ -314,7 +314,7 @@ Import LinkPrivate::importFileOrDirectory(Document::Ptr doc, const ImportInfo &i
} else if (importInfo.type() == ImportType::QrcFile) {
QLocale locale;
QStringList filePaths = ModelManagerInterface::instance()
- ->filesAtQrcPath(path, &locale, 0, ModelManagerInterface::ActiveQrcResources);
+ ->filesAtQrcPath(path, &locale, nullptr, ModelManagerInterface::ActiveQrcResources);
if (filePaths.isEmpty())
filePaths = ModelManagerInterface::instance()->filesAtQrcPath(path);
if (!filePaths.isEmpty()) {
diff --git a/src/libs/qmljs/qmljslink.h b/src/libs/qmljs/qmljslink.h
index 59e5e3f85a..e4357061b3 100644
--- a/src/libs/qmljs/qmljslink.h
+++ b/src/libs/qmljs/qmljslink.h
@@ -46,7 +46,7 @@ public:
Link(const Snapshot &snapshot, const ViewerContext &vContext, const LibraryInfo &builtins);
// Link all documents in snapshot, collecting all diagnostic messages (if messages != 0)
- ContextPtr operator()(QHash<QString, QList<DiagnosticMessage> > *messages = 0);
+ ContextPtr operator()(QHash<QString, QList<DiagnosticMessage> > *messages = nullptr);
// Link all documents in snapshot, appending the diagnostic messages
// for 'doc' in 'messages'
diff --git a/src/libs/qmljs/qmljsplugindumper.cpp b/src/libs/qmljs/qmljsplugindumper.cpp
index 2c6afb61c0..e4f51e64c2 100644
--- a/src/libs/qmljs/qmljsplugindumper.cpp
+++ b/src/libs/qmljs/qmljsplugindumper.cpp
@@ -44,7 +44,7 @@ using namespace QmlJS;
PluginDumper::PluginDumper(ModelManagerInterface *modelManager)
: QObject(modelManager)
, m_modelManager(modelManager)
- , m_pluginWatcher(0)
+ , m_pluginWatcher(nullptr)
{
qRegisterMetaType<QmlJS::ModelManagerInterface::ProjectInfo>("QmlJS::ModelManagerInterface::ProjectInfo");
}
@@ -436,7 +436,7 @@ void PluginDumper::loadDependencies(const QStringList &dependencies,
visitedPtr->insert(name);
}
QStringList newDependencies;
- loadQmlTypeDescription(dependenciesPaths, errors, warnings, objects, 0, &newDependencies);
+ loadQmlTypeDescription(dependenciesPaths, errors, warnings, objects, nullptr, &newDependencies);
newDependencies = Utils::toList(Utils::toSet(newDependencies) - *visitedPtr);
if (!newDependencies.isEmpty())
loadDependencies(newDependencies, errors, warnings, objects, visitedPtr.take());
diff --git a/src/libs/qmljs/qmljsrewriter.cpp b/src/libs/qmljs/qmljsrewriter.cpp
index b672f8df86..25cad3d2db 100644
--- a/src/libs/qmljs/qmljsrewriter.cpp
+++ b/src/libs/qmljs/qmljsrewriter.cpp
@@ -67,7 +67,7 @@ Rewriter::Range Rewriter::addBinding(AST::UiObjectInitializer *ast,
SourceLocation endOfPreviousMember;
SourceLocation startOfNextMember;
- if (insertAfter == 0 || insertAfter->member == 0) {
+ if (insertAfter == nullptr || insertAfter->member == nullptr) {
// insert as first member
endOfPreviousMember = ast->lbraceToken;
@@ -88,7 +88,7 @@ Rewriter::Range Rewriter::addBinding(AST::UiObjectInitializer *ast,
bool needsTrailingSemicolon = false;
if (isOneLiner) {
- if (insertAfter == 0) { // we're inserting after an lbrace
+ if (insertAfter == nullptr) { // we're inserting after an lbrace
if (ast->members) { // we're inserting before a member (and not the rbrace)
needsTrailingSemicolon = bindingType == ScriptBinding;
}
@@ -142,8 +142,8 @@ UiObjectMemberList *Rewriter::searchMemberToInsertAfter(UiObjectMemberList *memb
{
const int objectDefinitionInsertionPoint = propertyOrder.indexOf(QString());
- UiObjectMemberList *lastObjectDef = 0;
- UiObjectMemberList *lastNonObjectDef = 0;
+ UiObjectMemberList *lastObjectDef = nullptr;
+ UiObjectMemberList *lastNonObjectDef = nullptr;
for (UiObjectMemberList *iter = members; iter; iter = iter->next) {
UiObjectMember *member = iter->member;
@@ -175,8 +175,8 @@ UiArrayMemberList *Rewriter::searchMemberToInsertAfter(UiArrayMemberList *member
{
const int objectDefinitionInsertionPoint = propertyOrder.indexOf(QString());
- UiArrayMemberList *lastObjectDef = 0;
- UiArrayMemberList *lastNonObjectDef = 0;
+ UiArrayMemberList *lastObjectDef = nullptr;
+ UiArrayMemberList *lastNonObjectDef = nullptr;
for (UiArrayMemberList *iter = members; iter; iter = iter->next) {
UiObjectMember *member = iter->member;
@@ -208,7 +208,7 @@ UiObjectMemberList *Rewriter::searchMemberToInsertAfter(UiObjectMemberList *memb
const QStringList &propertyOrder)
{
if (!members)
- return 0; // empty members
+ return nullptr; // empty members
QHash<QString, UiObjectMemberList *> orderedMembers;
@@ -236,11 +236,11 @@ UiObjectMemberList *Rewriter::searchMemberToInsertAfter(UiObjectMemberList *memb
for (; idx > 0; --idx) {
const QString prop = propertyOrder.at(idx - 1);
UiObjectMemberList *candidate = orderedMembers.value(prop, 0);
- if (candidate != 0)
+ if (candidate != nullptr)
return candidate;
}
- return 0;
+ return nullptr;
}
void Rewriter::changeBinding(UiObjectInitializer *ast,
@@ -356,7 +356,7 @@ void Rewriter::insertIntoArray(UiArrayBinding *ast, const QString &newValue)
if (!ast)
return;
- UiObjectMember *lastMember = 0;
+ UiObjectMember *lastMember = nullptr;
for (UiArrayMemberList *iter = ast->members; iter; iter = iter->next) {
lastMember = iter->member;
}
@@ -400,7 +400,7 @@ void Rewriter::removeGroupedProperty(UiObjectDefinition *ast,
const QString propName = propertyName.mid(dotIdx + 1);
- UiObjectMember *wanted = 0;
+ UiObjectMember *wanted = nullptr;
unsigned memberCount = 0;
for (UiObjectMemberList *it = ast->initializer->members; it; it = it->next) {
++memberCount;
@@ -590,7 +590,7 @@ UiObjectMemberList *QMLRewriter::searchMemberToInsertAfter(UiObjectMemberList *m
void Rewriter::appendToArrayBinding(UiArrayBinding *arrayBinding,
const QString &content)
{
- UiObjectMember *lastMember = 0;
+ UiObjectMember *lastMember = nullptr;
for (UiArrayMemberList *iter = arrayBinding->members; iter; iter = iter->next)
if (iter->member)
lastMember = iter->member;
@@ -671,7 +671,7 @@ void Rewriter::extendToLeadingOrTrailingComma(UiArrayBinding *parentArray,
int &start,
int &end) const
{
- UiArrayMemberList *currentMember = 0;
+ UiArrayMemberList *currentMember = nullptr;
for (UiArrayMemberList *it = parentArray->members; it; it = it->next) {
if (it->member == member) {
currentMember = it;
diff --git a/src/libs/qmljs/qmljsscopebuilder.cpp b/src/libs/qmljs/qmljsscopebuilder.cpp
index 7b071662b9..ca59e74dca 100644
--- a/src/libs/qmljs/qmljsscopebuilder.cpp
+++ b/src/libs/qmljs/qmljsscopebuilder.cpp
@@ -67,8 +67,8 @@ void ScopeBuilder::push(AST::Node *node)
if (!_scopeChain->qmlScopeObjects().isEmpty()
&& name.startsWith(QLatin1String("on"))
&& !script->qualifiedId->next) {
- const ObjectValue *owner = 0;
- const Value *value = 0;
+ const ObjectValue *owner = nullptr;
+ const Value *value = nullptr;
// try to find the name on the scope objects
foreach (const ObjectValue *scope, _scopeChain->qmlScopeObjects()) {
value = scope->lookupMember(name, _scopeChain->context(), &owner);
@@ -217,19 +217,19 @@ void ScopeBuilder::setQmlScopeObject(Node *node)
const Value *ScopeBuilder::scopeObjectLookup(AST::UiQualifiedId *id)
{
// do a name lookup on the scope objects
- const Value *result = 0;
+ const Value *result = nullptr;
foreach (const ObjectValue *scopeObject, _scopeChain->qmlScopeObjects()) {
const ObjectValue *object = scopeObject;
for (UiQualifiedId *it = id; it; it = it->next) {
if (it->name.isEmpty())
- return 0;
+ return nullptr;
result = object->lookupMember(it->name.toString(), _scopeChain->context());
if (!result)
break;
if (it->next) {
object = result->asObjectValue();
if (!object) {
- result = 0;
+ result = nullptr;
break;
}
}
@@ -255,5 +255,5 @@ const ObjectValue *ScopeBuilder::isPropertyChangesObject(const ContextPtr &conte
return prototype;
}
}
- return 0;
+ return nullptr;
}
diff --git a/src/libs/qmljs/qmljsscopechain.cpp b/src/libs/qmljs/qmljsscopechain.cpp
index cda0b0c656..c9fadb91e9 100644
--- a/src/libs/qmljs/qmljsscopechain.cpp
+++ b/src/libs/qmljs/qmljsscopechain.cpp
@@ -77,14 +77,14 @@ QList<const QmlComponentChain *> QmlComponentChain::instantiatingComponents() co
const ObjectValue *QmlComponentChain::idScope() const
{
if (!m_document)
- return 0;
+ return nullptr;
return m_document->bind()->idEnvironment();
}
const ObjectValue *QmlComponentChain::rootObjectScope() const
{
if (!m_document)
- return 0;
+ return nullptr;
return m_document->bind()->rootObjectValue();
}
@@ -97,10 +97,10 @@ void QmlComponentChain::addInstantiatingComponent(const QmlComponentChain *compo
ScopeChain::ScopeChain(const Document::Ptr &document, const ContextPtr &context)
: m_document(document)
, m_context(context)
- , m_globalScope(0)
- , m_cppContextProperties(0)
- , m_qmlTypes(0)
- , m_jsImports(0)
+ , m_globalScope(nullptr)
+ , m_cppContextProperties(nullptr)
+ , m_qmlTypes(nullptr)
+ , m_jsImports(nullptr)
, m_modified(false)
{
initializeRootScope();
@@ -130,7 +130,7 @@ const Value * ScopeChain::lookup(const QString &name, const ObjectValue **foundI
}
if (foundInScope)
- *foundInScope = 0;
+ *foundInScope = nullptr;
// we're confident to implement global lookup correctly, so return 'undefined'
return m_context->valueOwner()->undefinedValue();
@@ -264,8 +264,8 @@ void ScopeChain::update() const
}
}
- ObjectValue *root = 0;
- ObjectValue *ids = 0;
+ ObjectValue *root = nullptr;
+ ObjectValue *ids = nullptr;
if (m_qmlComponentScope && m_qmlComponentScope->document()) {
const Bind *bind = m_qmlComponentScope->document()->bind();
root = bind->rootObjectValue();
diff --git a/src/libs/qmljs/qmljsscopechain.h b/src/libs/qmljs/qmljsscopechain.h
index a08d686248..829ff1230f 100644
--- a/src/libs/qmljs/qmljsscopechain.h
+++ b/src/libs/qmljs/qmljsscopechain.h
@@ -72,7 +72,7 @@ public:
Document::Ptr document() const;
const ContextPtr &context() const;
- const Value *lookup(const QString &name, const ObjectValue **foundInScope = 0) const;
+ const Value *lookup(const QString &name, const ObjectValue **foundInScope = nullptr) const;
const Value *evaluate(AST::Node *node) const;
const ObjectValue *globalScope() const;
diff --git a/src/libs/qmljs/qmljstypedescriptionreader.cpp b/src/libs/qmljs/qmljstypedescriptionreader.cpp
index 80ec498d8f..895922a1eb 100644
--- a/src/libs/qmljs/qmljstypedescriptionreader.cpp
+++ b/src/libs/qmljs/qmljstypedescriptionreader.cpp
@@ -42,7 +42,7 @@ using namespace QmlJS::AST;
using namespace LanguageUtils;
TypeDescriptionReader::TypeDescriptionReader(const QString &fileName, const QString &data)
- : _fileName (fileName), _source(data), _objects(0)
+ : _fileName (fileName), _source(data), _objects(nullptr)
{
}
diff --git a/src/libs/qmljs/qmljsutils.cpp b/src/libs/qmljs/qmljsutils.cpp
index d212e8fdcd..4872a0bae7 100644
--- a/src/libs/qmljs/qmljsutils.cpp
+++ b/src/libs/qmljs/qmljsutils.cpp
@@ -140,7 +140,7 @@ SourceLocation QmlJS::fullLocationForQualifiedId(AST::UiQualifiedId *qualifiedId
QString QmlJS::idOfObject(Node *object, UiScriptBinding **idBinding)
{
if (idBinding)
- *idBinding = 0;
+ *idBinding = nullptr;
UiObjectInitializer *initializer = initializerOfObject(object);
if (!initializer) {
@@ -179,7 +179,7 @@ UiObjectInitializer *QmlJS::initializerOfObject(Node *object)
return definition->initializer;
if (UiObjectBinding *binding = cast<UiObjectBinding *>(object))
return binding->initializer;
- return 0;
+ return nullptr;
}
UiQualifiedId *QmlJS::qualifiedTypeNameId(Node *node)
@@ -188,7 +188,7 @@ UiQualifiedId *QmlJS::qualifiedTypeNameId(Node *node)
return binding->qualifiedTypeNameId;
else if (UiObjectDefinition *binding = AST::cast<UiObjectDefinition *>(node))
return binding->qualifiedTypeNameId;
- return 0;
+ return nullptr;
}
DiagnosticMessage QmlJS::errorMessage(const AST::SourceLocation &loc, const QString &message)
diff --git a/src/libs/qmljs/qmljsutils.h b/src/libs/qmljs/qmljsutils.h
index a9da56ed2d..103548ade3 100644
--- a/src/libs/qmljs/qmljsutils.h
+++ b/src/libs/qmljs/qmljsutils.h
@@ -43,7 +43,7 @@ QMLJS_EXPORT AST::SourceLocation locationFromRange(const AST::SourceLocation &st
QMLJS_EXPORT AST::SourceLocation fullLocationForQualifiedId(AST::UiQualifiedId *);
-QMLJS_EXPORT QString idOfObject(AST::Node *object, AST::UiScriptBinding **idBinding = 0);
+QMLJS_EXPORT QString idOfObject(AST::Node *object, AST::UiScriptBinding **idBinding = nullptr);
QMLJS_EXPORT AST::UiObjectInitializer *initializerOfObject(AST::Node *object);
diff --git a/src/libs/qmljs/qmljsvalueowner.cpp b/src/libs/qmljs/qmljsvalueowner.cpp
index bc58f61490..573ccb2aa1 100644
--- a/src/libs/qmljs/qmljsvalueowner.cpp
+++ b/src/libs/qmljs/qmljsvalueowner.cpp
@@ -130,7 +130,7 @@ SharedValueOwner *ValueOwner::sharedValueOwner(QString kind)
SharedValueOwner::SharedValueOwner(SharedValueOwnerKind kind)
: ValueOwner(this) // need to avoid recursing in ValueOwner ctor
{
- _objectPrototype = newObject(/*prototype = */ 0);
+ _objectPrototype = newObject(/*prototype = */ nullptr);
_functionPrototype = newObject(_objectPrototype);
_numberPrototype = newObject(_objectPrototype);
_booleanPrototype = newObject(_objectPrototype);
@@ -409,7 +409,7 @@ SharedValueOwner::SharedValueOwner(SharedValueOwnerKind kind)
_globalObject->setMember(QLatin1String("Date"), dateCtor());
_globalObject->setMember(QLatin1String("RegExp"), regexpCtor());
- Function *f = 0;
+ Function *f = nullptr;
// XMLHttpRequest
ObjectValue *xmlHttpRequest = newObject();
@@ -477,7 +477,7 @@ SharedValueOwner::SharedValueOwner(SharedValueOwnerKind kind)
_globalObject->setMember(QLatin1String("JSON"), json);
// QML objects
- _qmlFontObject = newObject(/*prototype =*/ 0);
+ _qmlFontObject = newObject(/*prototype =*/ nullptr);
_qmlFontObject->setClassName(QLatin1String("font"));
_qmlFontObject->setMember(QLatin1String("family"), stringValue());
_qmlFontObject->setMember(QLatin1String("styleName"), stringValue());
@@ -496,24 +496,24 @@ SharedValueOwner::SharedValueOwner(SharedValueOwnerKind kind)
_qmlFontObject->setMember(QLatin1String("kerning"), booleanValue());
_qmlFontObject->setMember(QLatin1String("preferShaping"), booleanValue());
- _qmlPointObject = newObject(/*prototype =*/ 0);
+ _qmlPointObject = newObject(/*prototype =*/ nullptr);
_qmlPointObject->setClassName(QLatin1String("Point"));
_qmlPointObject->setMember(QLatin1String("x"), numberValue());
_qmlPointObject->setMember(QLatin1String("y"), numberValue());
- _qmlSizeObject = newObject(/*prototype =*/ 0);
+ _qmlSizeObject = newObject(/*prototype =*/ nullptr);
_qmlSizeObject->setClassName(QLatin1String("Size"));
_qmlSizeObject->setMember(QLatin1String("width"), numberValue());
_qmlSizeObject->setMember(QLatin1String("height"), numberValue());
- _qmlRectObject = newObject(/*prototype =*/ 0);
+ _qmlRectObject = newObject(/*prototype =*/ nullptr);
_qmlRectObject->setClassName(QLatin1String("Rect"));
_qmlRectObject->setMember(QLatin1String("x"), numberValue());
_qmlRectObject->setMember(QLatin1String("y"), numberValue());
_qmlRectObject->setMember(QLatin1String("width"), numberValue());
_qmlRectObject->setMember(QLatin1String("height"), numberValue());
- _qmlVector2DObject = newObject(/*prototype =*/ 0);
+ _qmlVector2DObject = newObject(/*prototype =*/ nullptr);
_qmlVector2DObject->setClassName(QLatin1String("Vector2D"));
_qmlVector2DObject->setMember(QLatin1String("x"), realValue());
_qmlVector2DObject->setMember(QLatin1String("y"), realValue());
@@ -527,7 +527,7 @@ SharedValueOwner::SharedValueOwner(SharedValueOwnerKind kind)
addFunction(_qmlVector2DObject, QLatin1String("toVector4d"), _qmlVector4DObject, 0);
addFunction(_qmlVector2DObject, QLatin1String("fuzzyEquals"), booleanValue(), 1, 1);
- _qmlVector3DObject = newObject(/*prototype =*/ 0);
+ _qmlVector3DObject = newObject(/*prototype =*/ nullptr);
_qmlVector3DObject->setClassName(QLatin1String("Vector3D"));
_qmlVector3DObject->setMember(QLatin1String("x"), realValue());
_qmlVector3DObject->setMember(QLatin1String("y"), realValue());
@@ -542,7 +542,7 @@ SharedValueOwner::SharedValueOwner(SharedValueOwnerKind kind)
addFunction(_qmlVector3DObject, QLatin1String("toVector4d"), _qmlVector4DObject, 0);
addFunction(_qmlVector3DObject, QLatin1String("fuzzyEquals"), booleanValue(), 1, 1);
- _qmlVector4DObject = newObject(/*prototype =*/ 0);
+ _qmlVector4DObject = newObject(/*prototype =*/ nullptr);
_qmlVector4DObject->setClassName(QLatin1String("Vector4D"));
_qmlVector4DObject->setMember(QLatin1String("x"), realValue());
_qmlVector4DObject->setMember(QLatin1String("y"), realValue());
@@ -558,14 +558,14 @@ SharedValueOwner::SharedValueOwner(SharedValueOwnerKind kind)
addFunction(_qmlVector4DObject, QLatin1String("toVector3d"), _qmlVector3DObject, 0);
addFunction(_qmlVector4DObject, QLatin1String("fuzzyEquals"), booleanValue(), 1, 1);
- _qmlQuaternionObject = newObject(/*prototype =*/ 0);
+ _qmlQuaternionObject = newObject(/*prototype =*/ nullptr);
_qmlQuaternionObject->setClassName(QLatin1String("Quaternion"));
_qmlQuaternionObject->setMember(QLatin1String("scalar"), realValue());
_qmlQuaternionObject->setMember(QLatin1String("x"), realValue());
_qmlQuaternionObject->setMember(QLatin1String("y"), realValue());
_qmlQuaternionObject->setMember(QLatin1String("z"), realValue());
- _qmlMatrix4x4Object = newObject(/*prototype =*/ 0);
+ _qmlMatrix4x4Object = newObject(/*prototype =*/ nullptr);
_qmlMatrix4x4Object->setClassName(QLatin1String("Matrix4x4"));
for (int i = 1; i < 5; ++i)
for (int j = 1; j < 5; ++j)
@@ -634,7 +634,7 @@ SharedValueOwner::SharedValueOwner(SharedValueOwnerKind kind)
_globalObject->setMember(QLatin1String("Qt"), _qtObject);
// firebug/webkit compat
- ObjectValue *consoleObject = newObject(/*prototype */ 0);
+ ObjectValue *consoleObject = newObject(/*prototype */ nullptr);
addFunction(consoleObject, QLatin1String("log"), 1, 0, true);
addFunction(consoleObject, QLatin1String("debug"), 1, 0, true);
if (kind == Qt5Kind) {
diff --git a/src/libs/qmljs/qmljsvalueowner.h b/src/libs/qmljs/qmljsvalueowner.h
index 90c3f923e2..9c5adfe53d 100644
--- a/src/libs/qmljs/qmljsvalueowner.h
+++ b/src/libs/qmljs/qmljsvalueowner.h
@@ -62,7 +62,7 @@ class QMLJS_EXPORT ValueOwner
public:
static SharedValueOwner *sharedValueOwner(QString kind = QString());
- ValueOwner(const SharedValueOwner *shared = 0);
+ ValueOwner(const SharedValueOwner *shared = nullptr);
virtual ~ValueOwner();
const NullValue *nullValue() const;
diff --git a/src/libs/sqlite/sqlitedatabasebackend.cpp b/src/libs/sqlite/sqlitedatabasebackend.cpp
index 2f60677e59..4d5b350801 100644
--- a/src/libs/sqlite/sqlitedatabasebackend.cpp
+++ b/src/libs/sqlite/sqlitedatabasebackend.cpp
@@ -99,7 +99,7 @@ void DatabaseBackend::open(Utils::SmallStringView databaseFilePath, OpenMode mod
int resultCode = sqlite3_open_v2(databaseFilePath.data(),
&m_databaseHandle,
openMode(mode),
- NULL);
+ nullptr);
checkDatabaseCouldBeOpened(resultCode);
diff --git a/src/libs/ssh/sftpfilesystemmodel.cpp b/src/libs/ssh/sftpfilesystemmodel.cpp
index 572c39de2f..73860bacae 100644
--- a/src/libs/ssh/sftpfilesystemmodel.cpp
+++ b/src/libs/ssh/sftpfilesystemmodel.cpp
@@ -46,7 +46,7 @@ class SftpDirNode;
class SftpFileNode
{
public:
- SftpFileNode() : parent(0) { }
+ SftpFileNode() : parent(nullptr) { }
virtual ~SftpFileNode() { }
QString path;
@@ -98,9 +98,9 @@ using namespace Internal;
SftpFileSystemModel::SftpFileSystemModel(QObject *parent)
: QAbstractItemModel(parent), d(new SftpFileSystemModelPrivate)
{
- d->sshConnection = 0;
+ d->sshConnection = nullptr;
d->rootDirectory = QLatin1Char('/');
- d->rootNode = 0;
+ d->rootNode = nullptr;
d->statJobId = SftpInvalidJob;
}
@@ -131,7 +131,7 @@ void SftpFileSystemModel::setRootDirectory(const QString &path)
beginResetModel();
d->rootDirectory = path;
delete d->rootNode;
- d->rootNode = 0;
+ d->rootNode = nullptr;
d->lsOps.clear();
d->statJobId = SftpInvalidJob;
endResetModel();
@@ -262,17 +262,17 @@ void SftpFileSystemModel::statRootDirectory()
void SftpFileSystemModel::shutDown()
{
if (d->sftpSession) {
- disconnect(d->sftpSession.get(), 0, this, 0);
+ disconnect(d->sftpSession.get(), nullptr, this, nullptr);
d->sftpSession->quit();
d->sftpSession.release()->deleteLater();
}
if (d->sshConnection) {
- disconnect(d->sshConnection, 0, this, 0);
+ disconnect(d->sshConnection, nullptr, this, nullptr);
QSsh::releaseConnection(d->sshConnection);
- d->sshConnection = 0;
+ d->sshConnection = nullptr;
}
delete d->rootNode;
- d->rootNode = 0;
+ d->rootNode = nullptr;
}
void SftpFileSystemModel::handleSshConnectionFailure()
diff --git a/src/libs/ssh/sftpfilesystemmodel.h b/src/libs/ssh/sftpfilesystemmodel.h
index 091dfabb4c..96ba2a2a54 100644
--- a/src/libs/ssh/sftpfilesystemmodel.h
+++ b/src/libs/ssh/sftpfilesystemmodel.h
@@ -41,7 +41,7 @@ class QSSH_EXPORT SftpFileSystemModel : public QAbstractItemModel
{
Q_OBJECT
public:
- explicit SftpFileSystemModel(QObject *parent = 0);
+ explicit SftpFileSystemModel(QObject *parent = nullptr);
~SftpFileSystemModel();
/*
diff --git a/src/libs/ssh/sshconnection.h b/src/libs/ssh/sshconnection.h
index 89af4d71d9..9f6ece99fd 100644
--- a/src/libs/ssh/sshconnection.h
+++ b/src/libs/ssh/sshconnection.h
@@ -99,7 +99,7 @@ class QSSH_EXPORT SshConnection : public QObject
public:
enum State { Unconnected, Connecting, Connected, Disconnecting };
- explicit SshConnection(const SshConnectionParameters &serverInfo, QObject *parent = 0);
+ explicit SshConnection(const SshConnectionParameters &serverInfo, QObject *parent = nullptr);
void connectToHost();
void disconnectFromHost();
diff --git a/src/libs/ssh/sshconnectionmanager.cpp b/src/libs/ssh/sshconnectionmanager.cpp
index c3bb1821ee..68533728f2 100644
--- a/src/libs/ssh/sshconnectionmanager.cpp
+++ b/src/libs/ssh/sshconnectionmanager.cpp
@@ -70,7 +70,7 @@ public:
~SshConnectionManager()
{
foreach (const UnaquiredConnection &connection, m_unacquiredConnections) {
- disconnect(connection.connection, 0, this, 0);
+ disconnect(connection.connection, nullptr, this, nullptr);
delete connection.connection;
}
@@ -162,7 +162,7 @@ public:
}
if (doDelete) {
- disconnect(connection, 0, this, 0);
+ disconnect(connection, nullptr, this, nullptr);
m_deprecatedConnections.removeAll(connection);
connection->deleteLater();
}
@@ -175,7 +175,7 @@ public:
for (int i = 0; i < m_unacquiredConnections.count(); ++i) {
SshConnection * const connection = m_unacquiredConnections.at(i).connection;
if (connection->connectionParameters() == sshParams) {
- disconnect(connection, 0, this, 0);
+ disconnect(connection, nullptr, this, nullptr);
delete connection;
m_unacquiredConnections.removeAt(i);
break;
@@ -205,7 +205,7 @@ private:
return;
if (m_unacquiredConnections.removeOne(UnaquiredConnection(currentConnection))) {
- disconnect(currentConnection, 0, this, 0);
+ disconnect(currentConnection, nullptr, this, nullptr);
currentConnection->deleteLater();
}
}
@@ -216,7 +216,7 @@ private:
for (int i = m_unacquiredConnections.count() - 1; i >= 0; --i) {
UnaquiredConnection &c = m_unacquiredConnections[i];
if (c.scheduledForRemoval) {
- disconnect(c.connection, 0, this, 0);
+ disconnect(c.connection, nullptr, this, nullptr);
c.connection->deleteLater();
m_unacquiredConnections.removeAt(i);
} else {
diff --git a/src/libs/ssh/sshkeycreationdialog.h b/src/libs/ssh/sshkeycreationdialog.h
index a73fb3b3c2..dca0bdef82 100644
--- a/src/libs/ssh/sshkeycreationdialog.h
+++ b/src/libs/ssh/sshkeycreationdialog.h
@@ -37,7 +37,7 @@ class QSSH_EXPORT SshKeyCreationDialog : public QDialog
{
Q_OBJECT
public:
- SshKeyCreationDialog(QWidget *parent = 0);
+ SshKeyCreationDialog(QWidget *parent = nullptr);
~SshKeyCreationDialog();
QString privateKeyFilePath() const;
diff --git a/src/libs/ssh/sshremoteprocessrunner.cpp b/src/libs/ssh/sshremoteprocessrunner.cpp
index 7a062e6ab8..0a4419a0d6 100644
--- a/src/libs/ssh/sshremoteprocessrunner.cpp
+++ b/src/libs/ssh/sshremoteprocessrunner.cpp
@@ -189,9 +189,9 @@ void SshRemoteProcessRunner::setState(int newState)
d->m_process.release()->deleteLater();
}
if (d->m_connection) {
- disconnect(d->m_connection, 0, this, 0);
+ disconnect(d->m_connection, nullptr, this, nullptr);
QSsh::releaseConnection(d->m_connection);
- d->m_connection = 0;
+ d->m_connection = nullptr;
}
}
}
diff --git a/src/libs/ssh/sshremoteprocessrunner.h b/src/libs/ssh/sshremoteprocessrunner.h
index 082f30ed57..5b3f1b05b4 100644
--- a/src/libs/ssh/sshremoteprocessrunner.h
+++ b/src/libs/ssh/sshremoteprocessrunner.h
@@ -36,7 +36,7 @@ class QSSH_EXPORT SshRemoteProcessRunner : public QObject
Q_OBJECT
public:
- SshRemoteProcessRunner(QObject *parent = 0);
+ SshRemoteProcessRunner(QObject *parent = nullptr);
~SshRemoteProcessRunner();
void run(const QString &command, const SshConnectionParameters &sshParams);
diff --git a/src/libs/tracing/timelineabstractrenderer.cpp b/src/libs/tracing/timelineabstractrenderer.cpp
index c2e8886ee1..8242b70aad 100644
--- a/src/libs/tracing/timelineabstractrenderer.cpp
+++ b/src/libs/tracing/timelineabstractrenderer.cpp
@@ -28,7 +28,7 @@
namespace Timeline {
TimelineAbstractRenderer::TimelineAbstractRendererPrivate::TimelineAbstractRendererPrivate() :
- selectedItem(-1), selectionLocked(true), model(0), notes(0), zoomer(0), modelDirty(false),
+ selectedItem(-1), selectionLocked(true), model(nullptr), notes(nullptr), zoomer(nullptr), modelDirty(false),
rowHeightsDirty(false), notesDirty(false)
{
}
diff --git a/src/libs/tracing/timelineitemsrenderpass.cpp b/src/libs/tracing/timelineitemsrenderpass.cpp
index 00de497292..2a4727f056 100644
--- a/src/libs/tracing/timelineitemsrenderpass.cpp
+++ b/src/libs/tracing/timelineitemsrenderpass.cpp
@@ -273,7 +273,7 @@ OpaqueColoredPoint2DWithSize *OpaqueColoredPoint2DWithSize::fromVertexData(QSGGe
return static_cast<OpaqueColoredPoint2DWithSize *>(geometry->vertexData());
}
-TimelineItemsGeometry::TimelineItemsGeometry() : usedVertices(0), node(0)
+TimelineItemsGeometry::TimelineItemsGeometry() : usedVertices(0), node(nullptr)
{
initNodes();
}
@@ -392,7 +392,7 @@ TimelineRenderPass::State *TimelineItemsRenderPass::update(const TimelineAbstrac
QColor(Qt::blue)).lighter(130);
TimelineItemsRenderPassState *state;
- if (oldState == 0)
+ if (oldState == nullptr)
state = new TimelineItemsRenderPassState(model);
else
state = static_cast<TimelineItemsRenderPassState *>(oldState);
@@ -472,7 +472,7 @@ void TimelineItemsMaterialShader::updateState(const RenderState &state, QSGMater
char const *const *TimelineItemsMaterialShader::attributeNames() const
{
- static const char *const attr[] = {"vertexCoord", "rectSize", "selectionId", "vertexColor", 0};
+ static const char *const attr[] = {"vertexCoord", "rectSize", "selectionId", "vertexColor", nullptr};
return attr;
}
diff --git a/src/libs/tracing/timelinenotesrenderpass.cpp b/src/libs/tracing/timelinenotesrenderpass.cpp
index e9bd80a0e9..bfc3273eed 100644
--- a/src/libs/tracing/timelinenotesrenderpass.cpp
+++ b/src/libs/tracing/timelinenotesrenderpass.cpp
@@ -117,7 +117,7 @@ TimelineRenderPass::State *TimelineNotesRenderPass::update(const TimelineAbstrac
return oldState;
TimelineNotesRenderPassState *state;
- if (oldState == 0) {
+ if (oldState == nullptr) {
state = new TimelineNotesRenderPassState(model->expandedRowCount());
} else {
if (!stateChanged && !renderer->notesDirty())
@@ -253,7 +253,7 @@ void NotesMaterialShader::updateState(const RenderState &state, QSGMaterial *, Q
char const *const *NotesMaterialShader::attributeNames() const
{
- static const char *const attr[] = {"vertexCoord", "distanceFromTop", 0};
+ static const char *const attr[] = {"vertexCoord", "distanceFromTop", nullptr};
return attr;
}
diff --git a/src/libs/tracing/timelineoverviewrenderer.cpp b/src/libs/tracing/timelineoverviewrenderer.cpp
index 8b78c54a1f..9cd824186e 100644
--- a/src/libs/tracing/timelineoverviewrenderer.cpp
+++ b/src/libs/tracing/timelineoverviewrenderer.cpp
@@ -34,7 +34,7 @@ TimelineOverviewRenderer::TimelineOverviewRenderer(QQuickItem *parent) :
}
TimelineOverviewRenderer::TimelineOverviewRendererPrivate::TimelineOverviewRendererPrivate() :
- renderState(0)
+ renderState(nullptr)
{
}
@@ -50,15 +50,15 @@ QSGNode *TimelineOverviewRenderer::updatePaintNode(QSGNode *oldNode,
if (!d->model || d->model->isEmpty() || !d->zoomer || d->zoomer->traceDuration() <= 0) {
delete oldNode;
- return 0;
+ return nullptr;
}
if (d->modelDirty) {
delete d->renderState;
- d->renderState = 0;
+ d->renderState = nullptr;
}
- if (d->renderState == 0) {
+ if (d->renderState == nullptr) {
d->renderState = new TimelineRenderState(d->zoomer->traceStart(), d->zoomer->traceEnd(),
1.0, d->renderPasses.size());
}
@@ -77,7 +77,7 @@ QSGNode *TimelineOverviewRenderer::updatePaintNode(QSGNode *oldNode,
if (d->renderState->isEmpty())
d->renderState->assembleNodeTree(d->model, d->model->height(), 0);
- TimelineAbstractRenderer::updatePaintNode(0, updatePaintNodeData);
+ TimelineAbstractRenderer::updatePaintNode(nullptr, updatePaintNodeData);
QMatrix4x4 matrix;
matrix.scale(xSpacing, ySpacing, 1);
diff --git a/src/libs/tracing/timelinerenderer.cpp b/src/libs/tracing/timelinerenderer.cpp
index a59f3c95c9..a93444570a 100644
--- a/src/libs/tracing/timelinerenderer.cpp
+++ b/src/libs/tracing/timelinerenderer.cpp
@@ -43,7 +43,7 @@
namespace Timeline {
-TimelineRenderer::TimelineRendererPrivate::TimelineRendererPrivate() : lastState(0)
+TimelineRenderer::TimelineRendererPrivate::TimelineRendererPrivate() : lastState(nullptr)
{
resetCurrentSelection();
}
@@ -58,7 +58,7 @@ void TimelineRenderer::TimelineRendererPrivate::clear()
for (auto i = renderStates.begin(); i != renderStates.end(); ++i)
qDeleteAll(*i);
renderStates.clear();
- lastState = 0;
+ lastState = nullptr;
}
TimelineRenderer::TimelineRenderer(QQuickItem *parent) :
@@ -102,7 +102,7 @@ TimelineRenderState *TimelineRenderer::TimelineRendererPrivate::findRenderState(
if (renderStates.length() <= level)
renderStates.resize(level + 1);
TimelineRenderState *state = renderStates[level][offset];
- if (state == 0) {
+ if (state == nullptr) {
state = new TimelineRenderState(start, end, 1.0 / static_cast<qreal>(SafeFloatMax),
renderPasses.size());
renderStates[level][offset] = state;
@@ -117,7 +117,7 @@ QSGNode *TimelineRenderer::updatePaintNode(QSGNode *node, UpdatePaintNodeData *u
if (!d->model || d->model->hidden() || d->model->isEmpty() || !d->zoomer ||
d->zoomer->windowDuration() <= 0) {
delete node;
- return 0;
+ return nullptr;
}
float spacing = static_cast<float>(width() / d->zoomer->windowDuration());
@@ -146,7 +146,7 @@ QSGNode *TimelineRenderer::updatePaintNode(QSGNode *node, UpdatePaintNodeData *u
TimelineModel::defaultRowHeight());
}
- TimelineAbstractRenderer::updatePaintNode(0, updatePaintNodeData);
+ TimelineAbstractRenderer::updatePaintNode(nullptr, updatePaintNodeData);
d->lastState = state;
QMatrix4x4 matrix;
diff --git a/src/libs/tracing/timelinerenderpass.cpp b/src/libs/tracing/timelinerenderpass.cpp
index 7c87f239c6..f4644cd502 100644
--- a/src/libs/tracing/timelinerenderpass.cpp
+++ b/src/libs/tracing/timelinerenderpass.cpp
@@ -41,12 +41,12 @@ const QVector<QSGNode *> &TimelineRenderPass::State::collapsedRows() const
QSGNode *TimelineRenderPass::State::expandedOverlay() const
{
- return 0;
+ return nullptr;
}
QSGNode *TimelineRenderPass::State::collapsedOverlay() const
{
- return 0;
+ return nullptr;
}
TimelineRenderPass::State::~State()
diff --git a/src/libs/tracing/timelinerenderstate.cpp b/src/libs/tracing/timelinerenderstate.cpp
index f897496c56..d8eeb0527f 100644
--- a/src/libs/tracing/timelinerenderstate.cpp
+++ b/src/libs/tracing/timelinerenderstate.cpp
@@ -195,7 +195,7 @@ void TimelineRenderState::updateExpandedRowHeights(const TimelineModel *model, i
Q_D(TimelineRenderState);
int row = 0;
qreal offset = 0;
- for (QSGNode *rowNode = d->expandedRowRoot->firstChild(); rowNode != 0;
+ for (QSGNode *rowNode = d->expandedRowRoot->firstChild(); rowNode != nullptr;
rowNode = rowNode->nextSibling()) {
qreal rowHeight = model->expandedRowHeight(row++);
QMatrix4x4 matrix;
diff --git a/src/libs/tracing/timelineselectionrenderpass.cpp b/src/libs/tracing/timelineselectionrenderpass.cpp
index 4493187357..52be3eda58 100644
--- a/src/libs/tracing/timelineselectionrenderpass.cpp
+++ b/src/libs/tracing/timelineselectionrenderpass.cpp
@@ -74,7 +74,7 @@ TimelineRenderPass::State *TimelineSelectionRenderPass::update(
TimelineSelectionRenderPassState *state;
- if (oldState == 0)
+ if (oldState == nullptr)
state = new TimelineSelectionRenderPassState;
else
state = static_cast<TimelineSelectionRenderPassState *>(oldState);
@@ -153,7 +153,7 @@ TimelineSelectionRenderPass::TimelineSelectionRenderPass()
}
TimelineSelectionRenderPassState::TimelineSelectionRenderPassState() :
- m_expandedOverlay(0), m_collapsedOverlay(0)
+ m_expandedOverlay(nullptr), m_collapsedOverlay(nullptr)
{
m_expandedOverlay = createSelectionNode(&m_material);
m_collapsedOverlay = createSelectionNode(&m_material);
diff --git a/src/libs/utils/qrcparser.cpp b/src/libs/utils/qrcparser.cpp
index 21904d3716..dcb704abc4 100644
--- a/src/libs/utils/qrcparser.cpp
+++ b/src/libs/utils/qrcparser.cpp
@@ -74,12 +74,12 @@ public:
QrcParserPrivate(QrcParser *q);
bool parseFile(const QString &path, const QString &contents);
QString firstFileAtPath(const QString &path, const QLocale &locale) const;
- void collectFilesAtPath(const QString &path, QStringList *res, const QLocale *locale = 0) const;
- bool hasDirAtPath(const QString &path, const QLocale *locale = 0) const;
+ void collectFilesAtPath(const QString &path, QStringList *res, const QLocale *locale = nullptr) const;
+ bool hasDirAtPath(const QString &path, const QLocale *locale = nullptr) const;
void collectFilesInPath(const QString &path, QMap<QString,QStringList> *res, bool addDirs = false,
- const QLocale *locale = 0) const;
+ const QLocale *locale = nullptr) const;
void collectResourceFilesForSourceFile(const QString &sourceFile, QStringList *res,
- const QLocale *locale = 0) const;
+ const QLocale *locale = nullptr) const;
QStringList errorMessages() const;
QStringList languages() const;
@@ -487,7 +487,7 @@ QrcParser::Ptr QrcCachePrivate::addPath(const QString &path, const QString &cont
QPair<QrcParser::Ptr,int> currentValue;
{
QMutexLocker l(&m_mutex);
- currentValue = m_cache.value(path, {QrcParser::Ptr(0), 0});
+ currentValue = m_cache.value(path, {QrcParser::Ptr(nullptr), 0});
currentValue.second += 1;
if (currentValue.second > 1) {
m_cache.insert(path, currentValue);
@@ -499,7 +499,7 @@ QrcParser::Ptr QrcCachePrivate::addPath(const QString &path, const QString &cont
qCWarning(qrcParserLog) << "adding invalid qrc " << path << " to the cache:" << newParser->errorMessages();
{
QMutexLocker l(&m_mutex);
- QPair<QrcParser::Ptr,int> currentValue = m_cache.value(path, {QrcParser::Ptr(0), 0});
+ QPair<QrcParser::Ptr,int> currentValue = m_cache.value(path, {QrcParser::Ptr(nullptr), 0});
if (currentValue.first.isNull())
currentValue.first = newParser;
currentValue.second += 1;
@@ -513,7 +513,7 @@ void QrcCachePrivate::removePath(const QString &path)
QPair<QrcParser::Ptr,int> currentValue;
{
QMutexLocker l(&m_mutex);
- currentValue = m_cache.value(path, {QrcParser::Ptr(0), 0});
+ currentValue = m_cache.value(path, {QrcParser::Ptr(nullptr), 0});
if (currentValue.second == 1) {
m_cache.remove(path);
} else if (currentValue.second > 1) {
@@ -530,7 +530,7 @@ QrcParser::Ptr QrcCachePrivate::updatePath(const QString &path, const QString &c
QrcParser::Ptr newParser = QrcParser::parseQrcFile(path, contents);
{
QMutexLocker l(&m_mutex);
- QPair<QrcParser::Ptr,int> currentValue = m_cache.value(path, {QrcParser::Ptr(0), 0});
+ QPair<QrcParser::Ptr,int> currentValue = m_cache.value(path, {QrcParser::Ptr(nullptr), 0});
currentValue.first = newParser;
if (currentValue.second == 0)
currentValue.second = 1; // add qrc files that are not in the resources of a project
@@ -542,7 +542,7 @@ QrcParser::Ptr QrcCachePrivate::updatePath(const QString &path, const QString &c
QrcParser::Ptr QrcCachePrivate::parsedPath(const QString &path)
{
QMutexLocker l(&m_mutex);
- QPair<QrcParser::Ptr,int> currentValue = m_cache.value(path, {QrcParser::Ptr(0), 0});
+ QPair<QrcParser::Ptr,int> currentValue = m_cache.value(path, {QrcParser::Ptr(nullptr), 0});
return currentValue.first;
}
diff --git a/src/libs/utils/qrcparser.h b/src/libs/utils/qrcparser.h
index b5a7be761b..49e1f9e924 100644
--- a/src/libs/utils/qrcparser.h
+++ b/src/libs/utils/qrcparser.h
@@ -48,12 +48,12 @@ public:
~QrcParser();
bool parseFile(const QString &path, const QString &contents);
QString firstFileAtPath(const QString &path, const QLocale &locale) const;
- void collectFilesAtPath(const QString &path, QStringList *res, const QLocale *locale = 0) const;
- bool hasDirAtPath(const QString &path, const QLocale *locale = 0) const;
+ void collectFilesAtPath(const QString &path, QStringList *res, const QLocale *locale = nullptr) const;
+ bool hasDirAtPath(const QString &path, const QLocale *locale = nullptr) const;
void collectFilesInPath(const QString &path, QMap<QString,QStringList> *res, bool addDirs = false,
- const QLocale *locale = 0) const;
+ const QLocale *locale = nullptr) const;
void collectResourceFilesForSourceFile(const QString &sourceFile, QStringList *results,
- const QLocale *locale = 0) const;
+ const QLocale *locale = nullptr) const;
QStringList errorMessages() const;
QStringList languages() const;
diff --git a/src/libs/utils/savefile.cpp b/src/libs/utils/savefile.cpp
index b25432a280..8d07603ad8 100644
--- a/src/libs/utils/savefile.cpp
+++ b/src/libs/utils/savefile.cpp
@@ -207,15 +207,15 @@ void SaveFile::initializeUmask()
mode_t mask = umask(0); // get current umask
umask(mask); // set it back
- m_umask = ((mask & S_IRUSR) ? QFile::ReadOwner : QFlags<QFile::Permission>(0))
- | ((mask & S_IWUSR) ? QFile::WriteOwner : QFlags<QFile::Permission>(0))
- | ((mask & S_IXUSR) ? QFile::ExeOwner : QFlags<QFile::Permission>(0))
- | ((mask & S_IRGRP) ? QFile::ReadGroup : QFlags<QFile::Permission>(0))
- | ((mask & S_IWGRP) ? QFile::WriteGroup : QFlags<QFile::Permission>(0))
- | ((mask & S_IXGRP) ? QFile::ExeGroup : QFlags<QFile::Permission>(0))
- | ((mask & S_IROTH) ? QFile::ReadOther : QFlags<QFile::Permission>(0))
- | ((mask & S_IWOTH) ? QFile::WriteOther : QFlags<QFile::Permission>(0))
- | ((mask & S_IXOTH) ? QFile::ExeOther : QFlags<QFile::Permission>(0));
+ m_umask = ((mask & S_IRUSR) ? QFile::ReadOwner : QFlags<QFile::Permission>(nullptr))
+ | ((mask & S_IWUSR) ? QFile::WriteOwner : QFlags<QFile::Permission>(nullptr))
+ | ((mask & S_IXUSR) ? QFile::ExeOwner : QFlags<QFile::Permission>(nullptr))
+ | ((mask & S_IRGRP) ? QFile::ReadGroup : QFlags<QFile::Permission>(nullptr))
+ | ((mask & S_IWGRP) ? QFile::WriteGroup : QFlags<QFile::Permission>(nullptr))
+ | ((mask & S_IXGRP) ? QFile::ExeGroup : QFlags<QFile::Permission>(nullptr))
+ | ((mask & S_IROTH) ? QFile::ReadOther : QFlags<QFile::Permission>(nullptr))
+ | ((mask & S_IWOTH) ? QFile::WriteOther : QFlags<QFile::Permission>(nullptr))
+ | ((mask & S_IXOTH) ? QFile::ExeOther : QFlags<QFile::Permission>(nullptr));
#endif
}
diff --git a/src/plugins/bineditor/bineditorwidget.cpp b/src/plugins/bineditor/bineditorwidget.cpp
index 2d17786453..561b133925 100644
--- a/src/plugins/bineditor/bineditorwidget.cpp
+++ b/src/plugins/bineditor/bineditorwidget.cpp
@@ -140,7 +140,7 @@ BinEditorWidget::BinEditorWidget(QWidget *parent)
: QAbstractScrollArea(parent), d(new BinEditorWidgetPrivate(this))
{
m_bytesPerLine = 16;
- m_ieditor = 0;
+ m_ieditor = nullptr;
m_baseAddr = 0;
m_blockSize = 4096;
m_size = 0;
diff --git a/src/plugins/clangrefactoring/clangqueryprojectsfindfilter.cpp b/src/plugins/clangrefactoring/clangqueryprojectsfindfilter.cpp
index 46a18376dd..5e6246ad5e 100644
--- a/src/plugins/clangrefactoring/clangqueryprojectsfindfilter.cpp
+++ b/src/plugins/clangrefactoring/clangqueryprojectsfindfilter.cpp
@@ -119,7 +119,7 @@ bool ClangQueryProjectsFindFilter::showSearchTermInput() const
Core::FindFlags ClangQueryProjectsFindFilter::supportedFindFlags() const
{
- return 0;
+ return nullptr;
}
void ClangQueryProjectsFindFilter::setProjectParts(const std::vector<CppTools::ProjectPart::Ptr> &projectParts)
diff --git a/src/plugins/clangrefactoring/clangqueryprojectsfindfilter.h b/src/plugins/clangrefactoring/clangqueryprojectsfindfilter.h
index c8558e5286..2d36caed2e 100644
--- a/src/plugins/clangrefactoring/clangqueryprojectsfindfilter.h
+++ b/src/plugins/clangrefactoring/clangqueryprojectsfindfilter.h
@@ -62,7 +62,7 @@ public:
bool isEnabled() const override;
void requestSourceRangesAndDiagnostics(const QString &queryText, const QString &exampleContent);
SearchHandle *find(const QString &queryText);
- void findAll(const QString &queryText, Core::FindFlags findFlags = 0) override;
+ void findAll(const QString &queryText, Core::FindFlags findFlags = nullptr) override;
bool showSearchTermInput() const override;
Core::FindFlags supportedFindFlags() const override;
diff --git a/src/plugins/clangrefactoring/qtcreatorclangqueryfindfilter.h b/src/plugins/clangrefactoring/qtcreatorclangqueryfindfilter.h
index aa53cd6fd7..23825c6228 100644
--- a/src/plugins/clangrefactoring/qtcreatorclangqueryfindfilter.h
+++ b/src/plugins/clangrefactoring/qtcreatorclangqueryfindfilter.h
@@ -40,7 +40,7 @@ public:
SearchInterface &m_searchInterface,
RefactoringClient &m_refactoringClient);
- void findAll(const QString &queryText, Core::FindFlags findFlags = 0) override;
+ void findAll(const QString &queryText, Core::FindFlags findFlags = nullptr) override;
void handleQueryOrExampleTextChanged();
diff --git a/src/plugins/clangrefactoring/qtcreatorsearchhandle.cpp b/src/plugins/clangrefactoring/qtcreatorsearchhandle.cpp
index 3cc4a96a44..f4fe42d193 100644
--- a/src/plugins/clangrefactoring/qtcreatorsearchhandle.cpp
+++ b/src/plugins/clangrefactoring/qtcreatorsearchhandle.cpp
@@ -35,7 +35,7 @@ QtCreatorSearchHandle::QtCreatorSearchHandle(Core::SearchResult *searchResult)
: searchResult(searchResult)
{
auto title = QCoreApplication::translate("QtCreatorSearchHandle", "Clang Query");
- Core::ProgressManager::addTask(promise.future(), title, "clang query", 0);
+ Core::ProgressManager::addTask(promise.future(), title, "clang query", nullptr);
}
void QtCreatorSearchHandle::addResult(const QString &fileName,
diff --git a/src/plugins/debugger/breakpoint.cpp b/src/plugins/debugger/breakpoint.cpp
index 5766a77406..d6a05fafc0 100644
--- a/src/plugins/debugger/breakpoint.cpp
+++ b/src/plugins/debugger/breakpoint.cpp
@@ -345,7 +345,7 @@ void BreakpointParameters::updateFromGdbOutput(const GdbMi &bkpt)
QString what = bkpt["what"].data();
if (what.startsWith("*0x")) {
type = WatchpointAtAddress;
- address = what.midRef(1).toULongLong(0, 0);
+ address = what.midRef(1).toULongLong(nullptr, 0);
} else {
type = WatchpointAtExpression;
expression = what;
diff --git a/src/plugins/debugger/shared/backtrace.cpp b/src/plugins/debugger/shared/backtrace.cpp
index df2270e9be..74e69b3143 100644
--- a/src/plugins/debugger/shared/backtrace.cpp
+++ b/src/plugins/debugger/shared/backtrace.cpp
@@ -41,7 +41,7 @@ void dumpBacktrace(int maxdepth)
if (maxdepth == -1)
maxdepth = 200;
#if defined(Q_OS_LINUX)
- void *bt[200] = {0};
+ void *bt[200] = {nullptr};
qDebug() << "BACKTRACE:";
int size = backtrace(bt, sizeof(bt) / sizeof(bt[0]));
for (int i = 0; i < qMin(size, maxdepth); i++)
diff --git a/src/plugins/designer/editordata.h b/src/plugins/designer/editordata.h
index c4d92f9a41..81904e405e 100644
--- a/src/plugins/designer/editordata.h
+++ b/src/plugins/designer/editordata.h
@@ -36,7 +36,7 @@ namespace Internal {
class EditorData
{
public:
- explicit operator bool() const { return formWindowEditor != 0; }
+ explicit operator bool() const { return formWindowEditor != nullptr; }
FormWindowEditor *formWindowEditor = nullptr;
SharedTools::WidgetHost *widgetHost = nullptr;
diff --git a/src/plugins/designer/formeditorstack.cpp b/src/plugins/designer/formeditorstack.cpp
index df602dda46..f109138cb3 100644
--- a/src/plugins/designer/formeditorstack.cpp
+++ b/src/plugins/designer/formeditorstack.cpp
@@ -65,7 +65,7 @@ FormEditorStack::~FormEditorStack()
void FormEditorStack::add(const EditorData &data)
{
- if (m_designerCore == 0) { // Initialize first time here
+ if (m_designerCore == nullptr) { // Initialize first time here
m_designerCore = data.widgetHost->formWindow()->core();
connect(m_designerCore->formWindowManager(), &QDesignerFormWindowManagerInterface::activeFormWindowChanged,
this, &FormEditorStack::updateFormWindowSelectionHandles);
@@ -128,7 +128,7 @@ EditorData FormEditorStack::activeEditor() const
SharedTools::WidgetHost *FormEditorStack::formWindowEditorForFormWindow(const QDesignerFormWindowInterface *fw) const
{
const int i = indexOfFormWindow(fw);
- return i != -1 ? m_formEditors[i].widgetHost : static_cast<SharedTools::WidgetHost *>(0);
+ return i != -1 ? m_formEditors[i].widgetHost : static_cast<SharedTools::WidgetHost *>(nullptr);
}
void FormEditorStack::removeFormWindowEditor(QObject *xmlEditor)
@@ -183,7 +183,7 @@ void FormEditorStack::formSizeChanged(int w, int h)
SharedTools::WidgetHost *FormEditorStack::formWindowEditorForXmlEditor(const Core::IEditor *xmlEditor) const
{
const int i = indexOfFormEditor(xmlEditor);
- return i != -1 ? m_formEditors.at(i).widgetHost : static_cast<SharedTools::WidgetHost *>(0);
+ return i != -1 ? m_formEditors.at(i).widgetHost : static_cast<SharedTools::WidgetHost *>(nullptr);
}
void FormEditorStack::modeAboutToChange(Core::Id mode)
diff --git a/src/plugins/designer/formeditorw.cpp b/src/plugins/designer/formeditorw.cpp
index 09e89beed0..c210bdd9e4 100644
--- a/src/plugins/designer/formeditorw.cpp
+++ b/src/plugins/designer/formeditorw.cpp
@@ -229,7 +229,7 @@ static FormEditorData *d = nullptr;
static FormEditorW *m_instance = nullptr;
FormEditorData::FormEditorData() :
- m_formeditor(QDesignerComponents::createFormEditor(0)),
+ m_formeditor(QDesignerComponents::createFormEditor(nullptr)),
m_initStage(FormEditorW::RegisterPlugins)
{
if (Designer::Constants::Internal::debug)
@@ -238,7 +238,7 @@ FormEditorData::FormEditorData() :
d = this;
std::fill(m_designerSubWindows, m_designerSubWindows + DesignerSubWindowCount,
- static_cast<QWidget *>(0));
+ static_cast<QWidget *>(nullptr));
m_formeditor->setTopLevel(ICore::mainWindow());
m_formeditor->setSettingsManager(new SettingsManager());
@@ -352,7 +352,7 @@ void FormEditorData::setupViewActions()
void FormEditorData::fullInit()
{
QTC_ASSERT(m_initStage == FormEditorW::RegisterPlugins, return);
- QElapsedTimer *initTime = 0;
+ QElapsedTimer *initTime = nullptr;
if (Designer::Constants::Internal::debug) {
initTime = new QElapsedTimer;
initTime->start();
@@ -437,32 +437,32 @@ void FormEditorData::fullInit()
void FormEditorData::initDesignerSubWindows()
{
- std::fill(m_designerSubWindows, m_designerSubWindows + DesignerSubWindowCount, static_cast<QWidget*>(0));
+ std::fill(m_designerSubWindows, m_designerSubWindows + DesignerSubWindowCount, static_cast<QWidget*>(nullptr));
- QDesignerWidgetBoxInterface *wb = QDesignerComponents::createWidgetBox(m_formeditor, 0);
+ QDesignerWidgetBoxInterface *wb = QDesignerComponents::createWidgetBox(m_formeditor, nullptr);
wb->setWindowTitle(tr("Widget Box"));
wb->setObjectName("WidgetBox");
m_formeditor->setWidgetBox(wb);
m_designerSubWindows[WidgetBoxSubWindow] = wb;
- QDesignerObjectInspectorInterface *oi = QDesignerComponents::createObjectInspector(m_formeditor, 0);
+ QDesignerObjectInspectorInterface *oi = QDesignerComponents::createObjectInspector(m_formeditor, nullptr);
oi->setWindowTitle(tr("Object Inspector"));
oi->setObjectName("ObjectInspector");
m_formeditor->setObjectInspector(oi);
m_designerSubWindows[ObjectInspectorSubWindow] = oi;
- QDesignerPropertyEditorInterface *pe = QDesignerComponents::createPropertyEditor(m_formeditor, 0);
+ QDesignerPropertyEditorInterface *pe = QDesignerComponents::createPropertyEditor(m_formeditor, nullptr);
pe->setWindowTitle(tr("Property Editor"));
pe->setObjectName("PropertyEditor");
m_formeditor->setPropertyEditor(pe);
m_designerSubWindows[PropertyEditorSubWindow] = pe;
- QWidget *se = QDesignerComponents::createSignalSlotEditor(m_formeditor, 0);
+ QWidget *se = QDesignerComponents::createSignalSlotEditor(m_formeditor, nullptr);
se->setWindowTitle(tr("Signals && Slots Editor"));
se->setObjectName("SignalsAndSlotsEditor");
m_designerSubWindows[SignalSlotEditorSubWindow] = se;
- QDesignerActionEditorInterface *ae = QDesignerComponents::createActionEditor(m_formeditor, 0);
+ QDesignerActionEditorInterface *ae = QDesignerComponents::createActionEditor(m_formeditor, nullptr);
ae->setWindowTitle(tr("Action Editor"));
ae->setObjectName("ActionEditor");
m_formeditor->setActionEditor(ae);
@@ -641,7 +641,7 @@ void FormEditorData::setupActions()
QObject::connect(m_fwm, &QDesignerFormWindowManagerInterface::activeFormWindowChanged,
[this] (QDesignerFormWindowInterface *afw) {
m_fwm->closeAllPreviews();
- setPreviewMenuEnabled(afw != 0);
+ setPreviewMenuEnabled(afw != nullptr);
});
}
@@ -770,11 +770,11 @@ IEditor *FormEditorData::createEditor()
qDebug() << "FormEditorW::createEditor";
// Create and associate form and text editor.
m_fwm->closeAllPreviews();
- QDesignerFormWindowInterface *form = m_fwm->createFormWindow(0);
- QTC_ASSERT(form, return 0);
+ QDesignerFormWindowInterface *form = m_fwm->createFormWindow(nullptr);
+ QTC_ASSERT(form, return nullptr);
QObject::connect(form, &QDesignerFormWindowInterface::toolChanged, [this] (int i) { toolChanged(i); });
- SharedTools::WidgetHost *widgetHost = new SharedTools::WidgetHost( /* parent */ 0, form);
+ SharedTools::WidgetHost *widgetHost = new SharedTools::WidgetHost( /* parent */ nullptr, form);
FormWindowEditor *formWindowEditor = m_xmlEditorFactory->create(form);
m_editorWidget->add(widgetHost, formWindowEditor);
@@ -806,7 +806,7 @@ SharedTools::WidgetHost *FormEditorW::activeWidgetHost()
ensureInitStage(FullyInitialized);
if (d->m_editorWidget)
return d->m_editorWidget->activeEditor().widgetHost;
- return 0;
+ return nullptr;
}
FormWindowEditor *FormEditorW::activeEditor()
@@ -814,7 +814,7 @@ FormWindowEditor *FormEditorW::activeEditor()
ensureInitStage(FullyInitialized);
if (d->m_editorWidget)
return d->m_editorWidget->activeEditor().formWindowEditor;
- return 0;
+ return nullptr;
}
void FormEditorData::updateShortcut(Command *command)
diff --git a/src/plugins/designer/formtemplatewizardpage.cpp b/src/plugins/designer/formtemplatewizardpage.cpp
index 89c3efcd0e..3387ec6395 100644
--- a/src/plugins/designer/formtemplatewizardpage.cpp
+++ b/src/plugins/designer/formtemplatewizardpage.cpp
@@ -58,7 +58,7 @@ Utils::WizardPage *FormPageFactory::create(ProjectExplorer::JsonWizard *wizard,
Q_UNUSED(wizard)
Q_UNUSED(data)
- QTC_ASSERT(canCreate(typeId), return 0);
+ QTC_ASSERT(canCreate(typeId), return nullptr);
FormTemplateWizardPage *page = new FormTemplateWizardPage;
return page;
diff --git a/src/plugins/designer/formwindoweditor.cpp b/src/plugins/designer/formwindoweditor.cpp
index ac2ddc06ca..b75bad127f 100644
--- a/src/plugins/designer/formwindoweditor.cpp
+++ b/src/plugins/designer/formwindoweditor.cpp
@@ -50,7 +50,7 @@ FormWindowEditor::~FormWindowEditor()
QWidget *FormWindowEditor::toolBar()
{
- return 0;
+ return nullptr;
}
QString FormWindowEditor::contents() const
diff --git a/src/plugins/designer/formwindowfile.cpp b/src/plugins/designer/formwindowfile.cpp
index f84b9e197b..2a3b77df5d 100644
--- a/src/plugins/designer/formwindowfile.cpp
+++ b/src/plugins/designer/formwindowfile.cpp
@@ -286,7 +286,7 @@ void FormWindowFile::slotFormWindowRemoved(QDesignerFormWindowInterface *w)
// as calls to isDirty() are triggered at arbitrary times
// while building.
if (w == m_formWindow)
- m_formWindow = 0;
+ m_formWindow = nullptr;
}
} // namespace Internal
diff --git a/src/plugins/designer/qtcreatorintegration.cpp b/src/plugins/designer/qtcreatorintegration.cpp
index f4d6cb4b9b..4a760ff65e 100644
--- a/src/plugins/designer/qtcreatorintegration.cpp
+++ b/src/plugins/designer/qtcreatorintegration.cpp
@@ -114,7 +114,7 @@ QWidget *QtCreatorIntegration::containerWindow(QWidget * /*widget*/) const
{
if (SharedTools::WidgetHost *host = FormEditorW::activeWidgetHost())
return host->integrationContainer();
- return 0;
+ return nullptr;
}
static QList<Document::Ptr> findDocumentsIncluding(const Snapshot &docTable,
@@ -212,7 +212,7 @@ static const Class *findClass(const Namespace *parentNameSpace, const LookupCont
} // member is namespave
} // member is no class
} // for members
- return 0;
+ return nullptr;
}
static Function *findDeclaration(const Class *cl, const QString &functionName)
@@ -242,7 +242,7 @@ static Function *findDeclaration(const Class *cl, const QString &functionName)
return fun;
}
}
- return 0;
+ return nullptr;
}
// TODO: remove me, this is taken from cppeditor.cpp. Find some common place for this function
@@ -555,7 +555,7 @@ bool QtCreatorIntegration::navigateToSlot(const QString &objectName,
// Find the class definition (ui class defined as member or base class)
// in the file itself or in the directly included files (order 1).
QString namespaceName;
- const Class *cl = 0;
+ const Class *cl = nullptr;
Document::Ptr doc;
for (const Document::Ptr &d : qAsConst(docMap)) {
diff --git a/src/plugins/designer/settingspage.cpp b/src/plugins/designer/settingspage.cpp
index 4dfa8bc550..3b92fbba63 100644
--- a/src/plugins/designer/settingspage.cpp
+++ b/src/plugins/designer/settingspage.cpp
@@ -48,7 +48,7 @@ QWidget *SettingsPage::widget()
{
m_initialized = true;
if (!m_widget)
- m_widget = m_designerPage->createPage(0);
+ m_widget = m_designerPage->createPage(nullptr);
return m_widget;
}
diff --git a/src/plugins/modeleditor/modeleditor.cpp b/src/plugins/modeleditor/modeleditor.cpp
index 8e68152189..08facc1c48 100644
--- a/src/plugins/modeleditor/modeleditor.cpp
+++ b/src/plugins/modeleditor/modeleditor.cpp
@@ -449,7 +449,7 @@ void ModelEditor::initDocument()
qmt::MDiagram *ModelEditor::currentDiagram() const
{
if (!d->diagramView->diagramSceneModel())
- return 0;
+ return nullptr;
return d->diagramView->diagramSceneModel()->diagram();
}
@@ -1241,7 +1241,7 @@ void ModelEditor::closeCurrentDiagram(bool addToHistory)
if (addToHistory)
addToNavigationHistory(diagram);
d->diagramStack->setCurrentWidget(d->noDiagramLabel);
- d->diagramView->setDiagramSceneModel(0);
+ d->diagramView->setDiagramSceneModel(nullptr);
diagramsManager->unbindDiagramSceneModel(diagram);
}
}
@@ -1255,7 +1255,7 @@ void ModelEditor::closeDiagram(const qmt::MDiagram *diagram)
if (sceneModel && diagram == sceneModel->diagram()) {
addToNavigationHistory(diagram);
d->diagramStack->setCurrentWidget(d->noDiagramLabel);
- d->diagramView->setDiagramSceneModel(0);
+ d->diagramView->setDiagramSceneModel(nullptr);
diagramsManager->unbindDiagramSceneModel(diagram);
}
}
diff --git a/src/plugins/projectexplorer/devicesupport/localprocesslist.cpp b/src/plugins/projectexplorer/devicesupport/localprocesslist.cpp
index 832cbd5246..24d692dd28 100644
--- a/src/plugins/projectexplorer/devicesupport/localprocesslist.cpp
+++ b/src/plugins/projectexplorer/devicesupport/localprocesslist.cpp
@@ -165,7 +165,7 @@ static QList<DeviceProcessItem> getLocalProcessesUsingPs()
psProcess.start(QLatin1String("ps"), args);
if (psProcess.waitForStarted()) {
QByteArray output;
- if (Utils::SynchronousProcess::readDataFromProcess(psProcess, 30000, &output, 0, false)) {
+ if (Utils::SynchronousProcess::readDataFromProcess(psProcess, 30000, &output, nullptr, false)) {
// Split "457 /Users/foo.app arg1 arg2"
const QStringList lines = QString::fromLocal8Bit(output).split(QLatin1Char('\n'));
const int lineCount = lines.size();
diff --git a/src/plugins/projectexplorer/devicesupport/sshsettingspage.h b/src/plugins/projectexplorer/devicesupport/sshsettingspage.h
index e43ef93826..3c6167bba7 100644
--- a/src/plugins/projectexplorer/devicesupport/sshsettingspage.h
+++ b/src/plugins/projectexplorer/devicesupport/sshsettingspage.h
@@ -39,7 +39,7 @@ class SshSettingsPage : public Core::IOptionsPage
Q_OBJECT
public:
- SshSettingsPage(QObject *parent = 0);
+ SshSettingsPage(QObject *parent = nullptr);
private:
QWidget *widget() override;
diff --git a/src/plugins/qmlpreview/qmlpreviewfileontargetfinder.h b/src/plugins/qmlpreview/qmlpreviewfileontargetfinder.h
index e62396b8cf..d3b30c5ada 100644
--- a/src/plugins/qmlpreview/qmlpreviewfileontargetfinder.h
+++ b/src/plugins/qmlpreview/qmlpreviewfileontargetfinder.h
@@ -42,8 +42,8 @@ public:
void setTarget(ProjectExplorer::Target *target);
ProjectExplorer::Target *target() const;
- QString findPath(const QString &filePath, bool *success = 0) const;
- QUrl findUrl(const QString &filePath, bool *success = 0) const;
+ QString findPath(const QString &filePath, bool *success = nullptr) const;
+ QUrl findUrl(const QString &filePath, bool *success = nullptr) const;
private:
QPointer<ProjectExplorer::Target> m_target;
diff --git a/src/plugins/qtsupport/qscxmlcgenerator.h b/src/plugins/qtsupport/qscxmlcgenerator.h
index 37c7617ed6..f7d8d1f28f 100644
--- a/src/plugins/qtsupport/qscxmlcgenerator.h
+++ b/src/plugins/qtsupport/qscxmlcgenerator.h
@@ -38,7 +38,7 @@ class QScxmlcGenerator : public ProjectExplorer::ProcessExtraCompiler
Q_OBJECT
public:
QScxmlcGenerator(const ProjectExplorer::Project *project, const Utils::FilePath &source,
- const Utils::FilePathList &targets, QObject *parent = 0);
+ const Utils::FilePathList &targets, QObject *parent = nullptr);
protected:
Utils::FilePath command() const override;
@@ -60,7 +60,7 @@ class QScxmlcGeneratorFactory : public ProjectExplorer::ExtraCompilerFactory
{
Q_OBJECT
public:
- QScxmlcGeneratorFactory(QObject *parent = 0) : ExtraCompilerFactory(parent) {}
+ QScxmlcGeneratorFactory(QObject *parent = nullptr) : ExtraCompilerFactory(parent) {}
ProjectExplorer::FileType sourceType() const override;
diff --git a/src/plugins/qtsupport/qtoptionspage.cpp b/src/plugins/qtsupport/qtoptionspage.cpp
index 58dace5d84..baab24860c 100644
--- a/src/plugins/qtsupport/qtoptionspage.cpp
+++ b/src/plugins/qtsupport/qtoptionspage.cpp
@@ -142,7 +142,7 @@ public:
}
private:
- BaseQtVersion *m_version = 0;
+ BaseQtVersion *m_version = nullptr;
QIcon m_icon;
QString m_buildLog;
bool m_changed = false;
@@ -153,7 +153,7 @@ private:
///
QtOptionsPage::QtOptionsPage()
- : m_widget(0)
+ : m_widget(nullptr)
{
setId(Constants::QTVERSION_SETTINGS_PAGE_ID);
setDisplayName(QCoreApplication::translate("QtSupport", "Qt Versions"));
@@ -190,7 +190,7 @@ QtOptionsPageWidget::QtOptionsPageWidget(QWidget *parent)
, m_infoBrowser(new QTextBrowser)
, m_invalidVersionIcon(Utils::Icons::CRITICAL.icon())
, m_warningVersionIcon(Utils::Icons::WARNING.icon())
- , m_configurationWidget(0)
+ , m_configurationWidget(nullptr)
{
QWidget *versionInfoWidget = new QWidget();
m_versionUi->setupUi(versionInfoWidget);
@@ -277,7 +277,7 @@ BaseQtVersion *QtOptionsPageWidget::currentVersion() const
{
QtVersionItem *item = currentItem();
if (!item)
- return 0;
+ return nullptr;
return item->version();
}
@@ -307,7 +307,7 @@ void QtOptionsPageWidget::cleanUpQtVersions()
return;
- if (QMessageBox::warning(0, tr("Remove Invalid Qt Versions"),
+ if (QMessageBox::warning(nullptr, tr("Remove Invalid Qt Versions"),
tr("Do you want to remove all invalid Qt Versions?<br>"
"<ul><li>%1</li></ul><br>"
"will be removed.").arg(text),
@@ -468,7 +468,7 @@ void QtOptionsPageWidget::updateVersionItem(QtVersionItem *item)
// Non-modal dialog
class BuildLogDialog : public QDialog {
public:
- explicit BuildLogDialog(QWidget *parent = 0);
+ explicit BuildLogDialog(QWidget *parent = nullptr);
void setText(const QString &text);
private:
@@ -674,7 +674,7 @@ void QtOptionsPageWidget::userChangedCurrentVersion()
void QtOptionsPageWidget::updateDescriptionLabel()
{
QtVersionItem *item = currentItem();
- const BaseQtVersion *version = item ? item->version() : 0;
+ const BaseQtVersion *version = item ? item->version() : nullptr;
const ValidityInfo info = validInformation(version);
if (info.message.isEmpty()) {
m_versionUi->errorLabel->setVisible(false);
@@ -707,7 +707,7 @@ void QtOptionsPageWidget::versionChanged(const QModelIndex &current, const QMode
void QtOptionsPageWidget::updateWidgets()
{
delete m_configurationWidget;
- m_configurationWidget = 0;
+ m_configurationWidget = nullptr;
BaseQtVersion *version = currentVersion();
if (version) {
m_versionUi->nameEdit->setText(version->unexpandedDisplayName());
@@ -724,7 +724,7 @@ void QtOptionsPageWidget::updateWidgets()
m_versionUi->qmakePath->clear();
}
- const bool enabled = version != 0;
+ const bool enabled = version != nullptr;
const bool isAutodetected = enabled && version->isAutodetected();
m_ui->delButton->setEnabled(enabled && !isAutodetected);
m_versionUi->nameEdit->setEnabled(enabled);
diff --git a/src/plugins/qtsupport/qtoptionspage.h b/src/plugins/qtsupport/qtoptionspage.h
index 04af543355..ece24c4b51 100644
--- a/src/plugins/qtsupport/qtoptionspage.h
+++ b/src/plugins/qtsupport/qtoptionspage.h
@@ -60,7 +60,7 @@ class QtOptionsPageWidget : public QWidget
Q_OBJECT
public:
- QtOptionsPageWidget(QWidget *parent = 0);
+ QtOptionsPageWidget(QWidget *parent = nullptr);
~QtOptionsPageWidget();
void apply();
diff --git a/src/plugins/qtsupport/qtversionfactory.cpp b/src/plugins/qtsupport/qtversionfactory.cpp
index 4560667d8f..8c05bb6bcb 100644
--- a/src/plugins/qtsupport/qtversionfactory.cpp
+++ b/src/plugins/qtsupport/qtversionfactory.cpp
@@ -76,7 +76,7 @@ BaseQtVersion *QtVersionFactory::createQtVersionFromQMakePath(const Utils::FileP
QHash<ProKey, ProString> versionInfo;
if (!BaseQtVersion::queryQMakeVariables(qmakePath, Utils::Environment::systemEnvironment(),
&versionInfo, error))
- return 0;
+ return nullptr;
Utils::FilePath mkspec = BaseQtVersion::mkspecFromVersionInfo(versionInfo);
QMakeVfs vfs;
@@ -118,7 +118,7 @@ BaseQtVersion *QtVersionFactory::createQtVersionFromQMakePath(const Utils::FileP
*error = QCoreApplication::translate("QtSupport::QtVersionFactory",
"No factory found for qmake: \"%1\"").arg(qmakePath.toUserOutput());
}
- return 0;
+ return nullptr;
}
BaseQtVersion *QtVersionFactory::create() const
diff --git a/src/plugins/qtsupport/uicgenerator.h b/src/plugins/qtsupport/uicgenerator.h
index e1c7f013d0..66237eb622 100644
--- a/src/plugins/qtsupport/uicgenerator.h
+++ b/src/plugins/qtsupport/uicgenerator.h
@@ -37,7 +37,7 @@ class UicGenerator : public ProjectExplorer::ProcessExtraCompiler
Q_OBJECT
public:
UicGenerator(const ProjectExplorer::Project *project, const Utils::FilePath &source,
- const Utils::FilePathList &targets, QObject *parent = 0);
+ const Utils::FilePathList &targets, QObject *parent = nullptr);
protected:
Utils::FilePath command() const override;
@@ -50,7 +50,7 @@ class UicGeneratorFactory : public ProjectExplorer::ExtraCompilerFactory
{
Q_OBJECT
public:
- UicGeneratorFactory(QObject *parent = 0) : ExtraCompilerFactory(parent) {}
+ UicGeneratorFactory(QObject *parent = nullptr) : ExtraCompilerFactory(parent) {}
ProjectExplorer::FileType sourceType() const override;
diff --git a/src/plugins/resourceeditor/qrceditor/resourceview.cpp b/src/plugins/resourceeditor/qrceditor/resourceview.cpp
index 081bf4bf5d..8e2c70ad79 100644
--- a/src/plugins/resourceeditor/qrceditor/resourceview.cpp
+++ b/src/plugins/resourceeditor/qrceditor/resourceview.cpp
@@ -197,7 +197,7 @@ void ResourceView::refresh()
{
m_qrcModel->refresh();
QModelIndex idx = currentIndex();
- setModel(0);
+ setModel(nullptr);
setModel(m_qrcModel);
setCurrentIndex(idx);
expandAll();
diff --git a/src/plugins/valgrind/callgrind/callgrinddatamodel.cpp b/src/plugins/valgrind/callgrind/callgrinddatamodel.cpp
index 611c1634af..b64ee8764d 100644
--- a/src/plugins/valgrind/callgrind/callgrinddatamodel.cpp
+++ b/src/plugins/valgrind/callgrind/callgrinddatamodel.cpp
@@ -240,7 +240,7 @@ QVariant DataModel::data(const QModelIndex &index, int role) const
}
}
ret += entry.arg(tr("Object:")).arg(func->object());
- ret += entry.arg(tr("Called:")).arg(tr("%n time(s)", 0, func->called()));
+ ret += entry.arg(tr("Called:")).arg(tr("%n time(s)", nullptr, func->called()));
ret += "</dl><p/>";
// self/inclusive costs
diff --git a/src/plugins/valgrind/callgrind/callgrindparser.cpp b/src/plugins/valgrind/callgrind/callgrindparser.cpp
index c80a30b99b..e966452d47 100644
--- a/src/plugins/valgrind/callgrind/callgrindparser.cpp
+++ b/src/plugins/valgrind/callgrind/callgrindparser.cpp
@@ -224,7 +224,7 @@ void Parser::Private::parse(QIODevice *device)
// functions that need to accumulate their calees
QSet<Function *> pendingFunctions;
foreach (const CallData &callData, pendingCallees) {
- Function *calledFunction = 0;
+ Function *calledFunction = nullptr;
QTC_ASSERT(callData.call, continue);
QTC_ASSERT(callData.call->caller(), continue);
foreach (const Function *function, functionLookup.value(callData.calledFunction)) {
diff --git a/src/plugins/vcsbase/wizard/vcscommandpage.cpp b/src/plugins/vcsbase/wizard/vcscommandpage.cpp
index c08077e902..0e725e6ef2 100644
--- a/src/plugins/vcsbase/wizard/vcscommandpage.cpp
+++ b/src/plugins/vcsbase/wizard/vcscommandpage.cpp
@@ -73,7 +73,7 @@ WizardPage *VcsCommandPageFactory::create(JsonWizard *wizard, Id typeId, const Q
{
Q_UNUSED(wizard)
- QTC_ASSERT(canCreate(typeId), return 0);
+ QTC_ASSERT(canCreate(typeId), return nullptr);
QVariantMap tmp = data.toMap();
@@ -89,7 +89,7 @@ WizardPage *VcsCommandPageFactory::create(JsonWizard *wizard, Id typeId, const Q
} else if (argsVar.type() == QVariant::List) {
args = Utils::transform(argsVar.toList(), &QVariant::toString);
} else {
- return 0;
+ return nullptr;
}
}
diff --git a/src/plugins/vcsbase/wizard/vcsconfigurationpage.cpp b/src/plugins/vcsbase/wizard/vcsconfigurationpage.cpp
index 894d1155ba..2f6c1c3598 100644
--- a/src/plugins/vcsbase/wizard/vcsconfigurationpage.cpp
+++ b/src/plugins/vcsbase/wizard/vcsconfigurationpage.cpp
@@ -80,11 +80,11 @@ Utils::WizardPage *VcsConfigurationPageFactory::create(JsonWizard *wizard, Id ty
{
Q_UNUSED(wizard)
- QTC_ASSERT(canCreate(typeId), return 0);
+ QTC_ASSERT(canCreate(typeId), return nullptr);
QVariantMap tmp = data.toMap();
const QString vcsId = tmp.value(QLatin1String("vcsId")).toString();
- QTC_ASSERT(!vcsId.isEmpty(), return 0);
+ QTC_ASSERT(!vcsId.isEmpty(), return nullptr);
auto page = new VcsConfigurationPage;
page->setVersionControlId(vcsId);
@@ -129,7 +129,7 @@ VcsConfigurationPage::VcsConfigurationPage() : d(new Internal::VcsConfigurationP
{
setTitle(tr("Configuration"));
- d->m_versionControl = 0;
+ d->m_versionControl = nullptr;
d->m_configureButton = new QPushButton(ICore::msgShowOptionsDialog(), this);
d->m_configureButton->setEnabled(false);
@@ -151,7 +151,7 @@ void VcsConfigurationPage::setVersionControl(const IVersionControl *vc)
d->m_versionControlId = vc->id().toString();
else
d->m_versionControlId.clear();
- d->m_versionControl = 0;
+ d->m_versionControl = nullptr;
}
void VcsConfigurationPage::setVersionControlId(const QString &id)
diff --git a/src/plugins/winrt/winrtdevice.cpp b/src/plugins/winrt/winrtdevice.cpp
index c49ef19d95..f537aa5f57 100644
--- a/src/plugins/winrt/winrtdevice.cpp
+++ b/src/plugins/winrt/winrtdevice.cpp
@@ -359,10 +359,10 @@ void WinRtDeviceFactory::parseRunnerOutput(const QByteArray &output) const
<< internalName << ")";
}
}
- QString message = tr("Found %n Windows Runtime devices.", 0, numFound);
+ QString message = tr("Found %n Windows Runtime devices.", nullptr, numFound);
if (const int numNew = numFound - numSkipped) {
message += QLatin1Char(' ');
- message += tr("%n of them are new.", 0, numNew);
+ message += tr("%n of them are new.", nullptr, numNew);
}
MessageManager::write(message);
}
diff --git a/src/tools/clangbackend/source/clangtranslationunitupdater.cpp b/src/tools/clangbackend/source/clangtranslationunitupdater.cpp
index fdad057089..b70f828d8f 100644
--- a/src/tools/clangbackend/source/clangtranslationunitupdater.cpp
+++ b/src/tools/clangbackend/source/clangtranslationunitupdater.cpp
@@ -113,7 +113,7 @@ void TranslationUnitUpdater::createTranslationUnitIfNeeded()
UnsavedFilesShallowArguments unsaved = m_in.unsavedFiles.shallowArguments();
m_parseErrorCode = clang_parseTranslationUnit2(m_cxIndex,
- NULL,
+ nullptr,
args.data(),
args.count(),
unsaved.data(),
diff --git a/src/tools/clangbackend/source/utf8positionfromlinecolumn.h b/src/tools/clangbackend/source/utf8positionfromlinecolumn.h
index f07a9f33b4..22f5b7ff54 100644
--- a/src/tools/clangbackend/source/utf8positionfromlinecolumn.h
+++ b/src/tools/clangbackend/source/utf8positionfromlinecolumn.h
@@ -45,10 +45,10 @@ private:
bool advanceCodePoint(bool stopOnNewLine = false);
private:
- const char * const m_utf8Text = 0;
+ const char * const m_utf8Text = nullptr;
- const char *m_previousByte = 0;
- const char *m_currentByte = 0;
+ const char *m_previousByte = nullptr;
+ const char *m_currentByte = nullptr;
};
} // namespace ClangBackEnd
diff --git a/src/tools/sdktool/settings.cpp b/src/tools/sdktool/settings.cpp
index 01f5120e16..971e9f47ea 100644
--- a/src/tools/sdktool/settings.cpp
+++ b/src/tools/sdktool/settings.cpp
@@ -33,7 +33,7 @@
#include <QCoreApplication>
#include <QDir>
-Settings *Settings::m_instance = 0;
+Settings *Settings::m_instance = nullptr;
Settings *Settings::instance()
{
@@ -41,7 +41,7 @@ Settings *Settings::instance()
}
Settings::Settings() :
- operation(0)
+ operation(nullptr)
{
Q_ASSERT(!m_instance);
m_instance = this;
diff --git a/src/tools/valgrindfake/outputgenerator.cpp b/src/tools/valgrindfake/outputgenerator.cpp
index 4aec9ae9e1..d851eb1769 100644
--- a/src/tools/valgrindfake/outputgenerator.cpp
+++ b/src/tools/valgrindfake/outputgenerator.cpp
@@ -45,7 +45,7 @@ void doSleep(int msec) { ::Sleep(msec); }
void doSleep(int msec)
{
struct timespec ts = {msec / 1000, (msec % 1000) * 1000000};
- ::nanosleep(&ts, NULL);
+ ::nanosleep(&ts, nullptr);
}
#endif