Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r67708 - in trunk/boost/property_map: . parallel parallel/impl
From: jewillco_at_[hidden]
Date: 2011-01-05 21:43:47


Author: jewillco
Date: 2011-01-05 21:43:46 EST (Wed, 05 Jan 2011)
New Revision: 67708
URL: http://svn.boost.org/trac/boost/changeset/67708

Log:
Fixed assert issues from inspection report for PropertyMap
Text files modified:
   trunk/boost/property_map/parallel/distributed_property_map.hpp | 5 +++--
   trunk/boost/property_map/parallel/impl/distributed_property_map.ipp | 19 ++++++++++---------
   trunk/boost/property_map/parallel/local_property_map.hpp | 6 +++---
   trunk/boost/property_map/property_map.hpp | 4 ++--
   4 files changed, 18 insertions(+), 16 deletions(-)

Modified: trunk/boost/property_map/parallel/distributed_property_map.hpp
==============================================================================
--- trunk/boost/property_map/parallel/distributed_property_map.hpp (original)
+++ trunk/boost/property_map/parallel/distributed_property_map.hpp 2011-01-05 21:43:46 EST (Wed, 05 Jan 2011)
@@ -21,6 +21,7 @@
 #error "Parallel BGL files should not be included unless <boost/graph/use_mpi.hpp> has been included"
 #endif
 
+#include <boost/assert.hpp>
 #include <boost/type_traits/is_base_and_derived.hpp>
 #include <boost/shared_ptr.hpp>
 #include <boost/weak_ptr.hpp>
@@ -83,7 +84,7 @@
     template<typename PropertyMap, typename Key, typename Value>
     static inline void
     do_put(PropertyMap, const Key&, const Value&)
- { assert(false); }
+ { BOOST_ASSERT(false); }
   };
 
   template<>
@@ -134,7 +135,7 @@
   template<typename PropertyMap, typename Key, typename Value>
   inline void
   maybe_put_impl(PropertyMap, const Key&, const Value&, ...)
- { assert(false); }
+ { BOOST_ASSERT(false); }
 
   template<typename PropertyMap, typename Key, typename Value>
   inline void

Modified: trunk/boost/property_map/parallel/impl/distributed_property_map.ipp
==============================================================================
--- trunk/boost/property_map/parallel/impl/distributed_property_map.ipp (original)
+++ trunk/boost/property_map/parallel/impl/distributed_property_map.ipp 2011-01-05 21:43:46 EST (Wed, 05 Jan 2011)
@@ -7,6 +7,7 @@
 // Authors: Douglas Gregor
 // Nick Edmonds
 // Andrew Lumsdaine
+#include <boost/assert.hpp>
 #include <boost/property_map/parallel/distributed_property_map.hpp>
 #include <boost/graph/parallel/detail/untracked_pair.hpp>
 #include <boost/type_traits/is_base_and_derived.hpp>
@@ -46,7 +47,7 @@
   typedef handle_message<Reduce> Handler;
   data->process_group.replace_handler(Handler(data, reduce));
   Handler* handler = data->process_group.template get_receiver<Handler>();
- assert(handler);
+ BOOST_ASSERT(handler);
   handler->setup_triggers(data->process_group);
   data->get_default_value = reduce;
   data->has_default_resolver = Reduce::non_default_resolver;
@@ -121,7 +122,7 @@
 PBGL_DISTRIB_PMAP
 ::handle_message<Reduce>::operator()(process_id_type source, int tag)
 {
- assert(false);
+ BOOST_ASSERT(false);
 }
 
 template<typename ProcessGroup, typename GlobalMap, typename StorageMap>
@@ -136,7 +137,7 @@
   shared_ptr<data_t> data(data_ptr);
 
   owner_local_pair p = get(data->global, req.first);
- assert(p.first == process_id(data->process_group));
+ BOOST_ASSERT(p.first == process_id(data->process_group));
 
   detail::maybe_put(data->storage, p.second,
                     reduce(req.first,
@@ -154,7 +155,7 @@
   using boost::get;
 
   shared_ptr<data_t> data(data_ptr);
- assert(data);
+ BOOST_ASSERT(data);
 
   owner_local_pair p = get(data->global, key);
   return get(data->storage, p.second);
@@ -168,7 +169,7 @@
                 trigger_receive_context)
 {
   shared_ptr<data_t> data(data_ptr);
- assert(data);
+ BOOST_ASSERT(data);
 
   typedef boost::parallel::detail::untracked_pair<key_type, value_type> key_value;
   std::vector<key_value> results;
@@ -194,7 +195,7 @@
    trigger_receive_context)
 {
   shared_ptr<data_t> data(data_ptr);
- assert(data);
+ BOOST_ASSERT(data);
 
   // Index by key
   ghost_cells_key_index_type const& key_index
@@ -223,7 +224,7 @@
   using boost::get;
 
   shared_ptr<data_t> data(data_ptr);
- assert(data);
+ BOOST_ASSERT(data);
 
   std::size_t n = values.size();
   for (std::size_t i = 0; i < n; ++i) {
@@ -261,7 +262,7 @@
 {
   int stage=0; // we only get called at the start now
   shared_ptr<data_t> data(data_ptr);
- assert(data);
+ BOOST_ASSERT(data);
 
   // Determine in which stage backward consistency messages should be sent.
   int backward_stage = -1;
@@ -422,7 +423,7 @@
 void PBGL_DISTRIB_PMAP::data_t::do_reset()
 {
   Resolver* resolver = get_default_value.template target<Resolver>();
- assert(resolver);
+ BOOST_ASSERT(resolver);
 
   for (iterator i = ghost_cells->begin(); i != ghost_cells->end(); ++i)
     const_cast<value_type&>(i->second) = (*resolver)(i->first);

Modified: trunk/boost/property_map/parallel/local_property_map.hpp
==============================================================================
--- trunk/boost/property_map/parallel/local_property_map.hpp (original)
+++ trunk/boost/property_map/parallel/local_property_map.hpp 2011-01-05 21:43:46 EST (Wed, 05 Jan 2011)
@@ -20,7 +20,7 @@
 #error "Parallel BGL files should not be included unless <boost/graph/use_mpi.hpp> has been included"
 #endif
 
-#include <cassert>
+#include <boost/assert.hpp>
 
 namespace boost {
   /** Property map that accesses an underlying, local property map
@@ -47,7 +47,7 @@
     reference operator[](const key_type& key)
     {
       owner_local_pair p = get(global_, key);
- assert(p.first == process_id(process_group_));
+ BOOST_ASSERT(p.first == process_id(process_group_));
       return storage[p.second];
     }
 
@@ -84,7 +84,7 @@
                  ::value_type const& v)
   {
     typename property_traits<GlobalMap>::value_type p = get(pm.global(), key);
- assert(p.first == process_id(pm.process_group()));
+ BOOST_ASSERT(p.first == process_id(pm.process_group()));
     put(pm.base(), p.second, v);
   }
 } // end namespace boost

Modified: trunk/boost/property_map/property_map.hpp
==============================================================================
--- trunk/boost/property_map/property_map.hpp (original)
+++ trunk/boost/property_map/property_map.hpp 2011-01-05 21:43:46 EST (Wed, 05 Jan 2011)
@@ -11,7 +11,7 @@
 #ifndef BOOST_PROPERTY_MAP_HPP
 #define BOOST_PROPERTY_MAP_HPP
 
-#include <cassert>
+#include <boost/assert.hpp>
 #include <boost/config.hpp>
 #include <boost/pending/cstddef.hpp>
 #include <boost/detail/iterator.hpp>
@@ -444,7 +444,7 @@
       : iter(first), n(n_), index(_id) { }
     inline safe_iterator_property_map() { }
     inline R operator[](key_type v) const {
- assert(get(index, v) < n);
+ BOOST_ASSERT(get(index, v) < n);
       return *(iter + get(index, v)) ;
     }
     typename property_traits<IndexMap>::value_type size() const { return n; }


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