aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4scopedvalue_p.h
diff options
context:
space:
mode:
authorErik Verbruggen <erik.verbruggen@qt.io>2016-12-01 15:16:02 +0100
committerErik Verbruggen <erik.verbruggen@qt.io>2016-12-01 14:51:35 +0000
commit2c85acb0865ff4dc3682bbc4894216c5b058d89e (patch)
tree0bf97bf3420661f8bfef852c73d35c1c67dc3ef2 /src/qml/jsruntime/qv4scopedvalue_p.h
parentf9044963096c2876dbf2e33f85d9e8946db5df90 (diff)
V4: Scoped<T>::operator-> will always return a T*
There is no need to do a Value::cast, because that is already done in the constructors and in the assignment operators. Change-Id: I65b896c1eae91bf63ead3762437c35aea504ac62 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/jsruntime/qv4scopedvalue_p.h')
-rw-r--r--src/qml/jsruntime/qv4scopedvalue_p.h11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/qml/jsruntime/qv4scopedvalue_p.h b/src/qml/jsruntime/qv4scopedvalue_p.h
index 164fbb2997..4e627e003f 100644
--- a/src/qml/jsruntime/qv4scopedvalue_p.h
+++ b/src/qml/jsruntime/qv4scopedvalue_p.h
@@ -298,11 +298,11 @@ struct Scoped
}
T *operator->() {
- return ptr->cast<T>();
+ return getPointer();
}
const T *operator->() const {
- return ptr->cast<T>();
+ return getPointer();
}
bool operator!() const {
@@ -313,8 +313,13 @@ struct Scoped
}
T *getPointer() {
- return ptr->cast<T>();
+ return reinterpret_cast<T *>(ptr);
}
+
+ const T *getPointer() const {
+ return reinterpret_cast<T *>(ptr);
+ }
+
Value *getRef() {
return ptr;
}