msvcp90: Add istream::operator>>complex implementation and tests.

Piotr Caban piotr.caban at gmail.com
Mon Mar 9 05:23:11 CDT 2015


Hi,

On 03/07/15 12:13, YongHao Hu wrote:
> +/* ??$?5MDU?$char_traits at D@std@@@std@@YAAAV?$basic_istream at DU?$char_traits at D@std@@@0 at AAV10@AAV?$complex at M@0@@Z */
> +/* ??$?5MDU?$char_traits at D@std@@@std@@YAAEAV?$basic_istream at DU?$char_traits at D@std@@@0 at AEAV10@AEAV?$complex at M@0@@Z */
> +basic_istream_char* __cdecl basic_istream_char_read_complex_float(basic_istream_char *this, complex_float *v)
> +{
> +    float r;
> +    basic_ios_char *base = basic_istream_char_get_basic_ios(this);
> +    if(ios_base_good(&base->base)) {
There's no need to check the stream state here, it will be done by 
stream reading functions.
> +        ws_basic_istream_char(this);
> +        if(basic_istream_char_peek(this) == '(') {
> +            basic_istream_char_get(this);
> +            basic_istream_char_read_float(this, &r);
> +            if(!ios_base_fail(&base->base)) {
I think that the implementation will be more readable if you just return 
on error here. The if(!ios_base_fail(...)) line can be changed to:
if(ios_base_fail(&base->base))
     return this;
You don't need to set failbit in this case because it's already set by 
basic_istream_char_read_float. The same applies to some other 
ios_base_fail() checks.

Thanks,
Piotr



More information about the wine-devel mailing list