forked from qt-creator/qt-creator
Some clang-tidy -use-modernize-nullptr
Change-Id: I1bed5e85a5b7948d08502a72a10f80baa075c204 Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
This commit is contained in:
@@ -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());
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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 "
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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 ¶meterTypes = 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
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -89,9 +89,9 @@ LineInfo::LineInfo()
|
||||
*/
|
||||
|
||||
// shorthands
|
||||
yyLine = 0;
|
||||
yyBraceDepth = 0;
|
||||
yyLeftBraceFollows = 0;
|
||||
yyLine = nullptr;
|
||||
yyBraceDepth = nullptr;
|
||||
yyLeftBraceFollows = nullptr;
|
||||
}
|
||||
|
||||
LineInfo::~LineInfo()
|
||||
|
||||
@@ -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()) {
|
||||
|
||||
@@ -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'
|
||||
|
||||
@@ -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());
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user