|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r57981 - in trunk/boost/archive: . detail impl
From: ramey_at_[hidden]
Date: 2009-11-27 16:24:09
Author: ramey
Date: 2009-11-27 16:24:07 EST (Fri, 27 Nov 2009)
New Revision: 57981
URL: http://svn.boost.org/trac/boost/changeset/57981
Log:
changes to minimize warnings in library build
Text files modified:
trunk/boost/archive/basic_archive.hpp | 29 +++++++++++++++++++++--------
trunk/boost/archive/basic_text_iprimitive.hpp | 6 ++++--
trunk/boost/archive/basic_text_oprimitive.hpp | 8 ++++----
trunk/boost/archive/detail/basic_iarchive.hpp | 2 +-
trunk/boost/archive/detail/basic_iserializer.hpp | 3 ++-
trunk/boost/archive/detail/basic_oserializer.hpp | 3 ++-
trunk/boost/archive/detail/iserializer.hpp | 6 +++---
trunk/boost/archive/detail/oserializer.hpp | 4 ++--
trunk/boost/archive/detail/polymorphic_iarchive_route.hpp | 2 +-
trunk/boost/archive/impl/basic_text_iarchive.ipp | 4 ++--
trunk/boost/archive/impl/basic_text_iprimitive.ipp | 12 ++++++------
trunk/boost/archive/impl/basic_text_oprimitive.ipp | 2 +-
trunk/boost/archive/impl/xml_iarchive_impl.ipp | 4 +++-
trunk/boost/archive/impl/xml_wiarchive_impl.ipp | 4 +++-
trunk/boost/archive/polymorphic_iarchive.hpp | 2 +-
trunk/boost/archive/shared_ptr_helper.hpp | 13 +++++++------
16 files changed, 63 insertions(+), 41 deletions(-)
Modified: trunk/boost/archive/basic_archive.hpp
==============================================================================
--- trunk/boost/archive/basic_archive.hpp (original)
+++ trunk/boost/archive/basic_archive.hpp 2009-11-27 16:24:07 EST (Fri, 27 Nov 2009)
@@ -19,21 +19,34 @@
#include <boost/config.hpp>
#include <boost/cstdint.hpp>
#include <boost/noncopyable.hpp>
+#include <boost/integer_traits.hpp>
#include <boost/serialization/strong_typedef.hpp>
#include <boost/archive/detail/auto_link_archive.hpp>
#include <boost/archive/detail/abi_prefix.hpp> // must be the last header
+#define BOOST_ARCHIVE_STRONG_TYPEDEF(T, D) \
+namespace boost { \
+namespace archive { \
+BOOST_STRONG_TYPEDEF(T, D) \
+} /* archive */ \
+template<> \
+class integer_traits<boost::archive::D> : \
+ public integer_traits<boost::T> \
+{}; \
+} /* boost */ \
+/**/
+
+BOOST_ARCHIVE_STRONG_TYPEDEF(uint_least16_t, version_type)
+BOOST_ARCHIVE_STRONG_TYPEDEF(int_least16_t, class_id_type)
+BOOST_ARCHIVE_STRONG_TYPEDEF(int_least16_t, class_id_optional_type)
+BOOST_ARCHIVE_STRONG_TYPEDEF(int_least16_t, class_id_reference_type)
+BOOST_ARCHIVE_STRONG_TYPEDEF(uint_least32_t, object_id_type)
+BOOST_ARCHIVE_STRONG_TYPEDEF(uint_least32_t, object_reference_type)
+
namespace boost {
namespace archive {
-BOOST_STRONG_TYPEDEF(boost::int_least16_t, version_type)
-BOOST_STRONG_TYPEDEF(boost::int_least16_t, class_id_type)
-BOOST_STRONG_TYPEDEF(boost::int_least16_t, class_id_optional_type)
-BOOST_STRONG_TYPEDEF(boost::int_least16_t, class_id_reference_type)
-BOOST_STRONG_TYPEDEF(boost::uint_least32_t, object_id_type)
-BOOST_STRONG_TYPEDEF(boost::uint_least32_t, object_reference_type)
-
struct tracking_type {
// typedef bool value_type;
bool t;
@@ -98,7 +111,7 @@
BOOST_ARCHIVE_DECL(const char *)
BOOST_ARCHIVE_SIGNATURE();
-BOOST_ARCHIVE_DECL(unsigned char)
+BOOST_ARCHIVE_DECL(version_type)
BOOST_ARCHIVE_VERSION();
}// namespace archive
Modified: trunk/boost/archive/basic_text_iprimitive.hpp
==============================================================================
--- trunk/boost/archive/basic_text_iprimitive.hpp (original)
+++ trunk/boost/archive/basic_text_iprimitive.hpp 2009-11-27 16:24:07 EST (Fri, 27 Nov 2009)
@@ -49,6 +49,7 @@
#include <boost/serialization/throw_exception.hpp>
#include <boost/archive/archive_exception.hpp>
+#include <boost/archive/basic_streambuf_locale_saver.hpp>
#include <boost/archive/detail/abi_prefix.hpp> // must be the last header
namespace boost {
@@ -70,8 +71,9 @@
#ifndef BOOST_NO_STD_LOCALE
boost::scoped_ptr<std::locale> archive_locale;
- io::basic_ios_locale_saver<
- BOOST_DEDUCED_TYPENAME IStream::char_type, BOOST_DEDUCED_TYPENAME IStream::traits_type
+ basic_streambuf_locale_saver<
+ BOOST_DEDUCED_TYPENAME IStream::char_type,
+ BOOST_DEDUCED_TYPENAME IStream::traits_type
> locale_saver;
#endif
Modified: trunk/boost/archive/basic_text_oprimitive.hpp
==============================================================================
--- trunk/boost/archive/basic_text_oprimitive.hpp (original)
+++ trunk/boost/archive/basic_text_oprimitive.hpp 2009-11-27 16:24:07 EST (Fri, 27 Nov 2009)
@@ -50,9 +50,8 @@
#include <boost/io/ios_state.hpp>
#include <boost/scoped_ptr.hpp>
#include <boost/serialization/throw_exception.hpp>
-
#include <boost/archive/archive_exception.hpp>
-
+#include <boost/archive/basic_streambuf_locale_saver.hpp>
#include <boost/archive/detail/abi_prefix.hpp> // must be the last header
namespace boost {
@@ -76,8 +75,9 @@
#ifndef BOOST_NO_STD_LOCALE
boost::scoped_ptr<std::locale> archive_locale;
- io::basic_ios_locale_saver<
- BOOST_DEDUCED_TYPENAME OStream::char_type, BOOST_DEDUCED_TYPENAME OStream::traits_type
+ basic_streambuf_locale_saver<
+ BOOST_DEDUCED_TYPENAME OStream::char_type,
+ BOOST_DEDUCED_TYPENAME OStream::traits_type
> locale_saver;
#endif
Modified: trunk/boost/archive/detail/basic_iarchive.hpp
==============================================================================
--- trunk/boost/archive/detail/basic_iarchive.hpp (original)
+++ trunk/boost/archive/detail/basic_iarchive.hpp 2009-11-27 16:24:07 EST (Fri, 27 Nov 2009)
@@ -83,7 +83,7 @@
);
// real public API starts here
void
- set_library_version(unsigned int archive_library_version);
+ set_library_version(version_type archive_library_version);
unsigned int
get_library_version() const;
unsigned int
Modified: trunk/boost/archive/detail/basic_iserializer.hpp
==============================================================================
--- trunk/boost/archive/detail/basic_iserializer.hpp (original)
+++ trunk/boost/archive/detail/basic_iserializer.hpp 2009-11-27 16:24:07 EST (Fri, 27 Nov 2009)
@@ -19,6 +19,7 @@
#include <cstdlib> // NULL
#include <boost/config.hpp>
+#include <boost/archive/basic_archive.hpp>
#include <boost/archive/detail/decl.hpp>
#include <boost/archive/detail/basic_serializer.hpp>
#include <boost/archive/detail/auto_link_archive.hpp>
@@ -75,7 +76,7 @@
// returns true if objects should be tracked
virtual bool tracking(const unsigned int) const = 0 ;
// returns class version
- virtual unsigned int version() const = 0 ;
+ virtual version_type version() const = 0 ;
// returns true if this class is polymorphic
virtual bool is_polymorphic() const = 0;
virtual void destroy(/*const*/ void *address) const = 0 ;
Modified: trunk/boost/archive/detail/basic_oserializer.hpp
==============================================================================
--- trunk/boost/archive/detail/basic_oserializer.hpp (original)
+++ trunk/boost/archive/detail/basic_oserializer.hpp 2009-11-27 16:24:07 EST (Fri, 27 Nov 2009)
@@ -20,6 +20,7 @@
#include <boost/config.hpp>
#include <boost/noncopyable.hpp>
+#include <boost/archive/basic_archive.hpp>
#include <boost/archive/detail/auto_link_archive.hpp>
#include <boost/archive/detail/basic_serializer.hpp>
@@ -74,7 +75,7 @@
// returns true if objects should be tracked
virtual bool tracking(const unsigned int flags) const = 0;
// returns class version
- virtual unsigned int version() const = 0;
+ virtual version_type version() const = 0;
// returns true if this class is polymorphic
virtual bool is_polymorphic() const = 0;
};
Modified: trunk/boost/archive/detail/iserializer.hpp
==============================================================================
--- trunk/boost/archive/detail/iserializer.hpp (original)
+++ trunk/boost/archive/detail/iserializer.hpp 2009-11-27 16:24:07 EST (Fri, 27 Nov 2009)
@@ -149,8 +149,8 @@
== boost::serialization::track_selectively
&& serialized_as_pointer());
}
- virtual unsigned int version() const {
- return ::boost::serialization::version<T>::value;
+ virtual version_type version() const {
+ return version_type(::boost::serialization::version<T>::value);
}
virtual bool is_polymorphic() const {
return boost::is_polymorphic<T>::value;
@@ -169,7 +169,7 @@
const unsigned int file_version
) const {
// trap case where the program cannot handle the current version
- if(file_version > version())
+ if(file_version > static_cast<const unsigned int>(version()))
boost::serialization::throw_exception(
archive::archive_exception(
boost::archive::archive_exception::unsupported_class_version,
Modified: trunk/boost/archive/detail/oserializer.hpp
==============================================================================
--- trunk/boost/archive/detail/oserializer.hpp (original)
+++ trunk/boost/archive/detail/oserializer.hpp 2009-11-27 16:24:07 EST (Fri, 27 Nov 2009)
@@ -124,8 +124,8 @@
|| (boost::serialization::tracking_level<T>::value == boost::serialization::track_selectively
&& serialized_as_pointer());
}
- virtual unsigned int version() const {
- return ::boost::serialization::version<T>::value;
+ virtual version_type version() const {
+ return version_type(::boost::serialization::version<T>::value);
}
virtual bool is_polymorphic() const {
return boost::is_polymorphic<T>::value;
Modified: trunk/boost/archive/detail/polymorphic_iarchive_route.hpp
==============================================================================
--- trunk/boost/archive/detail/polymorphic_iarchive_route.hpp (original)
+++ trunk/boost/archive/detail/polymorphic_iarchive_route.hpp 2009-11-27 16:24:07 EST (Fri, 27 Nov 2009)
@@ -67,7 +67,7 @@
){
return ArchiveImplementation::load_pointer(t, bpis_ptr);
}
- virtual void set_library_version(unsigned int archive_library_version){
+ virtual void set_library_version(version_type archive_library_version){
ArchiveImplementation::set_library_version(archive_library_version);
}
virtual unsigned int get_library_version() const{
Modified: trunk/boost/archive/impl/basic_text_iarchive.ipp
==============================================================================
--- trunk/boost/archive/impl/basic_text_iarchive.ipp (original)
+++ trunk/boost/archive/impl/basic_text_iarchive.ipp 2009-11-27 16:24:07 EST (Fri, 27 Nov 2009)
@@ -64,11 +64,11 @@
#if ! BOOST_WORKAROUND(BOOST_MSVC, <= 1200)
detail::
#endif
- basic_iarchive::set_library_version(input_library_version.t);
+ basic_iarchive::set_library_version(input_library_version);
#endif
// extra little .t is to get around borland quirk
- if(BOOST_ARCHIVE_VERSION() < input_library_version.t)
+ if(BOOST_ARCHIVE_VERSION() < input_library_version)
boost::serialization::throw_exception(
archive_exception(archive_exception::unsupported_version)
);
Modified: trunk/boost/archive/impl/basic_text_iprimitive.ipp
==============================================================================
--- trunk/boost/archive/impl/basic_text_iprimitive.ipp (original)
+++ trunk/boost/archive/impl/basic_text_iprimitive.ipp 2009-11-27 16:24:07 EST (Fri, 27 Nov 2009)
@@ -39,13 +39,13 @@
template<>
bool is_whitespace(char t){
- return std::isspace(t);
+ return 0 != std::isspace(t);
}
#ifndef BOOST_NO_CWCHAR
template<>
bool is_whitespace(wchar_t t){
- return std::iswspace(t);
+ return 0 != std::iswspace(t);
}
#endif
}
@@ -104,11 +104,11 @@
iterators::istream_iterator<CharType> i;
for(;;){
- CharType c;
- c = is.get();
+ BOOST_DEDUCED_TYPENAME IStream::int_type r;
+ r = is.get();
if(is.eof())
break;
- if(is_whitespace(c))
+ if(is_whitespace(static_cast<CharType>(r)))
break;
}
}
@@ -124,7 +124,7 @@
flags_saver(is_),
precision_saver(is_),
archive_locale(NULL),
- locale_saver(is_)
+ locale_saver(* is_.rdbuf())
{
if(! no_codecvt){
archive_locale.reset(
Modified: trunk/boost/archive/impl/basic_text_oprimitive.ipp
==============================================================================
--- trunk/boost/archive/impl/basic_text_oprimitive.ipp (original)
+++ trunk/boost/archive/impl/basic_text_oprimitive.ipp 2009-11-27 16:24:07 EST (Fri, 27 Nov 2009)
@@ -84,7 +84,7 @@
flags_saver(os_),
precision_saver(os_),
archive_locale(NULL),
- locale_saver(os_)
+ locale_saver(* os_.rdbuf())
{
if(! no_codecvt){
archive_locale.reset(
Modified: trunk/boost/archive/impl/xml_iarchive_impl.ipp
==============================================================================
--- trunk/boost/archive/impl/xml_iarchive_impl.ipp (original)
+++ trunk/boost/archive/impl/xml_iarchive_impl.ipp 2009-11-27 16:24:07 EST (Fri, 27 Nov 2009)
@@ -156,7 +156,9 @@
BOOST_ARCHIVE_DECL(void)
xml_iarchive_impl<Archive>::init(){
gimpl->init(is);
- this->set_library_version(gimpl->rv.version);
+ this->set_library_version(
+ version_type(gimpl->rv.version)
+ );
}
template<class Archive>
Modified: trunk/boost/archive/impl/xml_wiarchive_impl.ipp
==============================================================================
--- trunk/boost/archive/impl/xml_wiarchive_impl.ipp (original)
+++ trunk/boost/archive/impl/xml_wiarchive_impl.ipp 2009-11-27 16:24:07 EST (Fri, 27 Nov 2009)
@@ -146,7 +146,9 @@
BOOST_WARCHIVE_DECL(void)
xml_wiarchive_impl<Archive>::init(){
gimpl->init(is);
- this->set_library_version(gimpl->rv.version);
+ this->set_library_version(
+ version_type(gimpl->rv.version)
+ );
}
template<class Archive>
Modified: trunk/boost/archive/polymorphic_iarchive.hpp
==============================================================================
--- trunk/boost/archive/polymorphic_iarchive.hpp (original)
+++ trunk/boost/archive/polymorphic_iarchive.hpp 2009-11-27 16:24:07 EST (Fri, 27 Nov 2009)
@@ -141,7 +141,7 @@
virtual ~polymorphic_iarchive_impl(){};
public:
// utility function implemented by all legal archives
- virtual void set_library_version(unsigned int archive_library_version) = 0;
+ virtual void set_library_version(version_type archive_library_version) = 0;
virtual unsigned int get_library_version() const = 0;
virtual unsigned int get_flags() const = 0;
virtual void delete_created_pointers() = 0;
Modified: trunk/boost/archive/shared_ptr_helper.hpp
==============================================================================
--- trunk/boost/archive/shared_ptr_helper.hpp (original)
+++ trunk/boost/archive/shared_ptr_helper.hpp 2009-11-27 16:24:07 EST (Fri, 27 Nov 2009)
@@ -98,17 +98,18 @@
// returns pointer to object and an indicator whether this is a
// new entry (true) or a previous one (false)
- BOOST_ARCHIVE_DECL(result_type) get_od(
- void * od,
- const boost::serialization::extended_type_info * true_type,
- const boost::serialization::extended_type_info * this_type
+ BOOST_ARCHIVE_DECL(result_type)
+ get_od(
+ void * od,
+ const boost::serialization::extended_type_info * true_type,
+ const boost::serialization::extended_type_info * this_type
);
template<class T>
struct non_polymorphic {
static const boost::serialization::extended_type_info *
get_object_identifier(T & t){
- return boost::serialization::singleton<
+ return & boost::serialization::singleton<
BOOST_DEDUCED_TYPENAME
boost::serialization::type_info_implementation<T>::type
>::get_const_instance();
@@ -157,7 +158,7 @@
);
result_type r =
get_od(
- t,
+ static_cast<void *>(t),
true_type,
this_type
);
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