Some clang-tidy -use-modernize-nullptr

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

View File

@@ -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);