[PATCH] vbscript: Implement StrComp()

Dmitry Timoshkov dmitry at baikal.ru
Fri Nov 4 08:28:51 CDT 2016


Jacek Caban <jacek at codeweavers.com> wrote:

> On 04.11.2016 10:07, Dmitry Timoshkov wrote:
> > Nikolay Sivov <nsivov at codeweavers.com> wrote:
> >
> >> +    TRACE("(%s %s ...)\n", debugstr_variant(args), debugstr_variant(args+1));
> >> +
> >> +    assert(args_cnt == 2 || args_cnt == 3);
> >> +
> >> +    if(V_VT(args) != VT_BSTR || V_VT(args+1) != VT_BSTR) {
> >> +        FIXME("args[0] = %s, args[1] = %s\n", debugstr_variant(args), debugstr_variant(args+1));
> >> +        return E_NOTIMPL;
> >> +    }
> >> +
> >> +    if (args_cnt == 3) {
> >> +        hres = to_int(args+2, &mode);
> >> +        if(FAILED(hres))
> >> +            return hres;
> >> +
> >> +        if (mode != 0 && mode != 1) {
> >> +            FIXME("unknown compare mode = %d\n", mode);
> >> +            return E_FAIL;
> >> +        }
> >> +    }
> >> +    else
> >> +        mode = 0;
> >> +
> >> +    left = V_BSTR(args);
> >> +    right = V_BSTR(args+1);
> > Is it possible to consistently use single way of accessing the args array,
> > for instance the indexed args[i] form?
> 
> As far as I can see, it's consistent.

Probably I should have used the term "referenced" instead of "accessed".
For instance the FIXME message uses args[0], args[1] while the referenced
variables are "args" and "args+1". Using args[0], args[1],... would make
the things clearer IMHO.

-- 
Dmitry.



More information about the wine-devel mailing list