Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r81767 - in trunk: boost/coroutine boost/coroutine/detail libs/coroutine/example/asio
From: oliver.kowalke_at_[hidden]
Date: 2012-12-07 12:55:35


Author: olli
Date: 2012-12-07 12:55:34 EST (Fri, 07 Dec 2012)
New Revision: 81767
URL: http://svn.boost.org/trac/boost/changeset/81767

Log:
coroutine: fix memset() typo, add Licence and Copyright

Text files modified:
   trunk/boost/coroutine/coroutine.hpp | 66 +++++++++++++--------------------------
   trunk/boost/coroutine/detail/stack_allocator_posix.hpp | 4 +-
   trunk/boost/coroutine/detail/stack_allocator_windows.hpp | 8 +++-
   trunk/libs/coroutine/example/asio/stream_client.cpp | 8 ----
   trunk/libs/coroutine/example/asio/stream_server.cpp | 8 ----
   5 files changed, 31 insertions(+), 63 deletions(-)

Modified: trunk/boost/coroutine/coroutine.hpp
==============================================================================
--- trunk/boost/coroutine/coroutine.hpp (original)
+++ trunk/boost/coroutine/coroutine.hpp 2012-12-07 12:55:34 EST (Fri, 07 Dec 2012)
@@ -286,8 +286,7 @@
         impl_()
     {
 // BOOST_STATIC_ASSERT((
-// is_same< typename result_of< Fn( caller_type &) >::type, void >::value
-// ));
+// is_same< void, typename result_of< Fn() >::type >::value));
         typedef detail::coroutine_object<
                 Signature,
                 Fn, stack_allocator, std::allocator< coroutine >,
@@ -324,8 +323,7 @@
         impl_()
     {
 // BOOST_STATIC_ASSERT((
-// is_same< typename result_of< Fn( caller_type &) >::type, void >::value
-// ));
+// is_same< void, typename result_of< Fn() >::type >::value));
         typedef detail::coroutine_object<
                 Signature,
                 Fn, StackAllocator, std::allocator< coroutine >,
@@ -361,8 +359,7 @@
         impl_()
     {
 // BOOST_STATIC_ASSERT((
-// is_same< typename result_of< Fn( caller_type &) >::type, void >::value
-// ));
+// is_same< void, typename result_of< Fn() >::type >::value));
         typedef detail::coroutine_object<
                 Signature,
                 Fn, StackAllocator, Allocator,
@@ -400,8 +397,7 @@
         impl_()
     {
 // BOOST_STATIC_ASSERT((
-// is_same< typename result_of< Fn( caller_type &) >::type, void >::value
-// ));
+// is_same< void, typename result_of< Fn() >::type >::value));
         typedef detail::coroutine_object<
                 Signature,
                 Fn, stack_allocator, std::allocator< coroutine >,
@@ -438,8 +434,7 @@
         impl_()
     {
 // BOOST_STATIC_ASSERT((
-// is_same< typename result_of< Fn( caller_type &) >::type, void >::value
-// ));
+// is_same< void, typename result_of< Fn() >::type >::value));
         typedef detail::coroutine_object<
                 Signature,
                 Fn, StackAllocator, std::allocator< coroutine >,
@@ -475,8 +470,7 @@
         impl_()
     {
 // BOOST_STATIC_ASSERT((
-// is_same< typename result_of< Fn( caller_type &) >::type, void >::value
-// ));
+// is_same< void, typename result_of< Fn() >::type >::value));
         typedef detail::coroutine_object<
                 Signature,
                 Fn, StackAllocator, Allocator,
@@ -514,8 +508,7 @@
         impl_()
     {
 // BOOST_STATIC_ASSERT((
-// is_same< typename result_of< Fn( caller_type &) >::type, void >::value
-// ));
+// is_same< void, typename result_of< Fn() >::type >::value));
         typedef detail::coroutine_object<
                 Signature,
                 Fn, stack_allocator, std::allocator< coroutine >,
@@ -552,8 +545,7 @@
         impl_()
     {
 // BOOST_STATIC_ASSERT((
-// is_same< typename result_of< Fn( caller_type &) >::type, void >::value
-// ));
+// is_same< void, typename result_of< Fn() >::type >::value));
         typedef detail::coroutine_object<
                 Signature,
                 Fn, StackAllocator, std::allocator< coroutine >,
@@ -589,8 +581,7 @@
         impl_()
     {
 // BOOST_STATIC_ASSERT((
-// is_same< typename result_of< Fn( caller_type &) >::type, void >::value
-// ));
+// is_same< void, typename result_of< Fn() >::type >::value));
         typedef detail::coroutine_object<
                 Signature,
                 Fn, StackAllocator, Allocator,
@@ -873,8 +864,7 @@
         impl_()
     {
 // BOOST_STATIC_ASSERT((
-// is_same< typename result_of< Fn( caller_type &) >::type, void >::value
-// ));
+// is_same< void, typename result_of< Fn() >::type >::value));
         typedef detail::coroutine_object<
                 Signature,
                 Fn, stack_allocator, std::allocator< coroutine >,
@@ -912,8 +902,7 @@
         impl_()
     {
 // BOOST_STATIC_ASSERT((
-// is_same< typename result_of< Fn( caller_type &) >::type, void >::value
-// ));
+// is_same< void, typename result_of< Fn() >::type >::value));
         typedef detail::coroutine_object<
                 Signature,
                 Fn, stack_allocator, std::allocator< coroutine >,
@@ -950,8 +939,7 @@
         impl_()
     {
 // BOOST_STATIC_ASSERT((
-// is_same< typename result_of< Fn( caller_type &) >::type, void >::value
-// ));
+// is_same< void, typename result_of< Fn() >::type >::value));
         typedef detail::coroutine_object<
                 Signature,
                 Fn, StackAllocator, std::allocator< coroutine >,
@@ -988,8 +976,7 @@
         impl_()
     {
 // BOOST_STATIC_ASSERT((
-// is_same< typename result_of< Fn( caller_type &) >::type, void >::value
-// ));
+// is_same< void, typename result_of< Fn() >::type >::value));
         typedef detail::coroutine_object<
                 Signature,
                 Fn, StackAllocator, std::allocator< coroutine >,
@@ -1025,8 +1012,7 @@
         impl_()
     {
 // BOOST_STATIC_ASSERT((
-// is_same< typename result_of< Fn( caller_type &) >::type, void >::value
-// ));
+// is_same< void, typename result_of< Fn() >::type >::value));
         typedef detail::coroutine_object<
                 Signature,
                 Fn, StackAllocator, Allocator,
@@ -1062,8 +1048,7 @@
         impl_()
     {
 // BOOST_STATIC_ASSERT((
-// is_same< typename result_of< Fn( caller_type &) >::type, void >::value
-// ));
+// is_same< void, typename result_of< Fn() >::type >::value));
         typedef detail::coroutine_object<
                 Signature,
                 Fn, StackAllocator, Allocator,
@@ -1101,8 +1086,7 @@
         impl_()
     {
 // BOOST_STATIC_ASSERT((
-// is_same< typename result_of< Fn( caller_type &) >::type, void >::value
-// ));
+// is_same< void, typename result_of< Fn() >::type >::value));
         typedef detail::coroutine_object<
                 Signature,
                 Fn, stack_allocator, std::allocator< coroutine >,
@@ -1140,8 +1124,7 @@
         impl_()
     {
 // BOOST_STATIC_ASSERT((
-// is_same< typename result_of< Fn( caller_type &) >::type, void >::value
-// ));
+// is_same< void, typename result_of< Fn() >::type >::value));
         typedef detail::coroutine_object<
                 Signature,
                 Fn, stack_allocator, std::allocator< coroutine >,
@@ -1178,8 +1161,7 @@
         impl_()
     {
 // BOOST_STATIC_ASSERT((
-// is_same< typename result_of< Fn( caller_type &) >::type, void >::value
-// ));
+// is_same< void, typename result_of< Fn() >::type >::value));
         typedef detail::coroutine_object<
                 Signature,
                 Fn, StackAllocator, std::allocator< coroutine >,
@@ -1215,8 +1197,7 @@
         impl_()
     {
 // BOOST_STATIC_ASSERT((
-// is_same< typename result_of< Fn( caller_type &) >::type, void >::value
-// ));
+// is_same< void, typename result_of< Fn() >::type >::value));
         typedef detail::coroutine_object<
                 Signature,
                 Fn, StackAllocator, Allocator,
@@ -1254,8 +1235,7 @@
         impl_()
     {
 // BOOST_STATIC_ASSERT((
-// is_same< typename result_of< Fn( caller_type &) >::type, void >::value
-// ));
+// is_same< void, typename result_of< Fn() >::type >::value));
         typedef detail::coroutine_object<
                 Signature,
                 Fn, stack_allocator, std::allocator< coroutine >,
@@ -1292,8 +1272,7 @@
         impl_()
     {
 // BOOST_STATIC_ASSERT((
-// is_same< typename result_of< Fn( caller_type &) >::type, void >::value
-// ));
+// is_same< void, typename result_of< Fn() >::type >::value));
         typedef detail::coroutine_object<
                 Signature,
                 Fn, StackAllocator, std::allocator< coroutine >,
@@ -1329,8 +1308,7 @@
         impl_()
     {
 // BOOST_STATIC_ASSERT((
-// is_same< typename result_of< Fn( caller_type &) >::type, void >::value
-// ));
+// is_same< void, typename result_of< Fn() >::type >::value));
         typedef detail::coroutine_object<
                 Signature,
                 Fn, StackAllocator, Allocator,

Modified: trunk/boost/coroutine/detail/stack_allocator_posix.hpp
==============================================================================
--- trunk/boost/coroutine/detail/stack_allocator_posix.hpp (original)
+++ trunk/boost/coroutine/detail/stack_allocator_posix.hpp 2012-12-07 12:55:34 EST (Fri, 07 Dec 2012)
@@ -93,7 +93,7 @@
         BOOST_ASSERT( maximum_stacksize() >= minimum_stacksize() );
         return maximum_stacksize() == size
             ? size
- : (std::min)( size, maximum_stacksize() );
+ : std::min( size, maximum_stacksize() );
     }
 
     static std::size_t minimum_stacksize()
@@ -126,7 +126,7 @@
         ::close( fd);
         if ( ! limit) throw std::bad_alloc();
 
- std::memset( limit, '\0', size_);
+ std::memset( limit, size_, '\0');
 
         // conforming to POSIX.1-2001
         const int result( ::mprotect( limit, pagesize(), PROT_NONE) );

Modified: trunk/boost/coroutine/detail/stack_allocator_windows.hpp
==============================================================================
--- trunk/boost/coroutine/detail/stack_allocator_windows.hpp (original)
+++ trunk/boost/coroutine/detail/stack_allocator_windows.hpp 2012-12-07 12:55:34 EST (Fri, 07 Dec 2012)
@@ -89,14 +89,16 @@
 
     static std::size_t default_stacksize()
     {
+ using namespace std;
+
         std::size_t size = 64 * 1024; // 64 kB
         if ( is_stack_unbound() )
- return (std::max)( size, minimum_stacksize() );
+ return max( size, minimum_stacksize() );
 
         BOOST_ASSERT( maximum_stacksize() >= minimum_stacksize() );
         return maximum_stacksize() == minimum_stacksize()
             ? minimum_stacksize()
- : (std::min)( size, maximum_stacksize() );
+ : min( size, maximum_stacksize() );
     }
 
     // because Windows seams not to provide a limit for minimum stacksize
@@ -123,7 +125,7 @@
         void * limit = ::VirtualAlloc( 0, size_, MEM_COMMIT, PAGE_READWRITE);
         if ( ! limit) throw std::bad_alloc();
 
- std::memset( limit, '\0', size_);
+ std::memset( limit, size_, '\0');
 
         DWORD old_options;
         const BOOL result = ::VirtualProtect(

Modified: trunk/libs/coroutine/example/asio/stream_client.cpp
==============================================================================
--- trunk/libs/coroutine/example/asio/stream_client.cpp (original)
+++ trunk/libs/coroutine/example/asio/stream_client.cpp 2012-12-07 12:55:34 EST (Fri, 07 Dec 2012)
@@ -1,9 +1,3 @@
-
-// Copyright Oliver Kowalke 2009.
-// Distributed under the Boost Software License, Version 1.0.
-// (See accompanying file LICENSE_1_0.txt or copy at
-// http://www.boost.org/LICENSE_1_0.txt)
-
 #include <cstdlib>
 #include <iostream>
 #include <stdexcept>
@@ -35,7 +29,7 @@
                 desc),
             vm);
         boost::program_options::notify( vm);
-
+
         if ( vm.count("help") ) {
             std::cout << desc << std::endl;
             return EXIT_SUCCESS;

Modified: trunk/libs/coroutine/example/asio/stream_server.cpp
==============================================================================
--- trunk/libs/coroutine/example/asio/stream_server.cpp (original)
+++ trunk/libs/coroutine/example/asio/stream_server.cpp 2012-12-07 12:55:34 EST (Fri, 07 Dec 2012)
@@ -1,9 +1,3 @@
-
-// Copyright Oliver Kowalke 2009.
-// Distributed under the Boost Software License, Version 1.0.
-// (See accompanying file LICENSE_1_0.txt or copy at
-// http://www.boost.org/LICENSE_1_0.txt)
-
 #define NOMINMAX
 
 #include <cstdlib>
@@ -38,7 +32,7 @@
 
     int fetch_()
     {
- std::streamsize num = (std::min)(
+ std::streamsize num = std::min(
             static_cast< std::streamsize >( gptr() - eback() ), pb_size);
 
         std::memmove(


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