Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r54393 - in trunk: boost/asio/ssl/detail libs/asio/example/echo libs/asio/example/http/server libs/asio/example/http/server2 libs/asio/example/http/server3 libs/asio/example/local libs/asio/example/porthopper libs/asio/example/services libs/asio/example/timeouts libs/asio/test
From: chris_at_[hidden]
Date: 2009-06-27 03:07:45


Author: chris_kohlhoff
Date: 2009-06-27 03:07:40 EDT (Sat, 27 Jun 2009)
New Revision: 54393
URL: http://svn.boost.org/trac/boost/changeset/54393

Log:
Fix various g++ warnings. Ref #1341.

Text files modified:
   trunk/boost/asio/ssl/detail/openssl_init.hpp | 9 +++++++--
   trunk/boost/asio/ssl/detail/openssl_stream_service.hpp | 10 +++++-----
   trunk/libs/asio/example/echo/async_udp_echo_server.cpp | 3 ++-
   trunk/libs/asio/example/http/server/request_handler.cpp | 2 +-
   trunk/libs/asio/example/http/server/request_parser.cpp | 2 +-
   trunk/libs/asio/example/http/server2/request_handler.cpp | 2 +-
   trunk/libs/asio/example/http/server2/request_parser.cpp | 2 +-
   trunk/libs/asio/example/http/server3/request_handler.cpp | 2 +-
   trunk/libs/asio/example/http/server3/request_parser.cpp | 2 +-
   trunk/libs/asio/example/local/connect_pair.cpp | 2 +-
   trunk/libs/asio/example/porthopper/server.cpp | 2 +-
   trunk/libs/asio/example/services/logger_service.hpp | 2 +-
   trunk/libs/asio/example/timeouts/datagram_receive_timeout.cpp | 3 ++-
   trunk/libs/asio/test/read.cpp | 4 ++--
   trunk/libs/asio/test/read_at.cpp | 4 ++--
   trunk/libs/asio/test/write.cpp | 4 ++--
   trunk/libs/asio/test/write_at.cpp | 4 ++--
   17 files changed, 33 insertions(+), 26 deletions(-)

Modified: trunk/boost/asio/ssl/detail/openssl_init.hpp
==============================================================================
--- trunk/boost/asio/ssl/detail/openssl_init.hpp (original)
+++ trunk/boost/asio/ssl/detail/openssl_init.hpp 2009-06-27 03:07:40 EDT (Sat, 27 Jun 2009)
@@ -19,6 +19,7 @@
 #include <boost/asio/detail/push_options.hpp>
 
 #include <boost/asio/detail/push_options.hpp>
+#include <cstring>
 #include <vector>
 #include <boost/assert.hpp>
 #include <boost/config.hpp>
@@ -100,7 +101,7 @@
     }
 
     static void openssl_locking_func(int mode, int n,
- const char *file, int line)
+ const char* /*file*/, int /*line*/)
     {
       if (mode & CRYPTO_LOCK)
         instance()->mutexes_[n]->lock();
@@ -122,7 +123,11 @@
   openssl_init()
     : ref_(do_init::instance())
   {
- while (&instance_ == 0); // Ensure openssl_init::instance_ is linked in.
+ using namespace std; // For memmove.
+
+ // Ensure openssl_init::instance_ is linked in.
+ openssl_init* tmp = &instance_;
+ memmove(&tmp, &tmp, sizeof(openssl_init*));
   }
 
   // Destructor.

Modified: trunk/boost/asio/ssl/detail/openssl_stream_service.hpp
==============================================================================
--- trunk/boost/asio/ssl/detail/openssl_stream_service.hpp (original)
+++ trunk/boost/asio/ssl/detail/openssl_stream_service.hpp 2009-06-27 03:07:40 EDT (Sat, 27 Jun 2009)
@@ -184,7 +184,7 @@
 
   // Create a new stream implementation.
   template <typename Stream, typename Context_Service>
- void create(impl_type& impl, Stream& next_layer,
+ void create(impl_type& impl, Stream& /*next_layer*/,
       basic_context<Context_Service>& context)
   {
     impl = new impl_struct;
@@ -199,7 +199,7 @@
 
   // Destroy a stream implementation.
   template <typename Stream>
- void destroy(impl_type& impl, Stream& next_layer)
+ void destroy(impl_type& impl, Stream& /*next_layer*/)
   {
     if (impl != 0)
     {
@@ -475,8 +475,8 @@
 
   // Peek at the incoming data on the stream.
   template <typename Stream, typename Mutable_Buffers>
- std::size_t peek(impl_type& impl, Stream& next_layer,
- const Mutable_Buffers& buffers, boost::system::error_code& ec)
+ std::size_t peek(impl_type& /*impl*/, Stream& /*next_layer*/,
+ const Mutable_Buffers& /*buffers*/, boost::system::error_code& ec)
   {
     ec = boost::system::error_code();
     return 0;
@@ -484,7 +484,7 @@
 
   // Determine the amount of data that may be read without blocking.
   template <typename Stream>
- std::size_t in_avail(impl_type& impl, Stream& next_layer,
+ std::size_t in_avail(impl_type& /*impl*/, Stream& /*next_layer*/,
       boost::system::error_code& ec)
   {
     ec = boost::system::error_code();

Modified: trunk/libs/asio/example/echo/async_udp_echo_server.cpp
==============================================================================
--- trunk/libs/asio/example/echo/async_udp_echo_server.cpp (original)
+++ trunk/libs/asio/example/echo/async_udp_echo_server.cpp 2009-06-27 03:07:40 EDT (Sat, 27 Jun 2009)
@@ -50,7 +50,8 @@
     }
   }
 
- void handle_send_to(const boost::system::error_code& error, size_t bytes_sent)
+ void handle_send_to(const boost::system::error_code& /*error*/,
+ size_t /*bytes_sent*/)
   {
     socket_.async_receive_from(
         boost::asio::buffer(data_, max_length), sender_endpoint_,

Modified: trunk/libs/asio/example/http/server/request_handler.cpp
==============================================================================
--- trunk/libs/asio/example/http/server/request_handler.cpp (original)
+++ trunk/libs/asio/example/http/server/request_handler.cpp 2009-06-27 03:07:40 EDT (Sat, 27 Jun 2009)
@@ -89,7 +89,7 @@
     {
       if (i + 3 <= in.size())
       {
- int value;
+ int value = 0;
         std::istringstream is(in.substr(i + 1, 2));
         if (is >> std::hex >> value)
         {

Modified: trunk/libs/asio/example/http/server/request_parser.cpp
==============================================================================
--- trunk/libs/asio/example/http/server/request_parser.cpp (original)
+++ trunk/libs/asio/example/http/server/request_parser.cpp 2009-06-27 03:07:40 EDT (Sat, 27 Jun 2009)
@@ -300,7 +300,7 @@
 
 bool request_parser::is_ctl(int c)
 {
- return c >= 0 && c <= 31 || c == 127;
+ return (c >= 0 && c <= 31) || (c == 127);
 }
 
 bool request_parser::is_tspecial(int c)

Modified: trunk/libs/asio/example/http/server2/request_handler.cpp
==============================================================================
--- trunk/libs/asio/example/http/server2/request_handler.cpp (original)
+++ trunk/libs/asio/example/http/server2/request_handler.cpp 2009-06-27 03:07:40 EDT (Sat, 27 Jun 2009)
@@ -89,7 +89,7 @@
     {
       if (i + 3 <= in.size())
       {
- int value;
+ int value = 0;
         std::istringstream is(in.substr(i + 1, 2));
         if (is >> std::hex >> value)
         {

Modified: trunk/libs/asio/example/http/server2/request_parser.cpp
==============================================================================
--- trunk/libs/asio/example/http/server2/request_parser.cpp (original)
+++ trunk/libs/asio/example/http/server2/request_parser.cpp 2009-06-27 03:07:40 EDT (Sat, 27 Jun 2009)
@@ -300,7 +300,7 @@
 
 bool request_parser::is_ctl(int c)
 {
- return c >= 0 && c <= 31 || c == 127;
+ return (c >= 0 && c <= 31) || (c == 127);
 }
 
 bool request_parser::is_tspecial(int c)

Modified: trunk/libs/asio/example/http/server3/request_handler.cpp
==============================================================================
--- trunk/libs/asio/example/http/server3/request_handler.cpp (original)
+++ trunk/libs/asio/example/http/server3/request_handler.cpp 2009-06-27 03:07:40 EDT (Sat, 27 Jun 2009)
@@ -89,7 +89,7 @@
     {
       if (i + 3 <= in.size())
       {
- int value;
+ int value = 0;
         std::istringstream is(in.substr(i + 1, 2));
         if (is >> std::hex >> value)
         {

Modified: trunk/libs/asio/example/http/server3/request_parser.cpp
==============================================================================
--- trunk/libs/asio/example/http/server3/request_parser.cpp (original)
+++ trunk/libs/asio/example/http/server3/request_parser.cpp 2009-06-27 03:07:40 EDT (Sat, 27 Jun 2009)
@@ -300,7 +300,7 @@
 
 bool request_parser::is_ctl(int c)
 {
- return c >= 0 && c <= 31 || c == 127;
+ return (c >= 0 && c <= 31) || (c == 127);
 }
 
 bool request_parser::is_tspecial(int c)

Modified: trunk/libs/asio/example/local/connect_pair.cpp
==============================================================================
--- trunk/libs/asio/example/local/connect_pair.cpp (original)
+++ trunk/libs/asio/example/local/connect_pair.cpp 2009-06-27 03:07:40 EDT (Sat, 27 Jun 2009)
@@ -95,7 +95,7 @@
   }
 }
 
-int main(int argc, char* argv[])
+int main()
 {
   try
   {

Modified: trunk/libs/asio/example/porthopper/server.cpp
==============================================================================
--- trunk/libs/asio/example/porthopper/server.cpp (original)
+++ trunk/libs/asio/example/porthopper/server.cpp 2009-06-27 03:07:40 EDT (Sat, 27 Jun 2009)
@@ -82,7 +82,7 @@
   }
 
   void handle_control_request_timer(tcp_socket_ptr socket,
- control_request_ptr request, timer_ptr delay_timer)
+ control_request_ptr request, timer_ptr /*delay_timer*/)
   {
     // Determine what address this client is connected from, since
     // subscriptions must be stored on the server as a complete endpoint, not

Modified: trunk/libs/asio/example/services/logger_service.hpp
==============================================================================
--- trunk/libs/asio/example/services/logger_service.hpp (original)
+++ trunk/libs/asio/example/services/logger_service.hpp 2009-06-27 03:07:40 EDT (Sat, 27 Jun 2009)
@@ -89,7 +89,7 @@
   /// output file for all logger instances, and so the impl parameter is not
   /// actually needed. It is retained here to illustrate how service functions
   /// are typically defined.
- void use_file(impl_type& impl, const std::string& file)
+ void use_file(impl_type& /*impl*/, const std::string& file)
   {
     // Pass the work of opening the file to the background thread.
     work_io_service_.post(boost::bind(

Modified: trunk/libs/asio/example/timeouts/datagram_receive_timeout.cpp
==============================================================================
--- trunk/libs/asio/example/timeouts/datagram_receive_timeout.cpp (original)
+++ trunk/libs/asio/example/timeouts/datagram_receive_timeout.cpp 2009-06-27 03:07:40 EDT (Sat, 27 Jun 2009)
@@ -34,7 +34,8 @@
     timer_.async_wait(boost::bind(&datagram_handler::close, this));
   }
 
- void handle_receive_from(const boost::system::error_code& err, size_t length)
+ void handle_receive_from(const boost::system::error_code& err,
+ size_t /*length*/)
   {
     if (err)
     {

Modified: trunk/libs/asio/test/read.cpp
==============================================================================
--- trunk/libs/asio/test/read.cpp (original)
+++ trunk/libs/asio/test/read.cpp 2009-06-27 03:07:40 EDT (Sat, 27 Jun 2009)
@@ -163,13 +163,13 @@
 }
 
 bool old_style_transfer_all(const boost::system::error_code& ec,
- size_t bytes_transferred)
+ size_t /*bytes_transferred*/)
 {
   return !!ec;
 }
 
 size_t short_transfer(const boost::system::error_code& ec,
- size_t bytes_transferred)
+ size_t /*bytes_transferred*/)
 {
   return !!ec ? 0 : 3;
 }

Modified: trunk/libs/asio/test/read_at.cpp
==============================================================================
--- trunk/libs/asio/test/read_at.cpp (original)
+++ trunk/libs/asio/test/read_at.cpp 2009-06-27 03:07:40 EDT (Sat, 27 Jun 2009)
@@ -188,13 +188,13 @@
 }
 
 bool old_style_transfer_all(const boost::system::error_code& ec,
- size_t bytes_transferred)
+ size_t /*bytes_transferred*/)
 {
   return !!ec;
 }
 
 size_t short_transfer(const boost::system::error_code& ec,
- size_t bytes_transferred)
+ size_t /*bytes_transferred*/)
 {
   return !!ec ? 0 : 3;
 }

Modified: trunk/libs/asio/test/write.cpp
==============================================================================
--- trunk/libs/asio/test/write.cpp (original)
+++ trunk/libs/asio/test/write.cpp 2009-06-27 03:07:40 EDT (Sat, 27 Jun 2009)
@@ -160,13 +160,13 @@
 }
 
 bool old_style_transfer_all(const boost::system::error_code& ec,
- size_t bytes_transferred)
+ size_t /*bytes_transferred*/)
 {
   return !!ec;
 }
 
 size_t short_transfer(const boost::system::error_code& ec,
- size_t bytes_transferred)
+ size_t /*bytes_transferred*/)
 {
   return !!ec ? 0 : 3;
 }

Modified: trunk/libs/asio/test/write_at.cpp
==============================================================================
--- trunk/libs/asio/test/write_at.cpp (original)
+++ trunk/libs/asio/test/write_at.cpp 2009-06-27 03:07:40 EDT (Sat, 27 Jun 2009)
@@ -174,13 +174,13 @@
 }
 
 bool old_style_transfer_all(const boost::system::error_code& ec,
- size_t bytes_transferred)
+ size_t /*bytes_transferred*/)
 {
   return !!ec;
 }
 
 size_t short_transfer(const boost::system::error_code& ec,
- size_t bytes_transferred)
+ size_t /*bytes_transferred*/)
 {
   return !!ec ? 0 : 3;
 }


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