[PATCH 1/2] vbscript: Implement DateSerial().
Nikolay Sivov
nsivov at codeweavers.com
Sun May 15 08:57:33 CDT 2022
On 5/15/22 15:58, Dmitry Timoshkov wrote:
> Nikolay Sivov <nsivov at codeweavers.com> wrote:
>
>> -static HRESULT Global_DateSerial(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
>> +static HRESULT Global_DateSerial(BuiltinDisp *This, VARIANT *args, unsigned args_cnt, VARIANT *res)
>> {
>> - FIXME("\n");
>> - return E_NOTIMPL;
>> + int year, month, day;
>> + SYSTEMTIME lt;
>> + HRESULT hres;
>> + double date;
>> + UDATE ud;
>> +
>> + TRACE("\n");
>> +
>> + assert(args_cnt == 3);
>> +
>> + hres = to_int(args, &year);
>> + if (SUCCEEDED(hres))
>> + hres = to_int(args + 1, &month);
>> + if (SUCCEEDED(hres))
>> + hres = to_int(args + 2, &day);
>> +
>> + if (SUCCEEDED(hres))
>> + {
>> + lt.wYear = year;
>> + lt.wMonth = month;
>> + lt.wDay = day;
>> +
>> + ud.st = lt;
>> + ud.wDayOfYear = 0;
>> + hres = VarDateFromUdateEx(&ud, 0, 0, &date);
>> + }
> Having 'lt' as an intermediate variable seems to be redundant. Also
> ud.st is not fully initialized unlike in 2/2.
>
Thank you.
More information about the wine-devel
mailing list