|
Boost-Commit : |
From: technews_at_[hidden]
Date: 2008-01-03 07:07:20
Author: turkanis
Date: 2008-01-03 07:07:18 EST (Thu, 03 Jan 2008)
New Revision: 42437
URL: http://svn.boost.org/trac/boost/changeset/42437
Log:
attempt to fix intel 10 on Linux and Intel 9-10 on Darwin by adding 'std::' all over the place, mostly for streamsize and pair
Text files modified:
branches/iostreams_dev/boost/iostreams/code_converter.hpp | 22 +++++++++++-----------
branches/iostreams_dev/boost/iostreams/copy.hpp | 16 ++++++++--------
branches/iostreams_dev/boost/iostreams/detail/adapter/direct_adapter.hpp | 8 ++++----
branches/iostreams_dev/boost/iostreams/detail/buffer.hpp | 10 +++++-----
branches/iostreams_dev/boost/iostreams/detail/streambuf/indirect_streambuf.hpp | 9 +++++----
branches/iostreams_dev/boost/iostreams/filter/aggregate.hpp | 10 +++++-----
branches/iostreams_dev/boost/iostreams/filter/gzip.hpp | 12 +++++-------
branches/iostreams_dev/boost/iostreams/filter/line.hpp | 6 +++---
branches/iostreams_dev/boost/iostreams/filter/symmetric.hpp | 13 +++++++------
branches/iostreams_dev/boost/iostreams/restrict.hpp | 13 +++++++------
branches/iostreams_dev/libs/iostreams/example/container_device.hpp | 15 ++++++++-------
branches/iostreams_dev/libs/iostreams/example/dictionary_filter.hpp | 7 ++++---
12 files changed, 72 insertions(+), 69 deletions(-)
Modified: branches/iostreams_dev/boost/iostreams/code_converter.hpp
==============================================================================
--- branches/iostreams_dev/boost/iostreams/code_converter.hpp (original)
+++ branches/iostreams_dev/boost/iostreams/code_converter.hpp 2008-01-03 07:07:18 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: branches/iostreams_dev/boost/iostreams/copy.hpp
==============================================================================
--- branches/iostreams_dev/boost/iostreams/copy.hpp (original)
+++ branches/iostreams_dev/boost/iostreams/copy.hpp 2008-01-03 07:07:18 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: branches/iostreams_dev/boost/iostreams/detail/adapter/direct_adapter.hpp
==============================================================================
--- branches/iostreams_dev/boost/iostreams/detail/adapter/direct_adapter.hpp (original)
+++ branches/iostreams_dev/boost/iostreams/detail/adapter/direct_adapter.hpp 2008-01-03 07:07:18 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: branches/iostreams_dev/boost/iostreams/detail/buffer.hpp
==============================================================================
--- branches/iostreams_dev/boost/iostreams/detail/buffer.hpp (original)
+++ branches/iostreams_dev/boost/iostreams/detail/buffer.hpp 2008-01-03 07:07:18 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: branches/iostreams_dev/boost/iostreams/detail/streambuf/indirect_streambuf.hpp
==============================================================================
--- branches/iostreams_dev/boost/iostreams/detail/streambuf/indirect_streambuf.hpp (original)
+++ branches/iostreams_dev/boost/iostreams/detail/streambuf/indirect_streambuf.hpp 2008-01-03 07:07:18 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: branches/iostreams_dev/boost/iostreams/filter/aggregate.hpp
==============================================================================
--- branches/iostreams_dev/boost/iostreams/filter/aggregate.hpp (original)
+++ branches/iostreams_dev/boost/iostreams/filter/aggregate.hpp 2008-01-03 07:07:18 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: branches/iostreams_dev/boost/iostreams/filter/gzip.hpp
==============================================================================
--- branches/iostreams_dev/boost/iostreams/filter/gzip.hpp (original)
+++ branches/iostreams_dev/boost/iostreams/filter/gzip.hpp 2008-01-03 07:07:18 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: branches/iostreams_dev/boost/iostreams/filter/line.hpp
==============================================================================
--- branches/iostreams_dev/boost/iostreams/filter/line.hpp (original)
+++ branches/iostreams_dev/boost/iostreams/filter/line.hpp 2008-01-03 07:07:18 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: branches/iostreams_dev/boost/iostreams/filter/symmetric.hpp
==============================================================================
--- branches/iostreams_dev/boost/iostreams/filter/symmetric.hpp (original)
+++ branches/iostreams_dev/boost/iostreams/filter/symmetric.hpp 2008-01-03 07:07:18 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: branches/iostreams_dev/boost/iostreams/restrict.hpp
==============================================================================
--- branches/iostreams_dev/boost/iostreams/restrict.hpp (original)
+++ branches/iostreams_dev/boost/iostreams/restrict.hpp 2008-01-03 07:07:18 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;
Modified: branches/iostreams_dev/libs/iostreams/example/container_device.hpp
==============================================================================
--- branches/iostreams_dev/libs/iostreams/example/container_device.hpp (original)
+++ branches/iostreams_dev/libs/iostreams/example/container_device.hpp 2008-01-03 07:07:18 EST (Thu, 03 Jan 2008)
@@ -30,8 +30,8 @@
std::streamsize read(char_type* s, std::streamsize n)
{
using namespace std;
- streamsize amt = static_cast<streamsize>(container_.size() - pos_);
- streamsize result = (min)(n, amt);
+ std::streamsize amt = static_cast<streamsize>(container_.size() - pos_);
+ std::streamsize result = (min)(n, amt);
if (result != 0) {
std::copy( container_.begin() + pos_,
container_.begin() + pos_ + result,
@@ -86,8 +86,9 @@
std::streamsize read(char_type* s, std::streamsize n)
{
using namespace std;
- streamsize amt = static_cast<streamsize>(container_.size() - pos_);
- streamsize result = (min)(n, amt);
+ std::streamsize amt =
+ static_cast<std::streamsize>(container_.size() - pos_);
+ std::streamsize result = (min)(n, amt);
if (result != 0) {
std::copy( container_.begin() + pos_,
container_.begin() + pos_ + result,
@@ -101,10 +102,10 @@
std::streamsize write(const char_type* s, std::streamsize n)
{
using namespace std;
- streamsize result = 0;
+ std::streamsize result = 0;
if (pos_ != container_.size()) {
- streamsize amt =
- static_cast<streamsize>(container_.size() - pos_);
+ std::streamsize amt =
+ static_cast<std::streamsize>(container_.size() - pos_);
result = (min)(n, amt);
std::copy(s, s + result, container_.begin() + pos_);
pos_ += result;
Modified: branches/iostreams_dev/libs/iostreams/example/dictionary_filter.hpp
==============================================================================
--- branches/iostreams_dev/libs/iostreams/example/dictionary_filter.hpp (original)
+++ branches/iostreams_dev/libs/iostreams/example/dictionary_filter.hpp 2008-01-03 07:07:18 EST (Thu, 03 Jan 2008)
@@ -51,7 +51,7 @@
if (c == EOF || !std::isalpha((unsigned char) c)) {
dictionary_.replace(current_word_);
cout.write( current_word_.data(),
- static_cast<streamsize>(current_word_.size()) );
+ static_cast<std::streamsize>(current_word_.size()) );
current_word_.erase();
if (c == EOF)
break;
@@ -167,8 +167,9 @@
bool write_current_word(Sink& dest)
{
using namespace std;
- streamsize amt = static_cast<streamsize>(current_word_.size() - off_);
- streamsize result =
+ std::streamsize amt =
+ static_cast<std::streamsize>(current_word_.size() - off_);
+ std::streamsize result =
iostreams::write(dest, current_word_.data() + off_, amt);
if (result == amt) {
current_word_.erase();
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