From ac8d2f1fae0eb60f0ea5b21dee1ce6c5806ddc95 Mon Sep 17 00:00:00 2001 From: Jacek Caban Date: Tue, 7 Sep 2010 15:42:01 +0200 Subject: [PATCH] jscript: jsdisp_t to IDispatch casts clean up. --- dlls/jscript/dispex.c | 2 +- dlls/jscript/engine.c | 10 +++++----- dlls/jscript/function.c | 6 +++--- dlls/jscript/jscript.c | 4 ++-- dlls/jscript/jsutils.c | 8 ++++---- dlls/jscript/regexp.c | 2 +- 6 files changed, 16 insertions(+), 16 deletions(-) diff --git a/dlls/jscript/dispex.c b/dlls/jscript/dispex.c index 9739aa8373c..be8967a1154 100644 --- a/dlls/jscript/dispex.c +++ b/dlls/jscript/dispex.c @@ -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)); - hres = set_this(&new_dp, dp, (IDispatch*)_IDispatchEx_(jsthis)); + hres = set_this(&new_dp, dp, to_disp(jsthis)); if(FAILED(hres)) return hres; diff --git a/dlls/jscript/engine.c b/dlls/jscript/engine.c index 0556d69b8e0..4bd4bfd2489 100644 --- a/dlls/jscript/engine.c +++ b/dlls/jscript/engine.c @@ -194,7 +194,7 @@ HRESULT create_exec_ctx(script_ctx_t *script_ctx, IDispatch *this_obj, jsdisp_t else if(script_ctx->host_global) ctx->this_obj = script_ctx->host_global; else - ctx->this_obj = (IDispatch*)_IDispatchEx_(script_ctx->global); + ctx->this_obj = to_disp(script_ctx->global); IDispatch_AddRef(ctx->this_obj); IDispatchEx_AddRef(_IDispatchEx_(var_disp)); @@ -517,13 +517,13 @@ static HRESULT identifier_eval(exec_ctx_t *ctx, BSTR identifier, DWORD flags, js } if(scope) { - exprval_set_idref(ret, (IDispatch*)_IDispatchEx_(scope->obj), id); + exprval_set_idref(ret, to_disp(scope->obj), id); return S_OK; } hres = jsdisp_get_id(ctx->parser->script->global, identifier, 0, &id); 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; } @@ -566,7 +566,7 @@ static HRESULT identifier_eval(exec_ctx_t *ctx, BSTR identifier, DWORD flags, js if(FAILED(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; } @@ -2017,7 +2017,7 @@ static HRESULT instanceof_eval(exec_ctx_t *ctx, VARIANT *inst, VARIANT *objv, js if(V_VT(inst) == VT_DISPATCH) tmp = iface_to_jsdisp((IUnknown*)V_DISPATCH(inst)); 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)) break; if(b) { diff --git a/dlls/jscript/function.c b/dlls/jscript/function.c index 8b5638d0a7d..56cd2b27bf8 100644 --- a/dlls/jscript/function.c +++ b/dlls/jscript/function.c @@ -196,7 +196,7 @@ static HRESULT invoke_source(script_ctx_t *ctx, FunctionInstance *function, IDis return E_FAIL; } - hres = create_arguments(ctx, (IDispatch*)_IDispatchEx_(&function->dispex), + hres = create_arguments(ctx, to_disp(&function->dispex), dp, ei, caller, &arg_disp); if(FAILED(hres)) return hres; @@ -239,7 +239,7 @@ static HRESULT invoke_constructor(script_ctx_t *ctx, FunctionInstance *function, if(FAILED(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)) { jsdisp_release(this_obj); return hres; @@ -793,7 +793,7 @@ static HRESULT construct_function(script_ctx_t *ctx, DISPPARAMS *dp, jsexcept_t if(FAILED(hres)) return hres; - *ret = (IDispatch*)_IDispatchEx_(function); + *ret = to_disp(function); return S_OK; } diff --git a/dlls/jscript/jscript.c b/dlls/jscript/jscript.c index 3b15818821e..079db3d2ae0 100644 --- a/dlls/jscript/jscript.c +++ b/dlls/jscript/jscript.c @@ -558,7 +558,7 @@ static HRESULT WINAPI JScript_GetScriptDispatch(IActiveScript *iface, LPCOLESTR return E_UNEXPECTED; } - *ppdisp = (IDispatch*)_IDispatchEx_(This->ctx->global); + *ppdisp = to_disp(This->ctx->global); IDispatch_AddRef(*ppdisp); return S_OK; } @@ -779,7 +779,7 @@ static HRESULT WINAPI JScriptParseProcedure_ParseProcedureText(IActiveScriptPars if(FAILED(hres)) return hres; - *ppdisp = (IDispatch*)_IDispatchEx_(dispex); + *ppdisp = to_disp(dispex); return S_OK; } diff --git a/dlls/jscript/jsutils.c b/dlls/jscript/jsutils.c index 602a1a88a8f..3024f3b0d08 100644 --- a/dlls/jscript/jsutils.c +++ b/dlls/jscript/jsutils.c @@ -602,7 +602,7 @@ HRESULT to_object(script_ctx_t *ctx, VARIANT *v, IDispatch **disp) if(FAILED(hres)) return hres; - *disp = (IDispatch*)_IDispatchEx_(dispex); + *disp = to_disp(dispex); break; case VT_I4: case VT_R8: @@ -610,7 +610,7 @@ HRESULT to_object(script_ctx_t *ctx, VARIANT *v, IDispatch **disp) if(FAILED(hres)) return hres; - *disp = (IDispatch*)_IDispatchEx_(dispex); + *disp = to_disp(dispex); break; case VT_DISPATCH: if(V_DISPATCH(v)) { @@ -623,7 +623,7 @@ HRESULT to_object(script_ctx_t *ctx, VARIANT *v, IDispatch **disp) if(FAILED(hres)) return hres; - *disp = (IDispatch*)_IDispatchEx_(obj); + *disp = to_disp(obj); } break; case VT_BOOL: @@ -631,7 +631,7 @@ HRESULT to_object(script_ctx_t *ctx, VARIANT *v, IDispatch **disp) if(FAILED(hres)) return hres; - *disp = (IDispatch*)_IDispatchEx_(dispex); + *disp = to_disp(dispex); break; default: FIXME("unsupported vt %d\n", V_VT(v)); diff --git a/dlls/jscript/regexp.c b/dlls/jscript/regexp.c index 82a0a94cad3..5d751444d5a 100644 --- a/dlls/jscript/regexp.c +++ b/dlls/jscript/regexp.c @@ -3638,7 +3638,7 @@ static HRESULT create_match_array(script_ctx_t *ctx, BSTR input, const match_res return hres; } - *ret = (IDispatch*)_IDispatchEx_(array); + *ret = to_disp(array); return S_OK; } -- 2.11.4.GIT