Commit bc62a7a9 authored by Daniel Lehman's avatar Daniel Lehman Committed by Alexandre Julliard

msvcp: Sync istream<>::seekg implementations.

parent 7fe93a5f
......@@ -6006,24 +6006,20 @@ basic_istream_char* __thiscall basic_istream_char_seekg(basic_istream_char *this
TRACE("(%p %s %d)\n", this, wine_dbgstr_longlong(off), dir);
if(basic_istream_char_sentry_create(this, TRUE)) {
if(!ios_base_fail(&base->base)) {
basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
fpos_int ret;
basic_streambuf_char_pubseekoff(strbuf, &ret, off, dir, OPENMODE_in);
basic_istream_char_sentry_destroy(this);
if(ret.off==0 && ret.pos==-1 && ret.state==0)
basic_ios_char_setstate(base, IOSTATE_failbit);
else
basic_ios_char_clear(base, IOSTATE_goodbit);
return this;
}
}
basic_istream_char_sentry_destroy(this);
}else
basic_ios_char_clear(base, IOSTATE_goodbit);
basic_ios_char_setstate(base, IOSTATE_failbit);
return this;
}
......@@ -6036,7 +6032,6 @@ basic_istream_char* __thiscall basic_istream_char_seekg_fpos(basic_istream_char
TRACE("(%p %s)\n", this, debugstr_fpos_int(&pos));
if(basic_istream_char_sentry_create(this, TRUE)) {
if(!ios_base_fail(&base->base)) {
basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
fpos_int ret;
......@@ -6049,11 +6044,9 @@ basic_istream_char* __thiscall basic_istream_char_seekg_fpos(basic_istream_char
else
basic_ios_char_clear(base, IOSTATE_goodbit);
return this;
}
}
basic_istream_char_sentry_destroy(this);
}else
basic_ios_char_clear(base, IOSTATE_goodbit);
basic_ios_char_setstate(base, IOSTATE_failbit);
return this;
}
......@@ -7159,7 +7152,6 @@ basic_istream_wchar* __thiscall basic_istream_wchar_seekg(basic_istream_wchar *t
TRACE("(%p %s %d)\n", this, wine_dbgstr_longlong(off), dir);
if(basic_istream_wchar_sentry_create(this, TRUE)) {
if(!ios_base_fail(&base->base)) {
basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
fpos_int ret;
......@@ -7172,11 +7164,9 @@ basic_istream_wchar* __thiscall basic_istream_wchar_seekg(basic_istream_wchar *t
else
basic_ios_wchar_clear(base, IOSTATE_goodbit);
return this;
}
}
basic_istream_wchar_sentry_destroy(this);
}else
basic_ios_wchar_clear(base, IOSTATE_goodbit);
basic_ios_wchar_setstate(base, IOSTATE_failbit);
return this;
}
......@@ -7191,7 +7181,6 @@ basic_istream_wchar* __thiscall basic_istream_wchar_seekg_fpos(basic_istream_wch
TRACE("(%p %s)\n", this, debugstr_fpos_int(&pos));
if(basic_istream_wchar_sentry_create(this, TRUE)) {
if(!ios_base_fail(&base->base)) {
basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
fpos_int ret;
......@@ -7204,11 +7193,9 @@ basic_istream_wchar* __thiscall basic_istream_wchar_seekg_fpos(basic_istream_wch
else
basic_ios_wchar_clear(base, IOSTATE_goodbit);
return this;
}
}
basic_istream_wchar_sentry_destroy(this);
}else
basic_ios_wchar_clear(base, IOSTATE_goodbit);
basic_ios_wchar_setstate(base, IOSTATE_failbit);
return this;
}
......
......@@ -7397,24 +7397,20 @@ basic_istream_char* __thiscall basic_istream_char_seekg(basic_istream_char *this
TRACE("(%p %ld %d)\n", this, off, dir);
if(basic_istream_char_sentry_create(this, TRUE)) {
if(!ios_base_fail(&base->base)) {
basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
fpos_int ret;
basic_streambuf_char_pubseekoff(strbuf, &ret, off, dir, OPENMODE_in);
basic_istream_char_sentry_destroy(this);
if(ret.off==0 && ret.pos==-1 && ret.state==0)
basic_ios_char_setstate(base, IOSTATE_failbit);
else
basic_ios_char_clear(base, IOSTATE_goodbit);
return this;
}
}
basic_istream_char_sentry_destroy(this);
}else
basic_ios_char_clear(base, IOSTATE_goodbit);
basic_ios_char_setstate(base, IOSTATE_failbit);
return this;
}
......@@ -7427,7 +7423,6 @@ basic_istream_char* __thiscall basic_istream_char_seekg_fpos(basic_istream_char
TRACE("(%p %s)\n", this, debugstr_fpos_int(&pos));
if(basic_istream_char_sentry_create(this, TRUE)) {
if(!ios_base_fail(&base->base)) {
basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
fpos_int ret;
......@@ -7440,11 +7435,9 @@ basic_istream_char* __thiscall basic_istream_char_seekg_fpos(basic_istream_char
else
basic_ios_char_clear(base, IOSTATE_goodbit);
return this;
}
}
basic_istream_char_sentry_destroy(this);
}else
basic_ios_char_clear(base, IOSTATE_goodbit);
basic_ios_char_setstate(base, IOSTATE_failbit);
return this;
}
......@@ -8675,7 +8668,6 @@ basic_istream_wchar* __thiscall basic_istream_wchar_seekg(basic_istream_wchar *t
TRACE("(%p %ld %d)\n", this, off, dir);
if(basic_istream_wchar_sentry_create(this, TRUE)) {
if(!ios_base_fail(&base->base)) {
basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
fpos_int ret;
......@@ -8688,11 +8680,9 @@ basic_istream_wchar* __thiscall basic_istream_wchar_seekg(basic_istream_wchar *t
else
basic_ios_wchar_clear(base, IOSTATE_goodbit);
return this;
}
}
basic_istream_wchar_sentry_destroy(this);
}else
basic_ios_wchar_clear(base, IOSTATE_goodbit);
basic_ios_wchar_setstate(base, IOSTATE_failbit);
return this;
}
......@@ -8707,7 +8697,6 @@ basic_istream_wchar* __thiscall basic_istream_wchar_seekg_fpos(basic_istream_wch
TRACE("(%p %s)\n", this, debugstr_fpos_int(&pos));
if(basic_istream_wchar_sentry_create(this, TRUE)) {
if(!ios_base_fail(&base->base)) {
basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
fpos_int ret;
......@@ -8720,11 +8709,9 @@ basic_istream_wchar* __thiscall basic_istream_wchar_seekg_fpos(basic_istream_wch
else
basic_ios_wchar_clear(base, IOSTATE_goodbit);
return this;
}
}
basic_istream_wchar_sentry_destroy(this);
}else
basic_ios_wchar_clear(base, IOSTATE_goodbit);
basic_ios_wchar_setstate(base, IOSTATE_failbit);
return this;
}
......
......@@ -7729,24 +7729,20 @@ basic_istream_char* __thiscall basic_istream_char_seekg(basic_istream_char *this
TRACE("(%p %ld %d)\n", this, off, dir);
if(basic_istream_char_sentry_create(this, TRUE)) {
if(!ios_base_fail(&base->base)) {
basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
fpos_int ret;
basic_streambuf_char_pubseekoff(strbuf, &ret, off, dir, OPENMODE_in);
basic_istream_char_sentry_destroy(this);
if(ret.off==0 && ret.pos==-1 && ret.state==0)
basic_ios_char_setstate(base, IOSTATE_failbit);
else
basic_ios_char_clear(base, IOSTATE_goodbit);
return this;
}
}
basic_istream_char_sentry_destroy(this);
}else
basic_ios_char_clear(base, IOSTATE_goodbit);
basic_ios_char_setstate(base, IOSTATE_failbit);
return this;
}
......@@ -7759,7 +7755,6 @@ basic_istream_char* __thiscall basic_istream_char_seekg_fpos(basic_istream_char
TRACE("(%p %s)\n", this, debugstr_fpos_int(&pos));
if(basic_istream_char_sentry_create(this, TRUE)) {
if(!ios_base_fail(&base->base)) {
basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
fpos_int ret;
......@@ -7772,11 +7767,9 @@ basic_istream_char* __thiscall basic_istream_char_seekg_fpos(basic_istream_char
else
basic_ios_char_clear(base, IOSTATE_goodbit);
return this;
}
}
basic_istream_char_sentry_destroy(this);
}else
basic_ios_char_clear(base, IOSTATE_goodbit);
basic_ios_char_setstate(base, IOSTATE_failbit);
return this;
}
......@@ -9012,7 +9005,6 @@ basic_istream_wchar* __thiscall basic_istream_wchar_seekg(basic_istream_wchar *t
TRACE("(%p %ld %d)\n", this, off, dir);
if(basic_istream_wchar_sentry_create(this, TRUE)) {
if(!ios_base_fail(&base->base)) {
basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
fpos_int ret;
......@@ -9025,11 +9017,9 @@ basic_istream_wchar* __thiscall basic_istream_wchar_seekg(basic_istream_wchar *t
else
basic_ios_wchar_clear(base, IOSTATE_goodbit);
return this;
}
}
basic_istream_wchar_sentry_destroy(this);
}else
basic_ios_wchar_clear(base, IOSTATE_goodbit);
basic_ios_wchar_setstate(base, IOSTATE_failbit);
return this;
}
......@@ -9044,7 +9034,6 @@ basic_istream_wchar* __thiscall basic_istream_wchar_seekg_fpos(basic_istream_wch
TRACE("(%p %s)\n", this, debugstr_fpos_int(&pos));
if(basic_istream_wchar_sentry_create(this, TRUE)) {
if(!ios_base_fail(&base->base)) {
basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
fpos_int ret;
......@@ -9057,11 +9046,9 @@ basic_istream_wchar* __thiscall basic_istream_wchar_seekg_fpos(basic_istream_wch
else
basic_ios_wchar_clear(base, IOSTATE_goodbit);
return this;
}
}
basic_istream_wchar_sentry_destroy(this);
}else
basic_ios_wchar_clear(base, IOSTATE_goodbit);
basic_ios_wchar_setstate(base, IOSTATE_failbit);
return this;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment