aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2017-08-15 12:33:04 +0200
committerSimon Hausmann <simon.hausmann@qt.io>2017-08-23 10:45:04 +0000
commitdf102ad1b548653bb9d6e072452e49578723f518 (patch)
tree915c93cbf284d86478bfd707796ef1c79047dd99 /src
parent43472c1e8218ed692aaf3bb32c325d018e6a4527 (diff)
Clean up void * usage
Don't use void * in our internals, when we can simply pass a typed pointer. Change-Id: Id02033c7e66df7e041c079d3546f9dd6027ef8d5 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/qml/qml/qqmlcontext.cpp2
-rw-r--r--src/qml/qml/qqmlcontext_p.h5
-rw-r--r--src/qml/qml/qqmlincubator.cpp8
-rw-r--r--src/qml/qml/qqmlobjectcreator.cpp9
-rw-r--r--src/qml/qml/qqmlobjectcreator_p.h5
5 files changed, 16 insertions, 13 deletions
diff --git a/src/qml/qml/qqmlcontext.cpp b/src/qml/qml/qqmlcontext.cpp
index 1476c276f4..531d9ae457 100644
--- a/src/qml/qml/qqmlcontext.cpp
+++ b/src/qml/qml/qqmlcontext.cpp
@@ -523,7 +523,7 @@ QQmlContextData::QQmlContextData()
QQmlContextData::QQmlContextData(QQmlContext *ctxt)
: parent(0), engine(0), isInternal(false), ownedByParent(false), isJSContext(false),
isPragmaLibraryContext(false), unresolvedNames(false), hasEmittedDestruction(false), isRootObjectInCreation(false),
- publicContext(ctxt), activeVMEData(0), componentObjectIndex(-1),
+ publicContext(ctxt), incubator(0), componentObjectIndex(-1),
contextObject(0), childContexts(0), nextChild(0), prevChild(0),
expressions(0), contextObjects(0), contextGuards(0), idValues(0), idValueCount(0), linkedContext(0),
componentAttached(0)
diff --git a/src/qml/qml/qqmlcontext_p.h b/src/qml/qml/qqmlcontext_p.h
index 4d2bb72352..a259fd62d8 100644
--- a/src/qml/qml/qqmlcontext_p.h
+++ b/src/qml/qml/qqmlcontext_p.h
@@ -78,6 +78,7 @@ class QQmlExpression;
class QQmlExpressionPrivate;
class QQmlJavaScriptExpression;
class QQmlContextData;
+class QQmlIncubatorPrivate;
class QQmlContextPrivate : public QObjectPrivate
{
@@ -145,8 +146,8 @@ public:
quint32 dummy:25;
QQmlContext *publicContext;
- // VME data that is constructing this context if any
- void *activeVMEData;
+ // The incubator that is constructing this context if any
+ QQmlIncubatorPrivate *incubator;
// Compilation unit for contexts that belong to a compiled type.
QQmlRefPointer<QV4::CompiledData::CompilationUnit> typeCompilationUnit;
diff --git a/src/qml/qml/qqmlincubator.cpp b/src/qml/qml/qqmlincubator.cpp
index 54d0b240f5..f8bc134147 100644
--- a/src/qml/qml/qqmlincubator.cpp
+++ b/src/qml/qml/qqmlincubator.cpp
@@ -64,8 +64,8 @@ void QQmlEnginePrivate::incubate(QQmlIncubator &i, QQmlContextData *forContext)
QExplicitlySharedDataPointer<QQmlIncubatorPrivate> parentIncubator;
QQmlContextData *cctxt = forContext;
while (cctxt) {
- if (cctxt->activeVMEData) {
- parentIncubator = (QQmlIncubatorPrivate *)cctxt->activeVMEData;
+ if (cctxt->incubator) {
+ parentIncubator = cctxt->incubator;
break;
}
cctxt = cctxt->parent;
@@ -152,7 +152,7 @@ void QQmlIncubatorPrivate::clear()
}
enginePriv = 0;
if (!rootContext.isNull()) {
- rootContext->activeVMEData = 0;
+ rootContext->incubator = 0;
rootContext = 0;
}
@@ -388,7 +388,7 @@ void QQmlIncubatorPrivate::cancel(QObject *object, QQmlContext *context)
return;
QQmlContextData *data = QQmlContextData::get(context);
- QQmlIncubatorPrivate *p = (QQmlIncubatorPrivate *)data->activeVMEData;
+ QQmlIncubatorPrivate *p = data->incubator;
if (!p)
return;
diff --git a/src/qml/qml/qqmlobjectcreator.cpp b/src/qml/qml/qqmlobjectcreator.cpp
index 45f7c5333a..b34c2ea5e6 100644
--- a/src/qml/qml/qqmlobjectcreator.cpp
+++ b/src/qml/qml/qqmlobjectcreator.cpp
@@ -70,14 +70,15 @@ struct ActiveOCRestorer
};
}
-QQmlObjectCreator::QQmlObjectCreator(QQmlContextData *parentContext, QV4::CompiledData::CompilationUnit *compilationUnit, QQmlContextData *creationContext, void *activeVMEDataForRootContext)
+QQmlObjectCreator::QQmlObjectCreator(QQmlContextData *parentContext, QV4::CompiledData::CompilationUnit *compilationUnit, QQmlContextData *creationContext,
+ QQmlIncubatorPrivate *incubator)
: phase(Startup)
, compilationUnit(compilationUnit)
, resolvedTypes(compilationUnit->resolvedTypes)
, propertyCaches(&compilationUnit->propertyCaches)
, sharedState(new QQmlObjectCreatorSharedState)
, topLevelCreator(true)
- , activeVMEDataForRootContext(activeVMEDataForRootContext)
+ , incubator(incubator)
{
init(parentContext);
@@ -104,7 +105,7 @@ QQmlObjectCreator::QQmlObjectCreator(QQmlContextData *parentContext, QV4::Compil
, propertyCaches(&compilationUnit->propertyCaches)
, sharedState(inheritedSharedState)
, topLevelCreator(false)
- , activeVMEDataForRootContext(0)
+ , incubator(0)
{
init(parentContext);
}
@@ -176,7 +177,7 @@ QObject *QQmlObjectCreator::create(int subComponentIndex, QObject *parent, QQmlI
if (!sharedState->rootContext) {
sharedState->rootContext = context;
- sharedState->rootContext->activeVMEData = activeVMEDataForRootContext;
+ sharedState->rootContext->incubator = incubator;
sharedState->rootContext->isRootObjectInCreation = true;
}
diff --git a/src/qml/qml/qqmlobjectcreator_p.h b/src/qml/qml/qqmlobjectcreator_p.h
index 982324be3c..a62825e19e 100644
--- a/src/qml/qml/qqmlobjectcreator_p.h
+++ b/src/qml/qml/qqmlobjectcreator_p.h
@@ -65,6 +65,7 @@ QT_BEGIN_NAMESPACE
class QQmlAbstractBinding;
struct QQmlTypeCompiler;
class QQmlInstantiationInterrupt;
+class QQmlIncubatorPrivate;
struct QQmlObjectCreatorSharedState : public QSharedData
{
@@ -84,7 +85,7 @@ class QQmlObjectCreator
{
Q_DECLARE_TR_FUNCTIONS(QQmlObjectCreator)
public:
- QQmlObjectCreator(QQmlContextData *parentContext, QV4::CompiledData::CompilationUnit *compilationUnit, QQmlContextData *creationContext, void *activeVMEDataForRootContext = 0);
+ QQmlObjectCreator(QQmlContextData *parentContext, QV4::CompiledData::CompilationUnit *compilationUnit, QQmlContextData *creationContext, QQmlIncubatorPrivate *incubator = 0);
~QQmlObjectCreator();
QObject *create(int subComponentIndex = -1, QObject *parent = 0, QQmlInstantiationInterrupt *interrupt = 0);
@@ -143,7 +144,7 @@ private:
const QQmlPropertyCacheVector *propertyCaches;
QExplicitlySharedDataPointer<QQmlObjectCreatorSharedState> sharedState;
bool topLevelCreator;
- void *activeVMEDataForRootContext;
+ QQmlIncubatorPrivate *incubator;
QObject *_qobject;
QObject *_scopeObject;