Daniel Lehman : msvcp90: Fix usage of fpos<>::off vs fpos<>::pos.

Alexandre Julliard julliard at winehq.org
Wed Oct 31 17:17:21 CDT 2012


Module: wine
Branch: master
Commit: 771cc7fdbd43550980c9250b9421cfe4621f3bbf
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=771cc7fdbd43550980c9250b9421cfe4621f3bbf

Author: Daniel Lehman <dlehman at esri.com>
Date:   Fri Sep 28 17:17:53 2012 -0700

msvcp90: Fix usage of fpos<>::off vs fpos<>::pos.

---

 dlls/msvcp90/ios.c |   74 ++++++++++++++++++++++++++--------------------------
 1 files changed, 37 insertions(+), 37 deletions(-)

diff --git a/dlls/msvcp90/ios.c b/dlls/msvcp90/ios.c
index 9435cb2..b1acb3f 100644
--- a/dlls/msvcp90/ios.c
+++ b/dlls/msvcp90/ios.c
@@ -1250,8 +1250,8 @@ fpos_int* __thiscall basic_streambuf_char_seekoff(basic_streambuf_char *this,
         fpos_int *ret, streamoff off, int way, int mode)
 {
     TRACE("(%p %ld %d %d)\n", this, off, way, mode);
-    ret->off = 0;
-    ret->pos = -1;
+    ret->off = -1;
+    ret->pos = 0;
     ret->state = 0;
     return ret;
 }
@@ -1285,8 +1285,8 @@ fpos_int* __thiscall basic_streambuf_char_seekpos(basic_streambuf_char *this,
         fpos_int *ret, fpos_int pos, int mode)
 {
     TRACE("(%p %s %d)\n", this, debugstr_fpos_int(&pos), mode);
-    ret->off = 0;
-    ret->pos = -1;
+    ret->off = -1;
+    ret->pos = 0;
     ret->state = 0;
     return ret;
 }
@@ -2020,8 +2020,8 @@ fpos_int* __thiscall basic_streambuf_wchar_seekoff(basic_streambuf_wchar *this,
         fpos_int *ret, streamoff off, int way, int mode)
 {
     TRACE("(%p %ld %d %d)\n", this, off, way, mode);
-    ret->off = 0;
-    ret->pos = -1;
+    ret->off = -1;
+    ret->pos = 0;
     ret->state = 0;
     return ret;
 }
@@ -2061,8 +2061,8 @@ fpos_int* __thiscall basic_streambuf_wchar_seekpos(basic_streambuf_wchar *this,
         fpos_int *ret, fpos_int pos, int mode)
 {
     TRACE("(%p %s %d)\n", this, debugstr_fpos_int(&pos), mode);
-    ret->off = 0;
-    ret->pos = -1;
+    ret->off = -1;
+    ret->pos = 0;
     ret->state = 0;
     return ret;
 }
@@ -2804,8 +2804,8 @@ fpos_int* __thiscall basic_filebuf_char_seekoff(basic_filebuf_char *this,
 
     if(!basic_filebuf_char_is_open(this) || !basic_filebuf_char__Endwrite(this)
             || fseek(this->file, off, way)) {
-        ret->off = 0;
-        ret->pos = -1;
+        ret->off = -1;
+        ret->pos = 0;
         ret->state = 0;
         return ret;
     }
@@ -2830,8 +2830,8 @@ fpos_int* __thiscall basic_filebuf_char_seekpos(basic_filebuf_char *this,
     if(!basic_filebuf_char_is_open(this) || !basic_filebuf_char__Endwrite(this)
             || fseek(this->file, (LONG)pos.pos, SEEK_SET)
             || (pos.off && fseek(this->file, pos.off, SEEK_CUR))) {
-        ret->off = 0;
-        ret->pos = -1;
+        ret->off = -1;
+        ret->pos = 0;
         ret->state = 0;
         return ret;
     }
@@ -3421,8 +3421,8 @@ fpos_int* __thiscall basic_filebuf_wchar_seekoff(basic_filebuf_wchar *this,
 
     if(!basic_filebuf_wchar_is_open(this) || !basic_filebuf_wchar__Endwrite(this)
             || fseek(this->file, off, way)) {
-        ret->off = 0;
-        ret->pos = -1;
+        ret->off = -1;
+        ret->pos = 0;
         ret->state = 0;
         return ret;
     }
@@ -3449,8 +3449,8 @@ fpos_int* __thiscall basic_filebuf_wchar_seekpos(basic_filebuf_wchar *this,
     if(!basic_filebuf_wchar_is_open(this) || !basic_filebuf_wchar__Endwrite(this)
             || fseek(this->file, (LONG)pos.pos, SEEK_SET)
             || (pos.off && fseek(this->file, pos.off, SEEK_CUR))) {
-        ret->off = 0;
-        ret->pos = -1;
+        ret->off = -1;
+        ret->pos = 0;
         ret->state = 0;
         return ret;
     }
@@ -3854,7 +3854,7 @@ fpos_int* __thiscall basic_stringbuf_char_seekpos(basic_stringbuf_char *this,
 {
     TRACE("(%p %p %s %d)\n", this, ret, debugstr_fpos_int(&pos), mode);
 
-    if(pos.off==0 && pos.pos==-1 && pos.state==0) {
+    if(pos.off==-1 && pos.pos==0 && pos.state==0) {
         *ret = pos;
         return ret;
     }
@@ -4267,7 +4267,7 @@ fpos_int* __thiscall basic_stringbuf_wchar_seekpos(basic_stringbuf_wchar *this,
 {
     TRACE("(%p %p %s %d)\n", this, ret, debugstr_fpos_int(&pos), mode);
 
-    if(pos.off==0 && pos.pos==-1 && pos.state==0) {
+    if(pos.off==-1 && pos.pos==0 && pos.state==0) {
         *ret = pos;
         return ret;
     }
@@ -5610,7 +5610,7 @@ basic_ostream_char* __thiscall basic_ostream_char_seekp(basic_ostream_char *this
 
         basic_streambuf_char_pubseekoff(basic_ios_char_rdbuf_get(base),
                 &seek, off, way, OPENMODE_out);
-        if(seek.off==0 && seek.pos==-1 && seek.state==0)
+        if(seek.off==-1 && seek.pos==0 && seek.state==0)
             basic_ios_char_setstate(base, IOSTATE_failbit);
     }
     return this;
@@ -5630,7 +5630,7 @@ basic_ostream_char* __thiscall basic_ostream_char_seekp_fpos(basic_ostream_char
 
         basic_streambuf_char_pubseekpos(basic_ios_char_rdbuf_get(base),
                 &seek, pos, OPENMODE_out);
-        if(seek.off==0 && seek.pos==-1 && seek.state==0)
+        if(seek.off==-1 && seek.pos==0 && seek.state==0)
             basic_ios_char_setstate(base, IOSTATE_failbit);
     }
     return this;
@@ -5649,8 +5649,8 @@ fpos_int* __thiscall basic_ostream_char_tellp(basic_ostream_char *this, fpos_int
         basic_streambuf_char_pubseekoff(basic_ios_char_rdbuf_get(base),
                 ret, 0, SEEKDIR_cur, OPENMODE_out);
     }else {
-        ret->off = 0;
-        ret->pos = -1;
+        ret->off = -1;
+        ret->pos = 0;
         ret->state = 0;
     }
     return ret;
@@ -6419,7 +6419,7 @@ basic_ostream_wchar* __thiscall basic_ostream_wchar_seekp(basic_ostream_wchar *t
 
         basic_streambuf_wchar_pubseekoff(basic_ios_wchar_rdbuf_get(base),
                 &seek, off, way, OPENMODE_out);
-        if(seek.off==0 && seek.pos==-1 && seek.state==0)
+        if(seek.off==-1 && seek.pos==0 && seek.state==0)
             basic_ios_wchar_setstate(base, IOSTATE_failbit);
     }
     return this;
@@ -6441,7 +6441,7 @@ basic_ostream_wchar* __thiscall basic_ostream_wchar_seekp_fpos(basic_ostream_wch
 
         basic_streambuf_wchar_pubseekpos(basic_ios_wchar_rdbuf_get(base),
                 &seek, pos, OPENMODE_out);
-        if(seek.off==0 && seek.pos==-1 && seek.state==0)
+        if(seek.off==-1 && seek.pos==0 && seek.state==0)
             basic_ios_wchar_setstate(base, IOSTATE_failbit);
     }
     return this;
@@ -6462,8 +6462,8 @@ fpos_int* __thiscall basic_ostream_wchar_tellp(basic_ostream_wchar *this, fpos_i
         basic_streambuf_wchar_pubseekoff(basic_ios_wchar_rdbuf_get(base),
                 ret, 0, SEEKDIR_cur, OPENMODE_out);
     }else {
-        ret->off = 0;
-        ret->pos = -1;
+        ret->off = -1;
+        ret->pos = 0;
         ret->state = 0;
     }
     return ret;
@@ -7746,15 +7746,15 @@ fpos_int* __thiscall basic_istream_char_tellg(basic_istream_char *this, fpos_int
                     ret, 0, SEEKDIR_cur, OPENMODE_in);
             basic_istream_char_sentry_destroy(this);
 
-            if(ret->off==0 && ret->pos==-1 && ret->state==0)
+            if(ret->off==-1 && ret->pos==0 && ret->state==0)
                 basic_ios_char_setstate(base, IOSTATE_failbit);
             return ret;
         }
     }
     basic_istream_char_sentry_destroy(this);
 
-    ret->off = 0;
-    ret->pos = -1;
+    ret->off = -1;
+    ret->pos = 0;
     ret->state = 0;
     return ret;
 }
@@ -7774,7 +7774,7 @@ basic_istream_char* __thiscall basic_istream_char_seekg(basic_istream_char *this
 
         basic_streambuf_char_pubseekoff(strbuf, &ret, off, dir, OPENMODE_in);
 
-        if(ret.off==0 && ret.pos==-1 && ret.state==0)
+        if(ret.off==-1 && ret.pos==0 && ret.state==0)
             basic_ios_char_setstate(base, IOSTATE_failbit);
         else
             basic_ios_char_clear(base, IOSTATE_goodbit);
@@ -7801,7 +7801,7 @@ basic_istream_char* __thiscall basic_istream_char_seekg_fpos(basic_istream_char
         basic_streambuf_char_pubseekpos(strbuf, &ret, pos, OPENMODE_in);
         basic_istream_char_sentry_destroy(this);
 
-        if(ret.off==0 && ret.pos==-1 && ret.state==0)
+        if(ret.off==-1 && ret.pos==0 && ret.state==0)
             basic_ios_char_setstate(base, IOSTATE_failbit);
         else
             basic_ios_char_clear(base, IOSTATE_goodbit);
@@ -9028,15 +9028,15 @@ fpos_int* __thiscall basic_istream_wchar_tellg(basic_istream_wchar *this, fpos_i
                     ret, 0, SEEKDIR_cur, OPENMODE_in);
             basic_istream_wchar_sentry_destroy(this);
 
-            if(ret->off==0 && ret->pos==-1 && ret->state==0)
+            if(ret->off==-1 && ret->pos==0 && ret->state==0)
                 basic_ios_wchar_setstate(base, IOSTATE_failbit);
             return ret;
         }
     }
     basic_istream_wchar_sentry_destroy(this);
 
-    ret->off = 0;
-    ret->pos = -1;
+    ret->off = -1;
+    ret->pos = 0;
     ret->state = 0;
     return ret;
 }
@@ -9059,7 +9059,7 @@ basic_istream_wchar* __thiscall basic_istream_wchar_seekg(basic_istream_wchar *t
         basic_streambuf_wchar_pubseekoff(strbuf, &ret, off, dir, OPENMODE_in);
         basic_istream_wchar_sentry_destroy(this);
 
-        if(ret.off==0 && ret.pos==-1 && ret.state==0)
+        if(ret.off==-1 && ret.pos==0 && ret.state==0)
             basic_ios_wchar_setstate(base, IOSTATE_failbit);
         else
             basic_ios_wchar_clear(base, IOSTATE_goodbit);
@@ -9088,7 +9088,7 @@ basic_istream_wchar* __thiscall basic_istream_wchar_seekg_fpos(basic_istream_wch
         basic_streambuf_wchar_pubseekpos(strbuf, &ret, pos, OPENMODE_in);
         basic_istream_wchar_sentry_destroy(this);
 
-        if(ret.off==0 && ret.pos==-1 && ret.state==0)
+        if(ret.off==-1 && ret.pos==0 && ret.state==0)
             basic_ios_wchar_setstate(base, IOSTATE_failbit);
         else
             basic_ios_wchar_clear(base, IOSTATE_goodbit);
@@ -12829,7 +12829,7 @@ fpos_int* __thiscall strstreambuf_seekpos(strstreambuf *this, fpos_int *ret, fpo
 {
     TRACE("(%p %p %s %d)\n", this, ret, debugstr_fpos_int(&pos), mode);
 
-    if(pos.off==0 && pos.pos==-1 && pos.state==0) {
+    if(pos.off==-1 && pos.pos==0 && pos.state==0) {
         *ret = pos;
         return ret;
     }




More information about the wine-cvs mailing list