Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r83959 - in trunk: boost/interprocess boost/interprocess/detail boost/interprocess/ipc boost/interprocess/sync/windows libs/interprocess/doc
From: igaztanaga_at_[hidden]
Date: 2013-04-18 16:03:22


Author: igaztanaga
Date: 2013-04-18 16:03:18 EDT (Thu, 18 Apr 2013)
New Revision: 83959
URL: http://svn.boost.org/trac/boost/changeset/83959

Log:
Fixes #4557
Text files modified:
   trunk/boost/interprocess/detail/win32_api.hpp | 10 +++++-----
   trunk/boost/interprocess/ipc/message_queue.hpp | 9 +++++----
   trunk/boost/interprocess/mapped_region.hpp | 3 ++-
   trunk/boost/interprocess/sync/windows/mutex.hpp | 4 ++--
   trunk/boost/interprocess/sync/windows/named_sync.hpp | 4 ++--
   trunk/boost/interprocess/sync/windows/semaphore.hpp | 5 +++--
   trunk/libs/interprocess/doc/interprocess.qbk | 3 ++-
   7 files changed, 21 insertions(+), 17 deletions(-)

Modified: trunk/boost/interprocess/detail/win32_api.hpp
==============================================================================
--- trunk/boost/interprocess/detail/win32_api.hpp (original)
+++ trunk/boost/interprocess/detail/win32_api.hpp 2013-04-18 16:03:18 EDT (Thu, 18 Apr 2013)
@@ -16,7 +16,7 @@
 #include <boost/date_time/filetime_functions.hpp>
 #include <cstddef>
 #include <cstring>
-#include <cassert>
+#include <boost/assert.hpp>
 #include <string>
 #include <vector>
 #include <memory>
@@ -1254,13 +1254,13 @@
 
    static void *get_module_from_id(unsigned int id)
    {
- assert(id < (unsigned int)NumModule);
+ BOOST_ASSERT(id < (unsigned int)NumModule);
       return get_module_handle(ModuleNames[id]);
    }
 
    static void *get_module(const unsigned int id)
    {
- assert(id < (unsigned int)NumModule);
+ BOOST_ASSERT(id < (unsigned int)NumModule);
       while(ModuleStates[id] < 2){
          if(interlocked_compare_exchange(&ModuleStates[id], 1, 0) == 0){
             ModuleAddresses[id] = get_module_from_id(id);
@@ -1276,14 +1276,14 @@
 
    static void *get_address_from_dll(const unsigned int id)
    {
- assert(id < (unsigned int)NumFunction);
+ BOOST_ASSERT(id < (unsigned int)NumFunction);
       return get_proc_address(get_module(FunctionModules[id]), FunctionNames[id]);
    }
 
    public:
    static void *get(const unsigned int id)
    {
- assert(id < (unsigned int)NumFunction);
+ BOOST_ASSERT(id < (unsigned int)NumFunction);
       while(FunctionStates[id] < 2){
          if(interlocked_compare_exchange(&FunctionStates[id], 1, 0) == 0){
             FunctionAddresses[id] = get_address_from_dll(id);

Modified: trunk/boost/interprocess/ipc/message_queue.hpp
==============================================================================
--- trunk/boost/interprocess/ipc/message_queue.hpp (original)
+++ trunk/boost/interprocess/ipc/message_queue.hpp 2013-04-18 16:03:18 EDT (Thu, 18 Apr 2013)
@@ -30,6 +30,7 @@
 #include <boost/type_traits/make_unsigned.hpp>
 #include <boost/type_traits/alignment_of.hpp>
 #include <boost/intrusive/pointer_traits.hpp>
+#include <boost/assert.hpp>
 #include <algorithm> //std::lower_bound
 #include <cstddef> //std::size_t
 #include <cstring> //memcpy
@@ -358,8 +359,8 @@
             iterator idx_beg = &mp_index[0];
             ret = std::lower_bound(idx_beg, end, value, func);
             //sanity check, these cases should not call lower_bound (optimized out)
- assert(ret != end);
- assert(ret != begin);
+ BOOST_ASSERT(ret != end);
+ BOOST_ASSERT(ret != begin);
             return ret;
          }
          else{
@@ -752,8 +753,8 @@
       ipcdetail::msg_hdr_t<VoidPointer> &free_msg_hdr = p_hdr->queue_free_msg(priority);
 
       //Sanity check, free msgs are always cleaned when received
- assert(free_msg_hdr.priority == 0);
- assert(free_msg_hdr.len == 0);
+ BOOST_ASSERT(free_msg_hdr.priority == 0);
+ BOOST_ASSERT(free_msg_hdr.len == 0);
 
       //Copy control data to the free message
       free_msg_hdr.priority = priority;

Modified: trunk/boost/interprocess/mapped_region.hpp
==============================================================================
--- trunk/boost/interprocess/mapped_region.hpp (original)
+++ trunk/boost/interprocess/mapped_region.hpp 2013-04-18 16:03:18 EDT (Thu, 18 Apr 2013)
@@ -21,6 +21,7 @@
 #include <boost/interprocess/detail/os_file_functions.hpp>
 #include <string>
 #include <boost/cstdint.hpp>
+#include <boost/assert.hpp>
 //Some Unixes use caddr_t instead of void * in madvise
 // SunOS Tru64 HP-UX AIX
 #if defined(sun) || defined(__sun) || defined(__osf__) || defined(__osf) || defined(_hpux) || defined(hpux) || defined(_AIX)
@@ -325,7 +326,7 @@
          m_page_offset = m_page_offset % page_size;
          m_size -= bytes;
          m_base = static_cast<char *>(m_base) + bytes;
- assert(shrink_page_bytes%page_size == 0);
+ BOOST_ASSERT(shrink_page_bytes%page_size == 0);
       }
       return true;
    }

Modified: trunk/boost/interprocess/sync/windows/mutex.hpp
==============================================================================
--- trunk/boost/interprocess/sync/windows/mutex.hpp (original)
+++ trunk/boost/interprocess/sync/windows/mutex.hpp 2013-04-18 16:03:18 EDT (Thu, 18 Apr 2013)
@@ -57,8 +57,8 @@
    bool open_or_created;
    (void)handles.obtain_mutex(this->id_, &open_or_created);
    //The mutex must be created, never opened
- assert(open_or_created);
- assert(open_or_created && winapi::get_last_error() != winapi::error_already_exists);
+ BOOST_ASSERT(open_or_created);
+ BOOST_ASSERT(open_or_created && winapi::get_last_error() != winapi::error_already_exists);
    (void)open_or_created;
 }
 

Modified: trunk/boost/interprocess/sync/windows/named_sync.hpp
==============================================================================
--- trunk/boost/interprocess/sync/windows/named_sync.hpp (original)
+++ trunk/boost/interprocess/sync/windows/named_sync.hpp 2013-04-18 16:03:18 EDT (Thu, 18 Apr 2013)
@@ -24,7 +24,7 @@
 #include <boost/interprocess/errors.hpp>
 #include <boost/interprocess/exceptions.hpp>
 #include <string>
-#include <cassert>
+#include <boost/assert.hpp>
 
 namespace boost {
 namespace interprocess {
@@ -145,7 +145,7 @@
                      success = true;
                   }
                   winapi::get_file_size(m_file_hnd, filesize);
- assert(std::size_t(filesize) == sizeof_file_info);
+ BOOST_ASSERT(std::size_t(filesize) == sizeof_file_info);
                }
                else{
                   void *buf = sync_interface.buffer_to_store_init_data_from_file();

Modified: trunk/boost/interprocess/sync/windows/semaphore.hpp
==============================================================================
--- trunk/boost/interprocess/sync/windows/semaphore.hpp (original)
+++ trunk/boost/interprocess/sync/windows/semaphore.hpp 2013-04-18 16:03:18 EDT (Thu, 18 Apr 2013)
@@ -23,6 +23,7 @@
 #include <boost/interprocess/sync/windows/sync_utils.hpp>
 #include <boost/interprocess/sync/windows/winapi_semaphore_wrapper.hpp>
 #include <boost/interprocess/exceptions.hpp>
+#include <boost/assert.hpp>
 
 
 namespace boost {
@@ -56,8 +57,8 @@
    bool open_or_created;
    handles.obtain_semaphore(this->id_, initialCount, &open_or_created);
    //The semaphore must be created, never opened
- assert(open_or_created);
- assert(open_or_created && winapi::get_last_error() != winapi::error_already_exists);
+ BOOST_ASSERT(open_or_created);
+ BOOST_ASSERT(open_or_created && winapi::get_last_error() != winapi::error_already_exists);
    (void)open_or_created;
 }
 

Modified: trunk/libs/interprocess/doc/interprocess.qbk
==============================================================================
--- trunk/libs/interprocess/doc/interprocess.qbk (original)
+++ trunk/libs/interprocess/doc/interprocess.qbk 2013-04-18 16:03:18 EDT (Thu, 18 Apr 2013)
@@ -6842,9 +6842,10 @@
 [section:release_notes_boost_1_46_00 Boost 1.46 Release]
 
 * Fixed bugs
+ [@https://svn.boost.org/trac/boost/ticket/4557 #4557],
   [@https://svn.boost.org/trac/boost/ticket/4979 #4979],
   [@https://svn.boost.org/trac/boost/ticket/4907 #4907],
- [@https://svn.boost.org/trac/boost/ticket/4895 #4895]
+ [@https://svn.boost.org/trac/boost/ticket/4895 #4895].
 
 [endsect]
 


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