|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r63570 - in trunk/boost/asio: detail impl
From: chris_at_[hidden]
Date: 2010-07-04 02:57:33
Author: chris_kohlhoff
Date: 2010-07-04 02:57:32 EDT (Sun, 04 Jul 2010)
New Revision: 63570
URL: http://svn.boost.org/trac/boost/changeset/63570
Log:
Ensure arguments to handlers are passed as const types.
Text files modified:
trunk/boost/asio/detail/bind_handler.hpp | 20 +++++++++++++++-----
trunk/boost/asio/impl/read.hpp | 6 +++---
trunk/boost/asio/impl/read_at.hpp | 6 +++---
trunk/boost/asio/impl/write.hpp | 8 ++++----
trunk/boost/asio/impl/write_at.hpp | 8 ++++----
5 files changed, 29 insertions(+), 19 deletions(-)
Modified: trunk/boost/asio/detail/bind_handler.hpp
==============================================================================
--- trunk/boost/asio/detail/bind_handler.hpp (original)
+++ trunk/boost/asio/detail/bind_handler.hpp 2010-07-04 02:57:32 EDT (Sun, 04 Jul 2010)
@@ -37,7 +37,7 @@
void operator()()
{
- handler_(arg1_);
+ handler_(static_cast<const Arg1&>(arg1_));
}
void operator()() const
@@ -94,7 +94,8 @@
void operator()()
{
- handler_(arg1_, arg2_);
+ handler_(static_cast<const Arg1&>(arg1_),
+ static_cast<const Arg2&>(arg2_));
}
void operator()() const
@@ -154,7 +155,9 @@
void operator()()
{
- handler_(arg1_, arg2_, arg3_);
+ handler_(static_cast<const Arg1&>(arg1_),
+ static_cast<const Arg2&>(arg2_),
+ static_cast<const Arg3&>(arg3_));
}
void operator()() const
@@ -218,7 +221,10 @@
void operator()()
{
- handler_(arg1_, arg2_, arg3_, arg4_);
+ handler_(static_cast<const Arg1&>(arg1_),
+ static_cast<const Arg2&>(arg2_),
+ static_cast<const Arg3&>(arg3_),
+ static_cast<const Arg4&>(arg4_));
}
void operator()() const
@@ -289,7 +295,11 @@
void operator()()
{
- handler_(arg1_, arg2_, arg3_, arg4_, arg5_);
+ handler_(static_cast<const Arg1&>(arg1_),
+ static_cast<const Arg2&>(arg2_),
+ static_cast<const Arg3&>(arg3_),
+ static_cast<const Arg4&>(arg4_),
+ static_cast<const Arg5&>(arg5_));
}
void operator()() const
Modified: trunk/boost/asio/impl/read.hpp
==============================================================================
--- trunk/boost/asio/impl/read.hpp (original)
+++ trunk/boost/asio/impl/read.hpp 2010-07-04 02:57:32 EDT (Sun, 04 Jul 2010)
@@ -160,7 +160,7 @@
break;
}
- handler_(ec, total_transferred_);
+ handler_(ec, static_cast<const std::size_t>(total_transferred_));
}
}
@@ -212,7 +212,7 @@
break;
}
- handler_(ec, total_transferred_);
+ handler_(ec, static_cast<const std::size_t>(total_transferred_));
}
}
@@ -317,7 +317,7 @@
break;
}
- handler_(ec, total_transferred_);
+ handler_(ec, static_cast<const std::size_t>(total_transferred_));
}
}
Modified: trunk/boost/asio/impl/read_at.hpp
==============================================================================
--- trunk/boost/asio/impl/read_at.hpp (original)
+++ trunk/boost/asio/impl/read_at.hpp 2010-07-04 02:57:32 EDT (Sun, 04 Jul 2010)
@@ -173,7 +173,7 @@
break;
}
- handler_(ec, total_transferred_);
+ handler_(ec, static_cast<const std::size_t>(total_transferred_));
}
}
@@ -226,7 +226,7 @@
break;
}
- handler_(ec, total_transferred_);
+ handler_(ec, static_cast<const std::size_t>(total_transferred_));
}
}
@@ -338,7 +338,7 @@
break;
}
- handler_(ec, total_transferred_);
+ handler_(ec, static_cast<const std::size_t>(total_transferred_));
}
}
Modified: trunk/boost/asio/impl/write.hpp
==============================================================================
--- trunk/boost/asio/impl/write.hpp (original)
+++ trunk/boost/asio/impl/write.hpp 2010-07-04 02:57:32 EDT (Sun, 04 Jul 2010)
@@ -146,7 +146,7 @@
break;
}
- handler_(ec, total_transferred_);
+ handler_(ec, static_cast<const std::size_t>(total_transferred_));
}
}
@@ -198,7 +198,7 @@
break;
}
- handler_(ec, total_transferred_);
+ handler_(ec, static_cast<const std::size_t>(total_transferred_));
}
}
@@ -249,7 +249,7 @@
break;
}
- handler_(ec, total_transferred_);
+ handler_(ec, static_cast<const std::size_t>(total_transferred_));
}
}
@@ -328,7 +328,7 @@
}
void operator()(const boost::system::error_code& ec,
- std::size_t bytes_transferred)
+ const std::size_t bytes_transferred)
{
streambuf_.consume(bytes_transferred);
handler_(ec, bytes_transferred);
Modified: trunk/boost/asio/impl/write_at.hpp
==============================================================================
--- trunk/boost/asio/impl/write_at.hpp (original)
+++ trunk/boost/asio/impl/write_at.hpp 2010-07-04 02:57:32 EDT (Sun, 04 Jul 2010)
@@ -157,7 +157,7 @@
break;
}
- handler_(ec, total_transferred_);
+ handler_(ec, static_cast<const std::size_t>(total_transferred_));
}
}
@@ -211,7 +211,7 @@
break;
}
- handler_(ec, total_transferred_);
+ handler_(ec, static_cast<const std::size_t>(total_transferred_));
}
}
@@ -264,7 +264,7 @@
break;
}
- handler_(ec, total_transferred_);
+ handler_(ec, static_cast<const std::size_t>(total_transferred_));
}
}
@@ -347,7 +347,7 @@
}
void operator()(const boost::system::error_code& ec,
- std::size_t bytes_transferred)
+ const std::size_t bytes_transferred)
{
streambuf_.consume(bytes_transferred);
handler_(ec, bytes_transferred);
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