[PATCH 1/2] vbscript: Implemented Abs(try 8)
Piotr Caban
piotr.caban at gmail.com
Tue Jul 15 04:10:49 CDT 2014
On 07/15/14 04:55, Shuai Meng wrote:
> static HRESULT Global_Abs(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
> {
> - FIXME("\n");
> - return E_NOTIMPL;
> + HRESULT hres;
> + VARIANT dst;
> +
> + TRACE("(%s)\n", debugstr_variant(arg));
> +
> + assert(args_cnt == 1);
> +
> + hres = VarAbs(arg, &dst);
> + if FAILED(hres)
> + return hres;
Please use parenthesis around if condition;
> + if(!res)
> + return DISP_E_BADVARTYPE;
You have already written a test that shows this is incorrect (Call
Abs(-4)). You also need to call VariantClear if dst is not used.
> + return VariantCopy(res, &dst);
Please change it to:
*res = dst;
return S_OK;
More information about the wine-devel
mailing list