Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r59940 - in branches/release/boost/archive: . detail
From: ramey_at_[hidden]
Date: 2010-02-26 00:08:09


Author: ramey
Date: 2010-02-26 00:08:08 EST (Fri, 26 Feb 2010)
New Revision: 59940
URL: http://svn.boost.org/trac/boost/changeset/59940

Log:
move recent changes to release branch
Properties modified:
   branches/release/boost/archive/ (props changed)
Text files modified:
   branches/release/boost/archive/basic_binary_oarchive.hpp | 10 +++++-----
   branches/release/boost/archive/detail/check.hpp | 10 +++++-----
   branches/release/boost/archive/detail/iserializer.hpp | 34 ++++++++++++++++++++--------------
   branches/release/boost/archive/detail/oserializer.hpp | 2 +-
   branches/release/boost/archive/detail/register_archive.hpp | 6 +++---
   branches/release/boost/archive/shared_ptr_helper.hpp | 4 ++--
   6 files changed, 36 insertions(+), 30 deletions(-)

Modified: branches/release/boost/archive/basic_binary_oarchive.hpp
==============================================================================
--- branches/release/boost/archive/basic_binary_oarchive.hpp (original)
+++ branches/release/boost/archive/basic_binary_oarchive.hpp 2010-02-26 00:08:08 EST (Fri, 26 Feb 2010)
@@ -80,31 +80,31 @@
     void save_override(const version_type & t, int){
         // upto 255 versions
         // note:t.t resolves borland ambguity
- assert(t.t <= boost::integer_traits<unsigned char>::const_max);
+ assert(t.t < boost::integer_traits<unsigned char>::const_max);
         const unsigned char x = static_cast<const unsigned char>(t.t);
         * this->This() << x;
     }
     void save_override(const class_id_type & t, int){
         // upto 32K classes
- assert(t.t <= boost::integer_traits<boost::int_least16_t>::const_max);
+ assert(t.t < boost::integer_traits<boost::int_least16_t>::const_max);
         const boost::int_least16_t x = static_cast<const boost::int_least16_t>(t.t);
         * this->This() << x;
     }
     void save_override(const class_id_reference_type & t, int){
         // upto 32K classes
- assert(t.t <= boost::integer_traits<boost::int_least16_t>::const_max);
+ assert(t.t < boost::integer_traits<boost::int_least16_t>::const_max);
         const boost::int_least16_t x = t.t;
         * this->This() << x;
     }
     void save_override(const object_id_type & t, int){
         // upto 2G objects
- assert(t.t <= boost::integer_traits<boost::uint_least32_t>::const_max);
+ assert(t.t < boost::integer_traits<boost::uint_least32_t>::const_max);
         const boost::uint_least32_t x = t.t;
         * this->This() << x;
     }
     void save_override(const object_reference_type & t, int){
         // upto 2G objects
- assert(t.t <= boost::integer_traits<boost::uint_least32_t>::const_max);
+ assert(t.t < boost::integer_traits<boost::uint_least32_t>::const_max);
         const boost::uint_least32_t x = t.t;
         * this->This() << x;
     }

Modified: branches/release/boost/archive/detail/check.hpp
==============================================================================
--- branches/release/boost/archive/detail/check.hpp (original)
+++ branches/release/boost/archive/detail/check.hpp 2010-02-26 00:08:08 EST (Fri, 26 Feb 2010)
@@ -48,7 +48,7 @@
 // checks for objects
 
 template<class T>
-void inline check_object_level(){
+inline void check_object_level(){
     typedef
         BOOST_DEDUCED_TYPENAME mpl::greater_equal<
             serialization::implementation_level<T>,
@@ -61,7 +61,7 @@
 }
 
 template<class T>
-void inline check_object_versioning(){
+inline void check_object_versioning(){
     typedef
         BOOST_DEDUCED_TYPENAME mpl::or_<
             BOOST_DEDUCED_TYPENAME mpl::greater<
@@ -79,7 +79,7 @@
 }
 
 template<class T>
-void inline check_object_tracking(){
+inline void check_object_tracking(){
     // presume it has already been determined that
     // T is not a const
     BOOST_STATIC_ASSERT(! boost::is_const<T>::value);
@@ -101,7 +101,7 @@
 // checks for pointers
 
 template<class T>
-void inline check_pointer_level(){
+inline void check_pointer_level(){
     // we should only invoke this once we KNOW that T
     // has been used as a pointer!!
     typedef
@@ -149,7 +149,7 @@
 }
 
 template<class T>
-void inline check_const_loading(){
+inline void check_const_loading(){
     typedef
         BOOST_DEDUCED_TYPENAME mpl::or_<
             BOOST_DEDUCED_TYPENAME boost::serialization::is_wrapper<T>,

Modified: branches/release/boost/archive/detail/iserializer.hpp
==============================================================================
--- branches/release/boost/archive/detail/iserializer.hpp (original)
+++ branches/release/boost/archive/detail/iserializer.hpp 2010-02-26 00:08:08 EST (Fri, 26 Feb 2010)
@@ -455,7 +455,7 @@
     };
 
     template<class T>
- static const basic_pointer_iserializer * register_type(Archive &ar, T & /*t*/){
+ static const basic_pointer_iserializer * register_type(Archive &ar, const T & /*t*/){
         // there should never be any need to load an abstract polymorphic
         // class pointer. Inhibiting code generation for this
         // permits abstract base classes to be used - note: exception
@@ -472,30 +472,32 @@
     template<class T>
     static T * pointer_tweak(
         const boost::serialization::extended_type_info & eti,
- void * t,
- T &
+ void const * const t,
+ const T &
     ) {
         // tweak the pointer back to the base class
         return static_cast<T *>(
- boost::serialization::void_upcast(
- eti,
- boost::serialization::singleton<
- BOOST_DEDUCED_TYPENAME
- boost::serialization::type_info_implementation<T>::type
- >::get_const_instance(),
- t
+ const_cast<void *>(
+ boost::serialization::void_upcast(
+ eti,
+ boost::serialization::singleton<
+ BOOST_DEDUCED_TYPENAME
+ boost::serialization::type_info_implementation<T>::type
+ >::get_const_instance(),
+ t
+ )
             )
         );
     }
 
     template<class T>
- static void load(Archive & /* ar */ , T & /* t */){
+ static void check_load(T & /* t */){
         check_pointer_level<T>();
         check_pointer_tracking<T>();
     }
 
     static const basic_pointer_iserializer *
- find(const boost::serialization::extended_type_info & type){
+ find(const boost::serialization::extended_type_info & type){
         return static_cast<const basic_pointer_iserializer *>(
             archive_serializer_map<Archive>::find(type)
         );
@@ -503,10 +505,14 @@
 
     template<class Tptr>
     static void invoke(Archive & ar, Tptr & t){
- load(ar, *t);
+ check_load(*t);
         const basic_pointer_iserializer * bpis_ptr = register_type(ar, *t);
         const basic_pointer_iserializer * newbpis_ptr = ar.load_pointer(
- * reinterpret_cast<void **>(&t),
+ // note major hack here !!!
+ // I tried every way to convert Tptr &t (where Tptr might
+ // include const) to void * &. This is the only way
+ // I could make it work. RR
+ (void * & )t,
             bpis_ptr,
             find
         );

Modified: branches/release/boost/archive/detail/oserializer.hpp
==============================================================================
--- branches/release/boost/archive/detail/oserializer.hpp (original)
+++ branches/release/boost/archive/detail/oserializer.hpp 2010-02-26 00:08:08 EST (Fri, 26 Feb 2010)
@@ -395,7 +395,7 @@
                 boost::serialization::throw_exception(
                     archive_exception(
                         archive_exception::unregistered_class,
- true_type->get_debug_info()
+ "derived class not registered or exported"
                     )
                 );
             }

Modified: branches/release/boost/archive/detail/register_archive.hpp
==============================================================================
--- branches/release/boost/archive/detail/register_archive.hpp (original)
+++ branches/release/boost/archive/detail/register_archive.hpp 2010-02-26 00:08:08 EST (Fri, 26 Feb 2010)
@@ -54,12 +54,12 @@
 
 #define BOOST_SERIALIZATION_REGISTER_ARCHIVE(Archive) \
 namespace boost { namespace archive { namespace detail { \
- get_counter<Archive>::next adjust_counter(get_counter<Archive>::type);\
+ get_counter<Archive >::next adjust_counter(get_counter<Archive >::type);\
     template<class Serializable> \
     void instantiate_ptr_serialization(Serializable* s, \
- get_counter<Archive>::type) { \
+ get_counter<Archive >::type) { \
         ptr_serialization_support<Archive, Serializable> x; \
- instantiate_ptr_serialization(s, get_counter<Archive>::prior()); \
+ instantiate_ptr_serialization(s, get_counter<Archive >::prior()); \
     }\
 }}}
 

Modified: branches/release/boost/archive/shared_ptr_helper.hpp
==============================================================================
--- branches/release/boost/archive/shared_ptr_helper.hpp (original)
+++ branches/release/boost/archive/shared_ptr_helper.hpp 2010-02-26 00:08:08 EST (Fri, 26 Feb 2010)
@@ -109,7 +109,7 @@
     // new system which is disjoint from this set. This is implemented
     // by a change in load_construct_data below. It makes this file suitable
     // only for loading pointers into a 1.33 or later boost system.
- std::list<boost_132::shared_ptr<void> > * m_pointers_132;
+ std::list<boost_132::shared_ptr<const void> > * m_pointers_132;
 // #endif
 
     // returns pointer to object and an indicator whether this is a
@@ -191,7 +191,7 @@
 
 // #ifdef BOOST_SERIALIZATION_SHARED_PTR_132_HPP
     BOOST_ARCHIVE_DECL(void)
- append(const boost_132::shared_ptr<void> & t);
+ append(const boost_132::shared_ptr<const void> & t);
 // #endif
 public:
     BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY())


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