mirror of
https://github.com/boostorg/serialization.git
synced 2026-02-01 08:52:08 +00:00
changes to minimize warnings in library build
[SVN r57982]
This commit is contained in:
@@ -23,7 +23,7 @@ namespace std{
|
||||
} // namespace std
|
||||
#endif
|
||||
|
||||
#include <boost/limits.hpp>
|
||||
#include <boost/integer_traits.hpp>
|
||||
#include <boost/serialization/state_saver.hpp>
|
||||
#include <boost/serialization/throw_exception.hpp>
|
||||
#include <boost/serialization/tracking.hpp>
|
||||
@@ -93,18 +93,18 @@ class basic_iarchive_impl {
|
||||
// used by load object to look up class id given basic_serializer
|
||||
struct cobject_type
|
||||
{
|
||||
const basic_iserializer * bis;
|
||||
const class_id_type class_id;
|
||||
const basic_iserializer * m_bis;
|
||||
const class_id_type m_class_id;
|
||||
cobject_type(
|
||||
class_id_type class_id_,
|
||||
const basic_iserializer & bis_
|
||||
std::size_t class_id,
|
||||
const basic_iserializer & bis
|
||||
) :
|
||||
bis(& bis_),
|
||||
class_id(class_id_)
|
||||
m_bis(& bis),
|
||||
m_class_id(class_id)
|
||||
{}
|
||||
cobject_type(const cobject_type & rhs) :
|
||||
bis(rhs.bis),
|
||||
class_id(rhs.class_id)
|
||||
m_bis(rhs.m_bis),
|
||||
m_class_id(rhs.m_class_id)
|
||||
{}
|
||||
// the following cannot be defined because of the const
|
||||
// member. This will generate a link error if an attempt
|
||||
@@ -112,7 +112,7 @@ class basic_iarchive_impl {
|
||||
cobject_type & operator=(const cobject_type & rhs);
|
||||
bool operator<(const cobject_type &rhs) const
|
||||
{
|
||||
return *bis < *(rhs.bis);
|
||||
return *m_bis < *(rhs.m_bis);
|
||||
}
|
||||
};
|
||||
typedef std::set<cobject_type> cobject_info_set_type;
|
||||
@@ -174,7 +174,7 @@ class basic_iarchive_impl {
|
||||
pending_version(0)
|
||||
{}
|
||||
~basic_iarchive_impl(){}
|
||||
void set_library_version(unsigned int archive_library_version){
|
||||
void set_library_version(version_type archive_library_version){
|
||||
m_archive_library_version = archive_library_version;
|
||||
}
|
||||
bool
|
||||
@@ -289,7 +289,14 @@ inline class_id_type
|
||||
basic_iarchive_impl::register_type(
|
||||
const basic_iserializer & bis
|
||||
){
|
||||
class_id_type id(static_cast<int>(cobject_info_set.size()));
|
||||
assert(
|
||||
cobject_info_set.size()
|
||||
<=
|
||||
boost::integer_traits<class_id_type>::const_max
|
||||
);
|
||||
class_id_type id(static_cast<class_id_type>(
|
||||
cobject_info_set.size()
|
||||
));
|
||||
cobject_type co(id, bis);
|
||||
std::pair<cobject_info_set_type::const_iterator, bool>
|
||||
result = cobject_info_set.insert(co);
|
||||
@@ -298,7 +305,7 @@ basic_iarchive_impl::register_type(
|
||||
cobject_id_vector.push_back(cobject_id(bis));
|
||||
assert(cobject_info_set.size() == cobject_id_vector.size());
|
||||
}
|
||||
id = result.first->class_id;
|
||||
id = result.first->m_class_id;
|
||||
// borland complains without this minor hack
|
||||
const int tid = id;
|
||||
cobject_id & coid = cobject_id_vector[tid];
|
||||
@@ -405,6 +412,11 @@ basic_iarchive_impl::load_pointer(
|
||||
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
|
||||
@@ -509,7 +521,7 @@ basic_iarchive::~basic_iarchive()
|
||||
}
|
||||
|
||||
BOOST_ARCHIVE_DECL(void)
|
||||
basic_iarchive::set_library_version(unsigned int archive_library_version){
|
||||
basic_iarchive::set_library_version(version_type archive_library_version){
|
||||
pimpl->set_library_version(archive_library_version);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user