Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r62787 - trunk/libs/serialization/src
From: ramey_at_[hidden]
Date: 2010-06-11 00:12:46


Author: ramey
Date: 2010-06-11 00:12:45 EDT (Fri, 11 Jun 2010)
New Revision: 62787
URL: http://svn.boost.org/trac/boost/changeset/62787

Log:
fix #3 for version_type
Text files modified:
   trunk/libs/serialization/src/archive_exception.cpp | 7 +++++--
   trunk/libs/serialization/src/basic_iarchive.cpp | 16 +++-------------
   trunk/libs/serialization/src/basic_oarchive.cpp | 10 ----------
   trunk/libs/serialization/src/basic_xml_grammar.ipp | 8 ++++----
   4 files changed, 12 insertions(+), 29 deletions(-)

Modified: trunk/libs/serialization/src/archive_exception.cpp
==============================================================================
--- trunk/libs/serialization/src/archive_exception.cpp (original)
+++ trunk/libs/serialization/src/archive_exception.cpp 2010-06-11 00:12:45 EDT (Fri, 11 Jun 2010)
@@ -61,8 +61,8 @@
     case array_size_too_short:
         m_msg = "array size too short";
         break;
- case stream_error:
- m_msg = "stream error";
+ case input_stream_error:
+ m_msg = "input stream error";
         break;
     case invalid_class_name:
         m_msg = "class name too long";
@@ -89,6 +89,9 @@
             m_msg += e1;
         }
         break;
+ case output_stream_error:
+ m_msg = "output stream error";
+ break;
     default:
         assert(false);
         break;

Modified: trunk/libs/serialization/src/basic_iarchive.cpp
==============================================================================
--- trunk/libs/serialization/src/basic_iarchive.cpp (original)
+++ trunk/libs/serialization/src/basic_iarchive.cpp 2010-06-11 00:12:45 EDT (Fri, 11 Jun 2010)
@@ -291,11 +291,6 @@
 basic_iarchive_impl::register_type(
     const basic_iserializer & bis
 ){
- assert(
- cobject_info_set.size()
- <=
- boost::integer_traits<class_id_type>::const_max
- );
     class_id_type cid(cobject_info_set.size());
     cobject_type co(cid, bis);
     std::pair<cobject_info_set_type::const_iterator, bool>
@@ -320,7 +315,7 @@
 ){
     if(! co.initialized){
         if(co.bis_ptr->class_info()){
- class_id_optional_type cid;
+ class_id_optional_type cid(class_id_type(0));
             load(ar, cid); // to be thrown away
             load(ar, co.tracking_level);
             load(ar, co.file_version);
@@ -380,7 +375,7 @@
 
     object_id_type this_id;
     moveable_objects_start =
- this_id = object_id_vector.size();
+ this_id = object_id_type(object_id_vector.size());
 
     // if we tracked this object when the archive was saved
     if(tracking){
@@ -391,7 +386,7 @@
         // add a new enty into the tracking list
         object_id_vector.push_back(aobject(t, cid));
         // and add an entry for this object
- moveable_objects_end = object_id_vector.size();
+ moveable_objects_end = object_id_type(object_id_vector.size());
     }
     // read data
     (bis.load_object_data)(ar, t, co.file_version);
@@ -416,11 +411,6 @@
         return bpis_ptr;
     }
 
- assert(
- cobject_info_set.size()
- <=
- boost::integer_traits<class_id_type>::const_max
- );
     // if its a new class type - i.e. never been registered
     if(class_id_type(cobject_info_set.size()) <= cid){
         // if its either abstract

Modified: trunk/libs/serialization/src/basic_oarchive.cpp
==============================================================================
--- trunk/libs/serialization/src/basic_oarchive.cpp (original)
+++ trunk/libs/serialization/src/basic_oarchive.cpp 2010-06-11 00:12:45 EDT (Fri, 11 Jun 2010)
@@ -224,11 +224,6 @@
 inline const basic_oarchive_impl::cobject_type &
 basic_oarchive_impl::find(const basic_oserializer & bos)
 {
- assert(
- cobject_info_set.size()
- <=
- boost::integer_traits<class_id_type>::const_max
- );
     std::pair<cobject_info_set_type::iterator, bool> cresult =
         cobject_info_set.insert(cobject_type(cobject_info_set.size(), bos));
     return *(cresult.first);
@@ -238,11 +233,6 @@
 basic_oarchive_impl::register_type(
     const basic_oserializer & bos
 ){
- assert(
- cobject_info_set.size()
- <=
- boost::integer_traits<class_id_type>::const_max
- );
     cobject_type co(cobject_info_set.size(), bos);
     std::pair<cobject_info_set_type::const_iterator, bool>
         result = cobject_info_set.insert(co);

Modified: trunk/libs/serialization/src/basic_xml_grammar.ipp
==============================================================================
--- trunk/libs/serialization/src/basic_xml_grammar.ipp (original)
+++ trunk/libs/serialization/src/basic_xml_grammar.ipp 2010-06-11 00:12:45 EDT (Fri, 11 Jun 2010)
@@ -181,7 +181,7 @@
 ) const {
     if(is.fail()){
         boost::serialization::throw_exception(
- archive_exception(archive_exception::stream_error)
+ archive_exception(archive_exception::input_stream_error)
         );
     }
     
@@ -321,7 +321,7 @@
         str_p(BOOST_ARCHIVE_XML_CLASS_ID()) >> NameTail
>> Eq
>> L'"'
- >> int_p [xml::assign_object(rv.class_id.t)]
+ >> int_p [xml::assign_object(rv.class_id)]
>> L'"'
       ;
 
@@ -334,7 +334,7 @@
>> Eq
>> L'"'
>> L'_'
- >> uint_p [xml::assign_object(rv.object_id.t)]
+ >> uint_p [xml::assign_object(rv.object_id)]
>> L'"'
     ;
         
@@ -372,7 +372,7 @@
         str_p(BOOST_ARCHIVE_XML_VERSION())
>> Eq
>> L'"'
- >> uint_p [xml::assign_object(rv.version.t)]
+ >> uint_p [xml::assign_object(rv.version)]
>> L'"'
     ;
 


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