Re: [PATCH 1/2] vbscript: Implemented Abs(try 8)
15 Jul
2014
15 Jul
'14
9:10 a.m.
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;
4174
Age (days ago)
4174
Last active (days ago)
0 comments
1 participants
participants (1)
-
Piotr Caban