Commit 81fc9ade authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

jscript: Code clean up.

parent c444a490
......@@ -315,7 +315,7 @@ static HRESULT Array_join(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS
if(arg_cnt(dp)) {
BSTR sep;
hres = to_string(dispex->ctx, dp->rgvarg + dp->cArgs-1, ei, &sep);
hres = to_string(dispex->ctx, get_arg(dp,0), ei, &sep);
if(FAILED(hres))
return hres;
......
......@@ -70,12 +70,11 @@ static HRESULT init_parameters(DispatchEx *var_disp, FunctionInstance *function,
HRESULT hres;
V_VT(&var_empty) = VT_EMPTY;
cargs = dp->cArgs - dp->cNamedArgs;
cargs = arg_cnt(dp);
for(param = function->parameters; param; param = param->next) {
hres = jsdisp_propput_name(var_disp, param->identifier, lcid,
i < cargs ? dp->rgvarg + dp->cArgs-1 - i : &var_empty,
ei, caller);
i < cargs ? get_arg(dp,i) : &var_empty, ei, caller);
if(FAILED(hres))
return hres;
......
......@@ -1066,7 +1066,7 @@ static HRESULT String_slice(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAM
}
if(arg_cnt(dp)) {
hres = to_integer(dispex->ctx, dp->rgvarg + dp->cArgs-1, ei, &v);
hres = to_integer(dispex->ctx, get_arg(dp,0), ei, &v);
if(FAILED(hres)) {
SysFreeString(val_str);
return hres;
......@@ -1089,7 +1089,7 @@ static HRESULT String_slice(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAM
}
if(arg_cnt(dp) >= 2) {
hres = to_integer(dispex->ctx, dp->rgvarg + dp->cArgs-2, ei, &v);
hres = to_integer(dispex->ctx, get_arg(dp,1), ei, &v);
if(FAILED(hres)) {
SysFreeString(val_str);
return hres;
......@@ -1325,7 +1325,7 @@ static HRESULT String_substring(DispatchEx *dispex, LCID lcid, WORD flags, DISPP
}
if(arg_cnt(dp) >= 1) {
hres = to_integer(dispex->ctx, dp->rgvarg + dp->cArgs-1, ei, &v);
hres = to_integer(dispex->ctx, get_arg(dp,0), ei, &v);
if(FAILED(hres)) {
SysFreeString(val_str);
return hres;
......@@ -1343,7 +1343,7 @@ static HRESULT String_substring(DispatchEx *dispex, LCID lcid, WORD flags, DISPP
}
if(arg_cnt(dp) >= 2) {
hres = to_integer(dispex->ctx, dp->rgvarg + dp->cArgs-2, ei, &v);
hres = to_integer(dispex->ctx, get_arg(dp,1), ei, &v);
if(FAILED(hres)) {
SysFreeString(val_str);
return hres;
......@@ -1412,7 +1412,7 @@ static HRESULT String_substr(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARA
}
if(arg_cnt(dp) >= 1) {
hres = to_integer(dispex->ctx, dp->rgvarg + dp->cArgs-1, ei, &v);
hres = to_integer(dispex->ctx, get_arg(dp,0), ei, &v);
if(FAILED(hres)) {
SysFreeString(val_str);
return hres;
......@@ -1430,7 +1430,7 @@ static HRESULT String_substr(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARA
}
if(arg_cnt(dp) >= 2) {
hres = to_integer(dispex->ctx, dp->rgvarg + dp->cArgs-2, ei, &v);
hres = to_integer(dispex->ctx, get_arg(dp,1), ei, &v);
if(FAILED(hres)) {
SysFreeString(val_str);
return hres;
......
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