Commit ac8d2f1f authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

jscript: jsdisp_t to IDispatch casts clean up.

parent 2ae0f440
...@@ -285,7 +285,7 @@ static HRESULT invoke_prop_func(jsdisp_t *This, jsdisp_t *jsthis, dispex_prop_t ...@@ -285,7 +285,7 @@ static HRESULT invoke_prop_func(jsdisp_t *This, jsdisp_t *jsthis, dispex_prop_t
TRACE("call %s %p\n", debugstr_w(prop->name), V_DISPATCH(&prop->u.var)); TRACE("call %s %p\n", debugstr_w(prop->name), V_DISPATCH(&prop->u.var));
hres = set_this(&new_dp, dp, (IDispatch*)_IDispatchEx_(jsthis)); hres = set_this(&new_dp, dp, to_disp(jsthis));
if(FAILED(hres)) if(FAILED(hres))
return hres; return hres;
......
...@@ -194,7 +194,7 @@ HRESULT create_exec_ctx(script_ctx_t *script_ctx, IDispatch *this_obj, jsdisp_t ...@@ -194,7 +194,7 @@ HRESULT create_exec_ctx(script_ctx_t *script_ctx, IDispatch *this_obj, jsdisp_t
else if(script_ctx->host_global) else if(script_ctx->host_global)
ctx->this_obj = script_ctx->host_global; ctx->this_obj = script_ctx->host_global;
else else
ctx->this_obj = (IDispatch*)_IDispatchEx_(script_ctx->global); ctx->this_obj = to_disp(script_ctx->global);
IDispatch_AddRef(ctx->this_obj); IDispatch_AddRef(ctx->this_obj);
IDispatchEx_AddRef(_IDispatchEx_(var_disp)); IDispatchEx_AddRef(_IDispatchEx_(var_disp));
...@@ -517,13 +517,13 @@ static HRESULT identifier_eval(exec_ctx_t *ctx, BSTR identifier, DWORD flags, js ...@@ -517,13 +517,13 @@ static HRESULT identifier_eval(exec_ctx_t *ctx, BSTR identifier, DWORD flags, js
} }
if(scope) { if(scope) {
exprval_set_idref(ret, (IDispatch*)_IDispatchEx_(scope->obj), id); exprval_set_idref(ret, to_disp(scope->obj), id);
return S_OK; return S_OK;
} }
hres = jsdisp_get_id(ctx->parser->script->global, identifier, 0, &id); hres = jsdisp_get_id(ctx->parser->script->global, identifier, 0, &id);
if(SUCCEEDED(hres)) { if(SUCCEEDED(hres)) {
exprval_set_idref(ret, (IDispatch*)_IDispatchEx_(ctx->parser->script->global), id); exprval_set_idref(ret, to_disp(ctx->parser->script->global), id);
return S_OK; return S_OK;
} }
...@@ -566,7 +566,7 @@ static HRESULT identifier_eval(exec_ctx_t *ctx, BSTR identifier, DWORD flags, js ...@@ -566,7 +566,7 @@ static HRESULT identifier_eval(exec_ctx_t *ctx, BSTR identifier, DWORD flags, js
if(FAILED(hres)) if(FAILED(hres))
return hres; return hres;
exprval_set_idref(ret, (IDispatch*)_IDispatchEx_(ctx->parser->script->global), id); exprval_set_idref(ret, to_disp(ctx->parser->script->global), id);
return S_OK; return S_OK;
} }
...@@ -2017,7 +2017,7 @@ static HRESULT instanceof_eval(exec_ctx_t *ctx, VARIANT *inst, VARIANT *objv, js ...@@ -2017,7 +2017,7 @@ static HRESULT instanceof_eval(exec_ctx_t *ctx, VARIANT *inst, VARIANT *objv, js
if(V_VT(inst) == VT_DISPATCH) if(V_VT(inst) == VT_DISPATCH)
tmp = iface_to_jsdisp((IUnknown*)V_DISPATCH(inst)); tmp = iface_to_jsdisp((IUnknown*)V_DISPATCH(inst));
for(iter = tmp; iter; iter = iter->prototype) { for(iter = tmp; iter; iter = iter->prototype) {
hres = disp_cmp(V_DISPATCH(&var), (IDispatch*)_IDispatchEx_(iter), &b); hres = disp_cmp(V_DISPATCH(&var), to_disp(iter), &b);
if(FAILED(hres)) if(FAILED(hres))
break; break;
if(b) { if(b) {
......
...@@ -196,7 +196,7 @@ static HRESULT invoke_source(script_ctx_t *ctx, FunctionInstance *function, IDis ...@@ -196,7 +196,7 @@ static HRESULT invoke_source(script_ctx_t *ctx, FunctionInstance *function, IDis
return E_FAIL; return E_FAIL;
} }
hres = create_arguments(ctx, (IDispatch*)_IDispatchEx_(&function->dispex), hres = create_arguments(ctx, to_disp(&function->dispex),
dp, ei, caller, &arg_disp); dp, ei, caller, &arg_disp);
if(FAILED(hres)) if(FAILED(hres))
return hres; return hres;
...@@ -239,7 +239,7 @@ static HRESULT invoke_constructor(script_ctx_t *ctx, FunctionInstance *function, ...@@ -239,7 +239,7 @@ static HRESULT invoke_constructor(script_ctx_t *ctx, FunctionInstance *function,
if(FAILED(hres)) if(FAILED(hres))
return hres; return hres;
hres = invoke_source(ctx, function, (IDispatch*)_IDispatchEx_(this_obj), dp, &var, ei, caller); hres = invoke_source(ctx, function, to_disp(this_obj), dp, &var, ei, caller);
if(FAILED(hres)) { if(FAILED(hres)) {
jsdisp_release(this_obj); jsdisp_release(this_obj);
return hres; return hres;
...@@ -793,7 +793,7 @@ static HRESULT construct_function(script_ctx_t *ctx, DISPPARAMS *dp, jsexcept_t ...@@ -793,7 +793,7 @@ static HRESULT construct_function(script_ctx_t *ctx, DISPPARAMS *dp, jsexcept_t
if(FAILED(hres)) if(FAILED(hres))
return hres; return hres;
*ret = (IDispatch*)_IDispatchEx_(function); *ret = to_disp(function);
return S_OK; return S_OK;
} }
......
...@@ -558,7 +558,7 @@ static HRESULT WINAPI JScript_GetScriptDispatch(IActiveScript *iface, LPCOLESTR ...@@ -558,7 +558,7 @@ static HRESULT WINAPI JScript_GetScriptDispatch(IActiveScript *iface, LPCOLESTR
return E_UNEXPECTED; return E_UNEXPECTED;
} }
*ppdisp = (IDispatch*)_IDispatchEx_(This->ctx->global); *ppdisp = to_disp(This->ctx->global);
IDispatch_AddRef(*ppdisp); IDispatch_AddRef(*ppdisp);
return S_OK; return S_OK;
} }
...@@ -779,7 +779,7 @@ static HRESULT WINAPI JScriptParseProcedure_ParseProcedureText(IActiveScriptPars ...@@ -779,7 +779,7 @@ static HRESULT WINAPI JScriptParseProcedure_ParseProcedureText(IActiveScriptPars
if(FAILED(hres)) if(FAILED(hres))
return hres; return hres;
*ppdisp = (IDispatch*)_IDispatchEx_(dispex); *ppdisp = to_disp(dispex);
return S_OK; return S_OK;
} }
......
...@@ -602,7 +602,7 @@ HRESULT to_object(script_ctx_t *ctx, VARIANT *v, IDispatch **disp) ...@@ -602,7 +602,7 @@ HRESULT to_object(script_ctx_t *ctx, VARIANT *v, IDispatch **disp)
if(FAILED(hres)) if(FAILED(hres))
return hres; return hres;
*disp = (IDispatch*)_IDispatchEx_(dispex); *disp = to_disp(dispex);
break; break;
case VT_I4: case VT_I4:
case VT_R8: case VT_R8:
...@@ -610,7 +610,7 @@ HRESULT to_object(script_ctx_t *ctx, VARIANT *v, IDispatch **disp) ...@@ -610,7 +610,7 @@ HRESULT to_object(script_ctx_t *ctx, VARIANT *v, IDispatch **disp)
if(FAILED(hres)) if(FAILED(hres))
return hres; return hres;
*disp = (IDispatch*)_IDispatchEx_(dispex); *disp = to_disp(dispex);
break; break;
case VT_DISPATCH: case VT_DISPATCH:
if(V_DISPATCH(v)) { if(V_DISPATCH(v)) {
...@@ -623,7 +623,7 @@ HRESULT to_object(script_ctx_t *ctx, VARIANT *v, IDispatch **disp) ...@@ -623,7 +623,7 @@ HRESULT to_object(script_ctx_t *ctx, VARIANT *v, IDispatch **disp)
if(FAILED(hres)) if(FAILED(hres))
return hres; return hres;
*disp = (IDispatch*)_IDispatchEx_(obj); *disp = to_disp(obj);
} }
break; break;
case VT_BOOL: case VT_BOOL:
...@@ -631,7 +631,7 @@ HRESULT to_object(script_ctx_t *ctx, VARIANT *v, IDispatch **disp) ...@@ -631,7 +631,7 @@ HRESULT to_object(script_ctx_t *ctx, VARIANT *v, IDispatch **disp)
if(FAILED(hres)) if(FAILED(hres))
return hres; return hres;
*disp = (IDispatch*)_IDispatchEx_(dispex); *disp = to_disp(dispex);
break; break;
default: default:
FIXME("unsupported vt %d\n", V_VT(v)); FIXME("unsupported vt %d\n", V_VT(v));
......
...@@ -3638,7 +3638,7 @@ static HRESULT create_match_array(script_ctx_t *ctx, BSTR input, const match_res ...@@ -3638,7 +3638,7 @@ static HRESULT create_match_array(script_ctx_t *ctx, BSTR input, const match_res
return hres; return hres;
} }
*ret = (IDispatch*)_IDispatchEx_(array); *ret = to_disp(array);
return S_OK; return S_OK;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment