From f43928f6023f435dfe3e600dd4474cd2c7a92e16 Mon Sep 17 00:00:00 2001 From: Oleg Shparber Date: Fri, 28 Nov 2014 01:19:11 -0800 Subject: Add default parameter value for ScopedCallData() Change-Id: I16b6662a47c682e145d3e2201f9e90f58405a599 Reviewed-by: Simon Hausmann --- src/qml/jsruntime/qv4dateobject.cpp | 2 +- src/qml/jsruntime/qv4functionobject.cpp | 2 +- src/qml/jsruntime/qv4object.cpp | 2 +- src/qml/jsruntime/qv4objectproto.cpp | 2 +- src/qml/jsruntime/qv4scopedvalue_p.h | 2 +- src/qml/jsruntime/qv4script.cpp | 2 +- src/qml/qml/qqmljavascriptexpression.cpp | 2 +- src/qml/qml/qqmlxmlhttprequest.cpp | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/qml/jsruntime/qv4dateobject.cpp b/src/qml/jsruntime/qv4dateobject.cpp index 811d2f0acb..6455219881 100644 --- a/src/qml/jsruntime/qv4dateobject.cpp +++ b/src/qml/jsruntime/qv4dateobject.cpp @@ -1311,7 +1311,7 @@ ReturnedValue DatePrototype::method_toJSON(CallContext *ctx) if (!toIso) return ctx->engine()->throwTypeError(); - ScopedCallData callData(scope, 0); + ScopedCallData callData(scope); callData->thisObject = ctx->d()->callData->thisObject; return toIso->call(callData); } diff --git a/src/qml/jsruntime/qv4functionobject.cpp b/src/qml/jsruntime/qv4functionobject.cpp index 42e0f5389d..db2f236f3b 100644 --- a/src/qml/jsruntime/qv4functionobject.cpp +++ b/src/qml/jsruntime/qv4functionobject.cpp @@ -169,7 +169,7 @@ ReturnedValue FunctionObject::name() ReturnedValue FunctionObject::newInstance() { Scope scope(internalClass()->engine); - ScopedCallData callData(scope, 0); + ScopedCallData callData(scope); return construct(callData); } diff --git a/src/qml/jsruntime/qv4object.cpp b/src/qml/jsruntime/qv4object.cpp index 70152274e4..7ec0c8208c 100644 --- a/src/qml/jsruntime/qv4object.cpp +++ b/src/qml/jsruntime/qv4object.cpp @@ -89,7 +89,7 @@ ReturnedValue Object::getValue(const ValueRef thisObject, const Property *p, Pro return Encode::undefined(); Scope scope(getter->engine()); - ScopedCallData callData(scope, 0); + ScopedCallData callData(scope); callData->thisObject = *thisObject; return getter->call(callData); } diff --git a/src/qml/jsruntime/qv4objectproto.cpp b/src/qml/jsruntime/qv4objectproto.cpp index 090bc32c93..a4e6b5f49b 100644 --- a/src/qml/jsruntime/qv4objectproto.cpp +++ b/src/qml/jsruntime/qv4objectproto.cpp @@ -408,7 +408,7 @@ ReturnedValue ObjectPrototype::method_toLocaleString(CallContext *ctx) Scoped f(scope, o->get(ctx->d()->engine->id_toString)); if (!f) return ctx->engine()->throwTypeError(); - ScopedCallData callData(scope, 0); + ScopedCallData callData(scope); callData->thisObject = o; return f->call(callData); } diff --git a/src/qml/jsruntime/qv4scopedvalue_p.h b/src/qml/jsruntime/qv4scopedvalue_p.h index f9a21d706a..1276ca3370 100644 --- a/src/qml/jsruntime/qv4scopedvalue_p.h +++ b/src/qml/jsruntime/qv4scopedvalue_p.h @@ -362,7 +362,7 @@ struct Scoped }; struct ScopedCallData { - ScopedCallData(Scope &scope, int argc) + ScopedCallData(Scope &scope, int argc = 0) { int size = qMax(argc, (int)QV4::Global::ReservedArgumentCount) + qOffsetOf(QV4::CallData, args)/sizeof(QV4::Value); ptr = reinterpret_cast(scope.engine->stackPush(size)); diff --git a/src/qml/jsruntime/qv4script.cpp b/src/qml/jsruntime/qv4script.cpp index 3c68cdd433..34daafefdf 100644 --- a/src/qml/jsruntime/qv4script.cpp +++ b/src/qml/jsruntime/qv4script.cpp @@ -306,7 +306,7 @@ ReturnedValue Script::run() } else { ScopedObject qmlObj(valueScope, qml.value()); ScopedFunctionObject f(valueScope, engine->memoryManager->alloc(scope, vmFunction, qmlObj)); - ScopedCallData callData(valueScope, 0); + ScopedCallData callData(valueScope); callData->thisObject = Primitive::undefinedValue(); return f->call(callData); } diff --git a/src/qml/qml/qqmljavascriptexpression.cpp b/src/qml/qml/qqmljavascriptexpression.cpp index dad90b77f2..42b10ddc1a 100644 --- a/src/qml/qml/qqmljavascriptexpression.cpp +++ b/src/qml/qml/qqmljavascriptexpression.cpp @@ -110,7 +110,7 @@ QV4::ReturnedValue QQmlJavaScriptExpression::evaluate(QQmlContextData *context, { QV4::ExecutionEngine *v4 = QV8Engine::getV4(context->engine); QV4::Scope scope(v4); - QV4::ScopedCallData callData(scope, 0); + QV4::ScopedCallData callData(scope); return evaluate(context, function, callData, isUndefined); } diff --git a/src/qml/qml/qqmlxmlhttprequest.cpp b/src/qml/qml/qqmlxmlhttprequest.cpp index 4b26778008..a19376db68 100644 --- a/src/qml/qml/qqmlxmlhttprequest.cpp +++ b/src/qml/qml/qqmlxmlhttprequest.cpp @@ -1568,7 +1568,7 @@ void QQmlXMLHttpRequest::dispatchCallbackImpl(const ValueRef me) QQmlContextData *callingContext = QmlContextWrapper::getContext(activationObject); if (callingContext) { - QV4::ScopedCallData callData(scope, 0); + QV4::ScopedCallData callData(scope); callData->thisObject = activationObject.asReturnedValue(); callback->call(callData); } -- cgit v1.2.3