|
Boost-Commit : |
From: technews_at_[hidden]
Date: 2008-01-03 14:28:02
Author: turkanis
Date: 2008-01-03 14:28:01 EST (Thu, 03 Jan 2008)
New Revision: 42441
URL: http://svn.boost.org/trac/boost/changeset/42441
Log:
merged changes from iostreams_dev not handled by svnmerge for some reason; use BOOST_NO_RESULT_OF workaround even for late versions of Borland that supposedly have result_of; added 'std::' all over the place for Intel on Linux and Darwin
Text files modified:
trunk/boost/iostreams/code_converter.hpp | 22 +++++++++++-----------
trunk/boost/iostreams/copy.hpp | 16 ++++++++--------
trunk/boost/iostreams/detail/adapter/direct_adapter.hpp | 8 ++++----
trunk/boost/iostreams/detail/buffer.hpp | 10 +++++-----
trunk/boost/iostreams/detail/execute.hpp | 5 +++--
trunk/boost/iostreams/detail/streambuf/indirect_streambuf.hpp | 9 +++++----
trunk/boost/iostreams/filter/aggregate.hpp | 10 +++++-----
trunk/boost/iostreams/filter/gzip.hpp | 12 +++++-------
trunk/boost/iostreams/filter/line.hpp | 6 +++---
trunk/boost/iostreams/filter/symmetric.hpp | 13 +++++++------
trunk/boost/iostreams/positioning.hpp | 10 ++++++----
trunk/boost/iostreams/restrict.hpp | 13 +++++++------
12 files changed, 69 insertions(+), 65 deletions(-)
Modified: trunk/boost/iostreams/code_converter.hpp
==============================================================================
--- trunk/boost/iostreams/code_converter.hpp (original)
+++ trunk/boost/iostreams/code_converter.hpp 2008-01-03 14:28:01 EST (Thu, 03 Jan 2008)
@@ -314,7 +314,7 @@
using namespace std;
const extern_type* next; // Next external char.
intern_type* nint; // Next internal char.
- streamsize total = 0; // Characters read.
+ std::streamsize total = 0; // Characters read.
int status = iostreams::char_traits<char>::good();
bool partial = false;
buffer_type& buf = in();
@@ -330,12 +330,12 @@
}
// Convert.
- codecvt_base::result result =
+ std::codecvt_base::result result =
cvt().in( buf.state(),
buf.ptr(), buf.eptr(), next,
s + total, s + n, nint );
buf.ptr() += next - buf.ptr();
- total = static_cast<streamsize>(nint - s);
+ total = static_cast<std::streamsize>(nint - s);
switch (result) {
case codecvt_base::partial:
@@ -345,8 +345,8 @@
break;
case codecvt_base::noconv:
{
- streamsize amt =
- std::min<streamsize>(next - buf.ptr(), n - total);
+ std::streamsize amt =
+ std::min<std::streamsize>(next - buf.ptr(), n - total);
detail::strncpy_if_same(s + total, buf.ptr(), amt);
total += amt;
}
@@ -370,7 +370,7 @@
buffer_type& buf = out();
extern_type* next; // Next external char.
const intern_type* nint; // Next internal char.
- streamsize total = 0; // Characters written.
+ std::streamsize total = 0; // Characters written.
bool partial = false;
while (total < n) {
@@ -383,7 +383,7 @@
}
// Convert.
- codecvt_base::result result =
+ std::codecvt_base::result result =
cvt().out( buf.state(),
s + total, s + n, nint,
buf.eptr(), buf.end(), next );
@@ -394,13 +394,13 @@
case codecvt_base::partial:
partial = true; // Fall through.
case codecvt_base::ok:
- total = static_cast<streamsize>(nint - s);
+ total = static_cast<std::streamsize>(nint - s);
break;
case codecvt_base::noconv:
{
- streamsize amt =
- std::min<streamsize>( nint - total - s,
- buf.end() - buf.eptr() );
+ std::streamsize amt =
+ std::min<std::streamsize>( nint - total - s,
+ buf.end() - buf.eptr() );
detail::strncpy_if_same(buf.eptr(), s + total, amt);
total += amt;
}
Modified: trunk/boost/iostreams/copy.hpp
==============================================================================
--- trunk/boost/iostreams/copy.hpp (original)
+++ trunk/boost/iostreams/copy.hpp 2008-01-03 14:28:01 EST (Thu, 03 Jan 2008)
@@ -56,11 +56,11 @@
{
using namespace std;
typedef typename char_type_of<Source>::type char_type;
- typedef pair<char_type*, char_type*> pair_type;
+ typedef std::pair<char_type*, char_type*> pair_type;
pair_type p1 = iostreams::input_sequence(src);
pair_type p2 = iostreams::output_sequence(snk);
- streamsize total =
- static_cast<streamsize>(
+ std::streamsize total =
+ static_cast<std::streamsize>(
(std::min)(p1.second - p1.first, p2.second - p2.first)
);
std::copy(p1.first, p1.first + total, p2.first);
@@ -75,10 +75,10 @@
{
using namespace std;
typedef typename char_type_of<Source>::type char_type;
- typedef pair<char_type*, char_type*> pair_type;
+ typedef std::pair<char_type*, char_type*> pair_type;
pair_type p = iostreams::input_sequence(src);
std::streamsize size, total;
- for ( total = 0, size = static_cast<streamsize>(p.second - p.first);
+ for ( total = 0, size = static_cast<std::streamsize>(p.second - p.first);
total < size; )
{
std::streamsize amt =
@@ -96,13 +96,13 @@
{
using namespace std;
typedef typename char_type_of<Source>::type char_type;
- typedef pair<char_type*, char_type*> pair_type;
+ typedef std::pair<char_type*, char_type*> pair_type;
detail::basic_buffer<char_type> buf(buffer_size);
pair_type p = snk.output_sequence();
- streamsize total = 0;
+ std::streamsize total = 0;
ptrdiff_t capacity = p.second - p.first;
while (true) {
- streamsize amt =
+ std::streamsize amt =
iostreams::read(
src,
buf.data(),
Modified: trunk/boost/iostreams/detail/adapter/direct_adapter.hpp
==============================================================================
--- trunk/boost/iostreams/detail/adapter/direct_adapter.hpp (original)
+++ trunk/boost/iostreams/detail/adapter/direct_adapter.hpp 2008-01-03 14:28:01 EST (Thu, 03 Jan 2008)
@@ -193,9 +193,9 @@
{
using namespace std;
pointers& get = ptrs_.first();
- streamsize avail =
- static_cast<streamsize>(get.end - get.ptr);
- streamsize result = (std::min)(n, avail);
+ std::streamsize avail =
+ static_cast<std::streamsize>(get.end - get.ptr);
+ std::streamsize result = (std::min)(n, avail);
std::copy(get.ptr, get.ptr + result, s);
get.ptr += result;
return result != 0 ? result : -1;
@@ -207,7 +207,7 @@
{
using namespace std;
pointers& put = ptrs_.second();
- if (n > static_cast<streamsize>(put.end - put.ptr))
+ if (n > static_cast<std::streamsize>(put.end - put.ptr))
throw write_area_exhausted();
std::copy(s, s + n, put.ptr);
put.ptr += n;
Modified: trunk/boost/iostreams/detail/buffer.hpp
==============================================================================
--- trunk/boost/iostreams/detail/buffer.hpp (original)
+++ trunk/boost/iostreams/detail/buffer.hpp 2008-01-03 14:28:01 EST (Thu, 03 Jan 2008)
@@ -95,11 +95,11 @@
typename int_type_of<Source>::type fill(Source& src)
{
using namespace std;
- streamsize keep;
- if ((keep = static_cast<streamsize>(eptr_ - ptr_)) > 0)
+ std::streamsize keep;
+ if ((keep = static_cast<std::streamsize>(eptr_ - ptr_)) > 0)
traits_type::move(this->data(), ptr_, keep);
set(0, keep);
- streamsize result =
+ std::streamsize result =
iostreams::read(src, this->data() + keep, this->size() - keep);
if (result != -1)
this->set(0, keep + result);
@@ -121,8 +121,8 @@
bool flush(Sink& dest)
{
using namespace std;
- streamsize amt = static_cast<std::streamsize>(eptr_ - ptr_);
- streamsize result = iostreams::write_if(dest, ptr_, amt);
+ std::streamsize amt = static_cast<std::streamsize>(eptr_ - ptr_);
+ std::streamsize result = iostreams::write_if(dest, ptr_, amt);
if (result < amt) {
traits_type::move( this->data(),
ptr_ + result,
Modified: trunk/boost/iostreams/detail/execute.hpp
==============================================================================
--- trunk/boost/iostreams/detail/execute.hpp (original)
+++ trunk/boost/iostreams/detail/execute.hpp 2008-01-03 14:28:01 EST (Thu, 03 Jan 2008)
@@ -70,11 +70,12 @@
// returning void and non-void.
template< typename Op,
typename Result = // VC6.5 workaround.
- #ifndef BOOST_NO_RESULT_OF
+ #if !defined(BOOST_NO_RESULT_OF) && \
+ !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x592))
typename boost::result_of<Op()>::type
#else
BOOST_DEDUCED_TYPENAME Op::result_type
- #endif
+ #endif
>
struct execute_traits
: execute_traits_impl<Result>
Modified: trunk/boost/iostreams/detail/streambuf/indirect_streambuf.hpp
==============================================================================
--- trunk/boost/iostreams/detail/streambuf/indirect_streambuf.hpp (original)
+++ trunk/boost/iostreams/detail/streambuf/indirect_streambuf.hpp 2008-01-03 14:28:01 EST (Thu, 03 Jan 2008)
@@ -167,7 +167,7 @@
// Construct input buffer.
if (can_read()) {
pback_size_ = (std::max)(2, pback_size); // STLPort needs 2.
- streamsize size =
+ std::streamsize size =
pback_size_ +
( buffer_size ? buffer_size: 1 );
in().resize(size);
@@ -238,8 +238,9 @@
if (gptr() < egptr()) return traits_type::to_int_type(*gptr());
// Fill putback buffer.
- streamsize keep = (std::min)( static_cast<streamsize>(gptr() - eback()),
- pback_size_ );
+ std::streamsize keep =
+ (std::min)( static_cast<std::streamsize>(gptr() - eback()),
+ pback_size_ );
if (keep)
traits_type::move( buf.data() + (pback_size_ - keep),
gptr() - keep, keep );
@@ -250,7 +251,7 @@
buf.data() + pback_size_ );
// Read from source.
- streamsize chars =
+ std::streamsize chars =
obj().read(buf.data() + pback_size_, buf.size() - pback_size_, next_);
if (chars == -1) {
this->set_true_eof(true);
Modified: trunk/boost/iostreams/filter/aggregate.hpp
==============================================================================
--- trunk/boost/iostreams/filter/aggregate.hpp (original)
+++ trunk/boost/iostreams/filter/aggregate.hpp 2008-01-03 14:28:01 EST (Thu, 03 Jan 2008)
@@ -58,8 +58,8 @@
state_ |= f_read;
if (!(state_ & f_eof))
do_read(src);
- streamsize amt =
- (std::min)(n, static_cast<streamsize>(data_.size() - ptr_));
+ std::streamsize amt =
+ (std::min)(n, static_cast<std::streamsize>(data_.size() - ptr_));
if (amt) {
BOOST_IOSTREAMS_CHAR_TRAITS(char_type)::copy(s, &data_[ptr_], amt);
ptr_ += amt;
@@ -110,9 +110,9 @@
using std::streamsize;
vector_type data;
while (true) {
- const streamsize size = default_device_buffer_size;
- Ch buf[size];
- streamsize amt;
+ const std::streamsize size = default_device_buffer_size;
+ Ch buf[size];
+ std::streamsize amt;
if ((amt = boost::iostreams::read(src, buf, size)) == -1)
break;
data.insert(data.end(), buf, buf + amt);
Modified: trunk/boost/iostreams/filter/gzip.hpp
==============================================================================
--- trunk/boost/iostreams/filter/gzip.hpp (original)
+++ trunk/boost/iostreams/filter/gzip.hpp 2008-01-03 14:28:01 EST (Thu, 03 Jan 2008)
@@ -185,8 +185,7 @@
template<typename Source>
std::streamsize read(Source& src, char_type* s, std::streamsize n)
{
- using namespace std;
- streamsize result = 0;
+ std::streamsize result = 0;
// Read header.
if (!(flags_ & f_header_done))
@@ -196,7 +195,7 @@
if (!(flags_ & f_body_done)) {
// Read from basic_zlib_filter.
- streamsize amt = base_type::read(src, s + result, n - result);
+ std::streamsize amt = base_type::read(src, s + result, n - result);
if (amt != -1) {
result += amt;
if (amt < n - result) { // Double-check for EOF.
@@ -557,10 +556,9 @@
std::streamsize basic_gzip_compressor<Alloc>::read_string
(char* s, std::streamsize n, std::string& str)
{
- using namespace std;
- streamsize avail =
- static_cast<streamsize>(str.size() - offset_);
- streamsize amt = (std::min)(avail, n);
+ std::streamsize avail =
+ static_cast<std::streamsize>(str.size() - offset_);
+ std::streamsize amt = (std::min)(avail, n);
std::copy( str.data() + offset_,
str.data() + offset_ + amt,
s );
Modified: trunk/boost/iostreams/filter/line.hpp
==============================================================================
--- trunk/boost/iostreams/filter/line.hpp (original)
+++ trunk/boost/iostreams/filter/line.hpp 2008-01-03 14:28:01 EST (Thu, 03 Jan 2008)
@@ -70,7 +70,7 @@
state_ |= f_read;
// Handle unfinished business.
- streamsize result = 0;
+ std::streamsize result = 0;
if (!cur_line_.empty() && (result = read_line(s, n)) == n)
return n;
@@ -143,8 +143,8 @@
std::streamsize read_line(char_type* s, std::streamsize n)
{
using namespace std;
- streamsize result =
- (std::min) (n, static_cast<streamsize>(cur_line_.size()));
+ std::streamsize result =
+ (std::min) (n, static_cast<std::streamsize>(cur_line_.size()));
traits_type::copy(s, cur_line_.data(), result);
cur_line_.erase(0, result);
return result;
Modified: trunk/boost/iostreams/filter/symmetric.hpp
==============================================================================
--- trunk/boost/iostreams/filter/symmetric.hpp (original)
+++ trunk/boost/iostreams/filter/symmetric.hpp 2008-01-03 14:28:01 EST (Thu, 03 Jan 2008)
@@ -115,7 +115,9 @@
!filter().filter(next, buf.eptr(), next_s, end_s, flush);
buf.ptr() = buf.data() + (next - buf.data());
if (done)
- return detail::check_eof(static_cast<streamsize>(next_s - s));
+ return detail::check_eof(
+ static_cast<std::streamsize>(next_s - s)
+ );
}
// If no more characters are available without blocking, or
@@ -123,7 +125,7 @@
if ( status == f_would_block && buf.ptr() == buf.eptr() ||
next_s == end_s )
{
- return static_cast<streamsize>(next_s - s);
+ return static_cast<std::streamsize>(next_s - s);
}
// Fill buffer.
@@ -215,11 +217,10 @@
template<typename Sink>
bool flush(Sink& snk, mpl::true_)
{
- using std::streamsize;
typedef char_traits<char_type> traits_type;
- streamsize amt =
- static_cast<streamsize>(buf().ptr() - buf().data());
- streamsize result =
+ std::streamsize amt =
+ static_cast<std::streamsize>(buf().ptr() - buf().data());
+ std::streamsize result =
boost::iostreams::write(snk, buf().data(), amt);
if (result < amt && result > 0)
traits_type::move(buf().data(), buf().data() + result, amt - result);
Modified: trunk/boost/iostreams/positioning.hpp
==============================================================================
--- trunk/boost/iostreams/positioning.hpp (original)
+++ trunk/boost/iostreams/positioning.hpp 2008-01-03 14:28:01 EST (Thu, 03 Jan 2008)
@@ -68,8 +68,8 @@
{
// Use implementation-specific member function seekpos().
return fpos_t_to_offset(pos.seekpos()) +
- stream_offset(std::streamoff(pos)) -
- stream_offset(std::streamoff(pos.seekpos()));
+ static_cast<stream_offset>(static_cast<std::streamoff>(pos)) -
+ static_cast<stream_offset>(_FPOSOFF(pos.seekpos()));
}
# else // # if defined(_CPPLIB_VER) //----------------------------------------//
@@ -80,8 +80,10 @@
{
// use implementation-specific member function get_fpos_t().
return fpos_t_to_offset(pos.get_fpos_t()) +
- stream_offset(std::streamoff(pos)) -
- stream_offset(std::streamoff(pos.get_fpos_t()));
+ static_cast<stream_offset>(static_cast<std::streamoff>(pos)) -
+ static_cast<stream_offset>(
+ static_cast<std::streamoff>(pos.get_fpos_t())
+ );
}
# endif // # if defined(_CPPLIB_VER) //---------------------------------------//
Modified: trunk/boost/iostreams/restrict.hpp
==============================================================================
--- trunk/boost/iostreams/restrict.hpp (original)
+++ trunk/boost/iostreams/restrict.hpp 2008-01-03 14:28:01 EST (Thu, 03 Jan 2008)
@@ -128,11 +128,12 @@
using namespace std;
if (!open_)
open(src, BOOST_IOS::in);
- streamsize amt =
+ std::streamsize amt =
end_ != -1 ?
- (std::min) (n, static_cast<streamsize>(end_ - pos_)) :
+ (std::min) (n, static_cast<std::streamsize>(end_ - pos_)) :
n;
- streamsize result = iostreams::read(this->component(), src, s, amt);
+ std::streamsize result =
+ iostreams::read(this->component(), src, s, amt);
if (result != -1)
pos_ += result;
return result;
@@ -331,11 +332,11 @@
(char_type* s, std::streamsize n)
{
using namespace std;
- streamsize amt =
+ std::streamsize amt =
end_ != -1 ?
- (std::min) (n, static_cast<streamsize>(end_ - pos_)) :
+ (std::min) (n, static_cast<std::streamsize>(end_ - pos_)) :
n;
- streamsize result = iostreams::read(this->component(), s, amt);
+ std::streamsize result = iostreams::read(this->component(), s, amt);
if (result != -1)
pos_ += result;
return result;
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk