stdcxx-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From se...@apache.org
Subject svn commit: r384278 - in /incubator/stdcxx/trunk/include: fstream streambuf
Date Wed, 08 Mar 2006 17:46:18 GMT
Author: sebor
Date: Wed Mar  8 09:46:16 2006
New Revision: 384278

URL: http://svn.apache.org/viewcvs?rev=384278&view=rev
Log:
2006-03-08  Martin Sebor  <sebor@roguewave.com>

	* fstream (_C_pbacksize): Changed type from streamsize to size_t
	since negative values don't make sense and aren't permitted.
	* streambuf (_C_write_avail, _C_putback_avail): Returned size_t
	instead of streamsize since the returned value is guaranteed to
	be non-negative.

Modified:
    incubator/stdcxx/trunk/include/fstream
    incubator/stdcxx/trunk/include/streambuf

Modified: incubator/stdcxx/trunk/include/fstream
URL: http://svn.apache.org/viewcvs/incubator/stdcxx/trunk/include/fstream?rev=384278&r1=384277&r2=384278&view=diff
==============================================================================
--- incubator/stdcxx/trunk/include/fstream (original)
+++ incubator/stdcxx/trunk/include/fstream Wed Mar  8 09:46:16 2006
@@ -263,7 +263,7 @@
                                       //  end of buffer, and actual pos in file 
     pos_type   _C_beg_pos;            // offset/state in file corresponding
                                       //  to the beginning of buffer 
-    _RWSTD_STREAMSIZE _C_pbacksize;   // current size of putback area
+    _RWSTD_SIZE_T _C_pbacksize;       // size of putback area
 };
 
 

Modified: incubator/stdcxx/trunk/include/streambuf
URL: http://svn.apache.org/viewcvs/incubator/stdcxx/trunk/include/streambuf?rev=384278&r1=384277&r2=384278&view=diff
==============================================================================
--- incubator/stdcxx/trunk/include/streambuf (original)
+++ incubator/stdcxx/trunk/include/streambuf Wed Mar  8 09:46:16 2006
@@ -297,19 +297,14 @@
         return 0;
     }
 
-
-    //
-    // non-standard convenience functions
-    //
-
     // is a write position available?
-    streamsize _C_write_avail () const {
-        return streamsize (_C_is_out () ? epptr () - pptr () : 0);
+    _RWSTD_SIZE_T _C_write_avail () const {
+        return _C_is_out () ? epptr () - pptr () : 0;
     }
 
     // how much space in putback area is available?
-    streamsize _C_putback_avail () const {
-        return streamsize (_C_is_in () ? gptr () - eback () : 0);
+    _RWSTD_SIZE_T _C_putback_avail () const {
+        return _C_is_in () ? gptr () - eback () : 0;
     }
 
     // is buffer in input mode?
@@ -320,7 +315,7 @@
     // is buffer in output mode?
     bool _C_is_out () const {
         return ios_base::out ==
-            (_C_state & (ios_base::out | _C_frozen | _C_constant));
+            (_C_state & (int (ios_base::out) | _C_frozen | _C_constant));
     }
 
     // is buffer in both input and output mode?
@@ -387,9 +382,9 @@
     // debug only - asserts that get and put areas are consistent
     bool _C_is_valid () const;
 
-    char_type  *_C_buffer;    // character buffer
-    streamsize  _C_bufsize;   // size of buffer in characters
-    int         _C_state;     // state of buffer (used in subclasses)
+    char_type     *_C_buffer;    // character buffer
+    _RWSTD_SIZE_T  _C_bufsize;   // size of buffer in characters
+    int            _C_state;     // state of buffer (used in subclasses)
 
 private:
 



Mime
View raw message