Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r51019 - trunk/boost/graph
From: jewillco_at_[hidden]
Date: 2009-02-04 15:57:05


Author: jewillco
Date: 2009-02-04 15:57:04 EST (Wed, 04 Feb 2009)
New Revision: 51019
URL: http://svn.boost.org/trac/boost/changeset/51019

Log:
Default color map to white, and fixed some warnings
Text files modified:
   trunk/boost/graph/two_bit_color_map.hpp | 7 +++++--
   1 files changed, 5 insertions(+), 2 deletions(-)

Modified: trunk/boost/graph/two_bit_color_map.hpp
==============================================================================
--- trunk/boost/graph/two_bit_color_map.hpp (original)
+++ trunk/boost/graph/two_bit_color_map.hpp 2009-02-04 15:57:04 EST (Wed, 04 Feb 2009)
@@ -15,6 +15,7 @@
 
 #include <boost/property_map.hpp>
 #include <boost/shared_array.hpp>
+#include <algorithm>
 
 namespace boost {
 
@@ -50,6 +51,8 @@
   explicit two_bit_color_map(std::size_t n, const IndexMap& index = IndexMap())
     : n(n), index(index), data(new unsigned char[(n + 3) / 4])
   {
+ // Fill to white
+ std::fill(data.get(), data.get() + (n + 3) / 4, 0);
   }
 };
 
@@ -59,7 +62,7 @@
     typename two_bit_color_map<IndexMap>::key_type key)
 {
   typename property_traits<IndexMap>::value_type i = get(pm.index, key);
- assert (i < pm.n);
+ assert ((std::size_t)i < pm.n);
   return two_bit_color_type((pm.data.get()[i / 4] >> ((i % 4) * 2)) & 3);
 }
 
@@ -70,7 +73,7 @@
     two_bit_color_type value)
 {
   typename property_traits<IndexMap>::value_type i = get(pm.index, key);
- assert (i < pm.n);
+ assert ((std::size_t)i < pm.n);
   assert (value >= 0 && value < 4);
   std::size_t byte_num = i / 4;
   std::size_t bit_position = ((i % 4) * 2);


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