msvcp: Sync istream<>::_ignore.

This commit is contained in:
Daniel Lehman 2012-10-24 13:47:05 -07:00 committed by Alexandre Julliard
parent 7fa823e5fa
commit c9a505258f
3 changed files with 68 additions and 26 deletions

View File

@ -5747,6 +5747,7 @@ basic_istream_char* __thiscall basic_istream_char_ignore(basic_istream_char *thi
{
basic_ios_char *base = basic_istream_char_get_basic_ios(this);
int ch = (unsigned char)delim;
unsigned int state;
TRACE("(%p %s %d)\n", this, wine_dbgstr_longlong(count), delim);
@ -5754,22 +5755,28 @@ basic_istream_char* __thiscall basic_istream_char_ignore(basic_istream_char *thi
if(basic_istream_char_sentry_create(this, TRUE)) {
basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
state = IOSTATE_goodbit;
while(count > 0) {
ch = basic_streambuf_char_sbumpc(strbuf);
if(ch==EOF || ch==(unsigned char)delim)
if(ch==EOF) {
state = IOSTATE_eofbit;
break;
}
if(ch==(unsigned char)delim)
break;
this->count++;
if(count != INT_MAX)
count--;
}
}
}else
state = IOSTATE_failbit;
basic_istream_char_sentry_destroy(this);
if(ch == EOF)
basic_ios_char_setstate(base, IOSTATE_eofbit);
basic_ios_char_setstate(base, state);
return this;
}
@ -6871,6 +6878,7 @@ basic_istream_wchar* __thiscall basic_istream_wchar_ignore(basic_istream_wchar *
{
basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
unsigned short ch = delim;
unsigned int state;
TRACE("(%p %s %d)\n", this, wine_dbgstr_longlong(count), delim);
@ -6878,22 +6886,28 @@ basic_istream_wchar* __thiscall basic_istream_wchar_ignore(basic_istream_wchar *
if(basic_istream_wchar_sentry_create(this, TRUE)) {
basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
state = IOSTATE_goodbit;
while(count > 0) {
ch = basic_streambuf_wchar_sbumpc(strbuf);
if(ch==WEOF || ch==delim)
if(ch==WEOF) {
state = IOSTATE_eofbit;
break;
}
if(ch==delim)
break;
this->count++;
if(count != INT_MAX)
count--;
}
}
}else
state = IOSTATE_failbit;
basic_istream_wchar_sentry_destroy(this);
if(ch == WEOF)
basic_ios_wchar_setstate(base, IOSTATE_eofbit);
basic_ios_wchar_setstate(base, state);
return this;
}

View File

@ -7137,7 +7137,8 @@ DEFINE_THISCALL_WRAPPER(basic_istream_char_ignore, 12)
basic_istream_char* __thiscall basic_istream_char_ignore(basic_istream_char *this, streamsize count, int delim)
{
basic_ios_char *base = basic_istream_char_get_basic_ios(this);
int ch = delim;
int ch = (unsigned char)delim;
unsigned int state;
TRACE("(%p %ld %d)\n", this, count, delim);
@ -7145,22 +7146,28 @@ basic_istream_char* __thiscall basic_istream_char_ignore(basic_istream_char *thi
if(basic_istream_char_sentry_create(this, TRUE)) {
basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
state = IOSTATE_goodbit;
while(count > 0) {
ch = basic_streambuf_char_sbumpc(strbuf);
if(ch==EOF || ch==delim)
if(ch==EOF) {
state = IOSTATE_eofbit;
break;
}
if(ch==(unsigned char)delim)
break;
this->count++;
if(count != INT_MAX)
count--;
}
}
}else
state = IOSTATE_failbit;
basic_istream_char_sentry_destroy(this);
if(ch == EOF)
basic_ios_char_setstate(base, IOSTATE_eofbit);
basic_ios_char_setstate(base, state);
return this;
}
@ -8389,6 +8396,7 @@ basic_istream_wchar* __thiscall basic_istream_wchar_ignore(basic_istream_wchar *
{
basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
unsigned short ch = delim;
unsigned int state;
TRACE("(%p %ld %d)\n", this, count, delim);
@ -8396,22 +8404,28 @@ basic_istream_wchar* __thiscall basic_istream_wchar_ignore(basic_istream_wchar *
if(basic_istream_wchar_sentry_create(this, TRUE)) {
basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
state = IOSTATE_goodbit;
while(count > 0) {
ch = basic_streambuf_wchar_sbumpc(strbuf);
if(ch==WEOF || ch==delim)
if(ch==WEOF) {
state = IOSTATE_eofbit;
break;
}
if(ch==delim)
break;
this->count++;
if(count != INT_MAX)
count--;
}
}
}else
state = IOSTATE_failbit;
basic_istream_wchar_sentry_destroy(this);
if(ch == WEOF)
basic_ios_wchar_setstate(base, IOSTATE_eofbit);
basic_ios_wchar_setstate(base, state);
return this;
}

View File

@ -7469,7 +7469,8 @@ DEFINE_THISCALL_WRAPPER(basic_istream_char_ignore, 12)
basic_istream_char* __thiscall basic_istream_char_ignore(basic_istream_char *this, streamsize count, int delim)
{
basic_ios_char *base = basic_istream_char_get_basic_ios(this);
int ch = delim;
int ch = (unsigned char)delim;
unsigned int state;
TRACE("(%p %ld %d)\n", this, count, delim);
@ -7477,22 +7478,28 @@ basic_istream_char* __thiscall basic_istream_char_ignore(basic_istream_char *thi
if(basic_istream_char_sentry_create(this, TRUE)) {
basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
state = IOSTATE_goodbit;
while(count > 0) {
ch = basic_streambuf_char_sbumpc(strbuf);
if(ch==EOF || ch==delim)
if(ch==EOF) {
state = IOSTATE_eofbit;
break;
}
if(ch==(unsigned char)delim)
break;
this->count++;
if(count != INT_MAX)
count--;
}
}
}else
state = IOSTATE_failbit;
basic_istream_char_sentry_destroy(this);
if(ch == EOF)
basic_ios_char_setstate(base, IOSTATE_eofbit);
basic_ios_char_setstate(base, state);
return this;
}
@ -8724,6 +8731,7 @@ basic_istream_wchar* __thiscall basic_istream_wchar_ignore(basic_istream_wchar *
{
basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
unsigned short ch = delim;
unsigned int state;
TRACE("(%p %ld %d)\n", this, count, delim);
@ -8731,22 +8739,28 @@ basic_istream_wchar* __thiscall basic_istream_wchar_ignore(basic_istream_wchar *
if(basic_istream_wchar_sentry_create(this, TRUE)) {
basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
state = IOSTATE_goodbit;
while(count > 0) {
ch = basic_streambuf_wchar_sbumpc(strbuf);
if(ch==WEOF || ch==delim)
if(ch==WEOF) {
state = IOSTATE_eofbit;
break;
}
if(ch==delim)
break;
this->count++;
if(count != INT_MAX)
count--;
}
}
}else
state = IOSTATE_failbit;
basic_istream_wchar_sentry_destroy(this);
if(ch == WEOF)
basic_ios_wchar_setstate(base, IOSTATE_eofbit);
basic_ios_wchar_setstate(base, state);
return this;
}