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

jscript: Use IDispatch* as iface_to_jsdisp argument type.

parent e9907520
......@@ -188,7 +188,7 @@ static HRESULT concat_obj(jsdisp_t *array, IDispatch *obj, DWORD *len)
jsdisp_t *jsobj;
HRESULT hres;
jsobj = iface_to_jsdisp((IUnknown*)obj);
jsobj = iface_to_jsdisp(obj);
if(jsobj) {
if(is_class(jsobj, JSCLASS_ARRAY)) {
hres = concat_array(array, (ArrayInstance*)jsobj, len);
......@@ -695,7 +695,7 @@ static HRESULT Array_sort(script_ctx_t *ctx, vdisp_t *vthis, WORD flags, unsigne
return E_FAIL;
}
cmp_func = iface_to_jsdisp((IUnknown*)get_object(argv[0]));
cmp_func = iface_to_jsdisp(get_object(argv[0]));
if(!cmp_func || !is_class(cmp_func, JSCLASS_FUNCTION)) {
WARN("cmp_func is not a function\n");
if(cmp_func)
......
......@@ -1014,7 +1014,7 @@ HRESULT init_dispex_from_constr(jsdisp_t *dispex, script_ctx_t *ctx, const built
}
if(is_object_instance(val))
prot = iface_to_jsdisp((IUnknown*)get_object(val));
prot = iface_to_jsdisp(get_object(val));
jsval_release(val);
}
......@@ -1025,12 +1025,12 @@ HRESULT init_dispex_from_constr(jsdisp_t *dispex, script_ctx_t *ctx, const built
return hres;
}
jsdisp_t *iface_to_jsdisp(IUnknown *iface)
jsdisp_t *iface_to_jsdisp(IDispatch *iface)
{
jsdisp_t *ret;
HRESULT hres;
hres = IUnknown_QueryInterface(iface, &IID_IDispatchJS, (void**)&ret);
hres = IDispatch_QueryInterface(iface, &IID_IDispatchJS, (void**)&ret);
if(FAILED(hres))
return NULL;
......@@ -1114,7 +1114,7 @@ HRESULT disp_call(script_ctx_t *ctx, IDispatch *disp, DISPID id, WORD flags, uns
unsigned i;
HRESULT hres;
jsdisp = iface_to_jsdisp((IUnknown*)disp);
jsdisp = iface_to_jsdisp(disp);
if(jsdisp) {
if(flags & DISPATCH_PROPERTYPUT) {
FIXME("disp_call(propput) on builtin object\n");
......@@ -1207,7 +1207,7 @@ HRESULT disp_call_value(script_ctx_t *ctx, IDispatch *disp, IDispatch *jsthis, W
assert(!(flags & ~(DISPATCH_METHOD|DISPATCH_CONSTRUCT|DISPATCH_JSCRIPT_INTERNAL_MASK)));
jsdisp = iface_to_jsdisp((IUnknown*)disp);
jsdisp = iface_to_jsdisp(disp);
if(jsdisp) {
hres = jsdisp_call_value(jsdisp, jsthis, flags, argc, argv, r);
jsdisp_release(jsdisp);
......@@ -1346,7 +1346,7 @@ HRESULT disp_propput(script_ctx_t *ctx, IDispatch *disp, DISPID id, jsval_t val)
jsdisp_t *jsdisp;
HRESULT hres;
jsdisp = iface_to_jsdisp((IUnknown*)disp);
jsdisp = iface_to_jsdisp(disp);
if(jsdisp) {
dispex_prop_t *prop;
......@@ -1451,7 +1451,7 @@ HRESULT disp_propget(script_ctx_t *ctx, IDispatch *disp, DISPID id, jsval_t *val
VARIANT var;
HRESULT hres;
jsdisp = iface_to_jsdisp((IUnknown*)disp);
jsdisp = iface_to_jsdisp(disp);
if(jsdisp) {
hres = jsdisp_propget(jsdisp, id, val);
jsdisp_release(jsdisp);
......@@ -1502,7 +1502,7 @@ HRESULT disp_delete(IDispatch *disp, DISPID id, BOOL *ret)
jsdisp_t *jsdisp;
HRESULT hres;
jsdisp = iface_to_jsdisp((IUnknown*)disp);
jsdisp = iface_to_jsdisp(disp);
if(jsdisp) {
dispex_prop_t *prop;
......@@ -1538,7 +1538,7 @@ HRESULT disp_delete_name(script_ctx_t *ctx, IDispatch *disp, jsstr_t *name, BOOL
BSTR bstr;
HRESULT hres;
jsdisp = iface_to_jsdisp((IUnknown*)disp);
jsdisp = iface_to_jsdisp(disp);
if(jsdisp) {
dispex_prop_t *prop;
const WCHAR *ptr;
......
......@@ -314,7 +314,7 @@ static HRESULT disp_get_id(script_ctx_t *ctx, IDispatch *disp, const WCHAR *name
BSTR bstr;
HRESULT hres;
jsdisp = iface_to_jsdisp((IUnknown*)disp);
jsdisp = iface_to_jsdisp(disp);
if(jsdisp) {
hres = jsdisp_get_id(jsdisp, name, flags, id);
jsdisp_release(jsdisp);
......@@ -1321,7 +1321,7 @@ static HRESULT interp_instanceof(script_ctx_t *ctx)
return throw_type_error(ctx, JS_E_FUNCTION_EXPECTED, NULL);
}
obj = iface_to_jsdisp((IUnknown*)get_object(v));
obj = iface_to_jsdisp(get_object(v));
IDispatch_Release(get_object(v));
if(!obj) {
FIXME("non-jsdisp objects not supported\n");
......@@ -1341,7 +1341,7 @@ static HRESULT interp_instanceof(script_ctx_t *ctx)
if(is_object_instance(prot)) {
if(is_object_instance(v))
tmp = iface_to_jsdisp((IUnknown*)get_object(v));
tmp = iface_to_jsdisp(get_object(v));
for(iter = tmp; !ret && iter; iter = iter->prototype) {
hres = disp_cmp(get_object(prot), to_disp(iter), &ret);
if(FAILED(hres))
......@@ -1643,7 +1643,7 @@ static HRESULT typeof_string(jsval_t v, const WCHAR **ret)
case JSV_OBJECT: {
jsdisp_t *dispex;
if(get_object(v) && (dispex = iface_to_jsdisp((IUnknown*)get_object(v)))) {
if(get_object(v) && (dispex = iface_to_jsdisp(get_object(v)))) {
*ret = is_class(dispex, JSCLASS_FUNCTION) ? functionW : objectW;
jsdisp_release(dispex);
}else {
......@@ -2587,7 +2587,7 @@ HRESULT exec_source(script_ctx_t *ctx, DWORD flags, bytecode_t *bytecode, functi
if(this_obj) {
jsdisp_t *jsthis;
jsthis = iface_to_jsdisp((IUnknown*)this_obj);
jsthis = iface_to_jsdisp(this_obj);
if(jsthis) {
if(jsthis->builtin_info->class == JSCLASS_GLOBAL || jsthis->builtin_info->class == JSCLASS_NONE)
this_obj = NULL;
......
......@@ -441,7 +441,7 @@ static HRESULT Function_apply(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, un
jsdisp_t *arg_array = NULL;
if(is_object_instance(argv[1])) {
arg_array = iface_to_jsdisp((IUnknown*)get_object(argv[1]));
arg_array = iface_to_jsdisp(get_object(argv[1]));
if(arg_array &&
(!is_class(arg_array, JSCLASS_ARRAY) && !is_class(arg_array, JSCLASS_ARGUMENTS) )) {
jsdisp_release(arg_array);
......
......@@ -128,7 +128,7 @@ typedef enum {
JSCLASS_JSON
} jsclass_t;
jsdisp_t *iface_to_jsdisp(IUnknown*) DECLSPEC_HIDDEN;
jsdisp_t *iface_to_jsdisp(IDispatch*) DECLSPEC_HIDDEN;
typedef struct {
union {
......@@ -170,7 +170,7 @@ static inline void set_disp(vdisp_t *vdisp, IDispatch *disp)
jsdisp_t *jsdisp;
HRESULT hres;
jsdisp = iface_to_jsdisp((IUnknown*)disp);
jsdisp = iface_to_jsdisp(disp);
if(jsdisp) {
vdisp->u.jsdisp = jsdisp;
vdisp->flags = VDISP_JSDISP | VDISP_DISPEX;
......
......@@ -421,7 +421,7 @@ static HRESULT maybe_to_primitive(script_ctx_t *ctx, jsval_t val, jsval_t *r)
jsdisp_t *obj;
HRESULT hres;
if(!is_object_instance(val) || !get_object(val) || !(obj = iface_to_jsdisp((IUnknown*)get_object(val))))
if(!is_object_instance(val) || !get_object(val) || !(obj = iface_to_jsdisp(get_object(val))))
return jsval_copy(val, r);
if(is_class(obj, JSCLASS_NUMBER)) {
......@@ -672,7 +672,7 @@ static HRESULT stringify(stringify_ctx_t *ctx, jsval_t val)
jsdisp_t *obj;
DISPID id;
obj = iface_to_jsdisp((IUnknown*)get_object(val));
obj = iface_to_jsdisp(get_object(val));
if(!obj)
return S_FALSE;
......@@ -730,7 +730,7 @@ static HRESULT stringify(stringify_ctx_t *ctx, jsval_t val)
case JSV_OBJECT: {
jsdisp_t *obj;
obj = iface_to_jsdisp((IUnknown*)get_object(value));
obj = iface_to_jsdisp(get_object(value));
if(!obj) {
hres = S_FALSE;
break;
......
......@@ -704,7 +704,7 @@ HRESULT create_regexp_var(script_ctx_t *ctx, jsval_t src_arg, jsval_t *flags_arg
if(is_object_instance(src_arg)) {
jsdisp_t *obj;
obj = iface_to_jsdisp((IUnknown*)get_object(src_arg));
obj = iface_to_jsdisp(get_object(src_arg));
if(obj) {
if(is_class(obj, JSCLASS_REGEXP)) {
RegExpInstance *regexp = (RegExpInstance*)obj;
......@@ -955,7 +955,7 @@ static HRESULT RegExpConstr_value(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags
case DISPATCH_METHOD:
if(argc) {
if(is_object_instance(argv[0])) {
jsdisp_t *jsdisp = iface_to_jsdisp((IUnknown*)get_object(argv[0]));
jsdisp_t *jsdisp = iface_to_jsdisp(get_object(argv[0]));
if(jsdisp) {
if(is_class(jsdisp, JSCLASS_REGEXP)) {
if(argc > 1 && !is_undefined(argv[1])) {
......
......@@ -392,7 +392,7 @@ HRESULT to_primitive(script_ctx_t *ctx, jsval_t val, jsval_t *ret, hint_t hint)
return S_OK;
}
jsdisp = iface_to_jsdisp((IUnknown*)get_object(val));
jsdisp = iface_to_jsdisp(get_object(val));
if(!jsdisp)
return disp_propget(ctx, get_object(val), DISPID_VALUE, ret);
......
......@@ -636,7 +636,7 @@ static HRESULT String_match(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, unsi
}
if(is_object_instance(argv[0])) {
regexp = iface_to_jsdisp((IUnknown*)get_object(argv[0]));
regexp = iface_to_jsdisp(get_object(argv[0]));
if(regexp && !is_class(regexp, JSCLASS_REGEXP)) {
jsdisp_release(regexp);
regexp = NULL;
......@@ -799,7 +799,7 @@ static HRESULT String_replace(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, un
}
if(is_object_instance(argv[0])) {
regexp = iface_to_jsdisp((IUnknown*)get_object(argv[0]));
regexp = iface_to_jsdisp(get_object(argv[0]));
if(regexp && !is_class(regexp, JSCLASS_REGEXP)) {
jsdisp_release(regexp);
regexp = NULL;
......@@ -816,7 +816,7 @@ static HRESULT String_replace(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, un
if(argc >= 2) {
if(is_object_instance(argv[1])) {
rep_func = iface_to_jsdisp((IUnknown*)get_object(argv[1]));
rep_func = iface_to_jsdisp(get_object(argv[1]));
if(rep_func && !is_class(rep_func, JSCLASS_FUNCTION)) {
jsdisp_release(rep_func);
rep_func = NULL;
......@@ -1017,7 +1017,7 @@ static HRESULT String_search(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, uns
}
if(is_object_instance(argv[0])) {
regexp = iface_to_jsdisp((IUnknown*)get_object(argv[0]));
regexp = iface_to_jsdisp(get_object(argv[0]));
if(regexp && !is_class(regexp, JSCLASS_REGEXP)) {
jsdisp_release(regexp);
regexp = NULL;
......@@ -1161,7 +1161,7 @@ static HRESULT String_split(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, unsi
}
if(is_object_instance(argv[0])) {
regexp = iface_to_jsdisp((IUnknown*)get_object(argv[0]));
regexp = iface_to_jsdisp(get_object(argv[0]));
if(regexp) {
if(!is_class(regexp, JSCLASS_REGEXP)) {
jsdisp_release(regexp);
......
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