This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[RFC] So, which is the correct type of _M_*_end - _M_*_cur?


Hi,

reading and re-reading this code I noticed another minor
inconsistency.

In streambuf.tcc we can find two very neat and symmetric
implementations of basic_streambuf::xsgetn and
basic_streambuf::xsputn, but, in the former:

//
 while (__ret < __n)
   {
     size_t __buf_len = _M_in_end - _M_in_cur;
     if (__buf_len > 0)
       {
         size_t __remaining = __n - __ret;
         size_t __len = std::min(__buf_len, __remaining);
//

whereas, in the latter:

//
 while (__ret < __n)
   {
     off_type __buf_len = _M_out_end - _M_out_cur;
     if (__buf_len > 0)
       {
         off_type __remaining = __n - __ret;
         off_type __len = std::min(__buf_len, __remaining);
//


Which one is right???


Paolo.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]