diff options
author | Christian Kamm <christian.d.kamm@nokia.com> | 2011-10-10 10:55:37 +0200 |
---|---|---|
committer | Christian Kamm <christian.d.kamm@nokia.com> | 2011-10-12 10:55:55 +0200 |
commit | 7ed717ca62ab080231d019d8b3e378ebd852be5d (patch) | |
tree | cda330220fb2e7f3fc6afdd8e9d2be0aa77cbb05 /src/libs/qmljs/qmljscheck.cpp | |
parent | 572b3a180b30223aa92678ded7b253051a0a5cb0 (diff) | |
download | qt-creator-7ed717ca62ab080231d019d8b3e378ebd852be5d.tar.gz |
QmlJS: Add more value_casts.
And switch all existing dynamic_casts to value_casts.
Change-Id: I93b89358e4802080f40b332074c64f4e91a2bc4c
Reviewed-on: http://codereview.qt-project.org/6311
Sanity-Review: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@nokia.com>
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@nokia.com>
Diffstat (limited to 'src/libs/qmljs/qmljscheck.cpp')
-rw-r--r-- | src/libs/qmljs/qmljscheck.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/libs/qmljs/qmljscheck.cpp b/src/libs/qmljs/qmljscheck.cpp index 88792c9c02..e3d55efef1 100644 --- a/src/libs/qmljs/qmljscheck.cpp +++ b/src/libs/qmljs/qmljscheck.cpp @@ -81,7 +81,7 @@ public: virtual void visit(const NumberValue *value) { - if (const QmlEnumValue *enumValue = dynamic_cast<const QmlEnumValue *>(value)) { + if (const QmlEnumValue *enumValue = value_cast<QmlEnumValue>(value)) { if (StringLiteral *stringLiteral = cast<StringLiteral *>(_ast)) { const QString valueName = stringLiteral->value.toString(); @@ -643,7 +643,7 @@ void Check::visitQmlObject(Node *ast, UiQualifiedId *typeId, const ObjectValue *lastPrototype = prototypes.last(); if (iter.error() == PrototypeIterator::ReferenceResolutionError) { if (const QmlPrototypeReference *ref = - dynamic_cast<const QmlPrototypeReference *>(lastPrototype->prototype())) { + value_cast<QmlPrototypeReference>(lastPrototype->prototype())) { addMessage(ErrCouldNotResolvePrototypeOf, typeErrorLocation, toString(ref->qmlTypeName()), lastPrototype->className()); } else { @@ -778,7 +778,7 @@ bool Check::visit(IdentifierExpression *) // _lastValue = evaluator.reference(ast); // if (!_lastValue) // addMessage(ErrUnknownIdentifier, ast->identifierToken); -// if (const Reference *ref = value_cast<const Reference *>(_lastValue)) { +// if (const Reference *ref = value_cast<Reference>(_lastValue)) { // _lastValue = _context->lookupReference(ref); // if (!_lastValue) // error(ast->identifierToken, tr("could not resolve")); @@ -1293,7 +1293,7 @@ const Value *Check::checkScopeObjectMember(const UiQualifiedId *id) // member lookup const UiQualifiedId *idPart = id; while (idPart->next) { - const ObjectValue *objectValue = value_cast<const ObjectValue *>(value); + const ObjectValue *objectValue = value_cast<ObjectValue>(value); if (! objectValue) { addMessage(ErrDoesNotHaveMembers, idPart->identifierToken, propertyName); return 0; |