Revert changes intended for trunk

[SVN r57701]
This commit is contained in:
Robert Ramey
2009-11-16 05:32:31 +00:00
parent 1f49950d27
commit 09bf7cb705
59 changed files with 86 additions and 130 deletions

View File

@@ -74,11 +74,6 @@ A::operator std::size_t () const {
return retval;
}
#if defined(_MSC_VER)
#pragma warning(push) // Save warning settings.
#pragma warning(disable : 4244) // Disable possible loss of data warning
#endif
A::A() :
b(true),
#ifndef BOOST_NO_INT64_T
@@ -95,8 +90,8 @@ A::A() :
r(std::rand()),
#endif
c(0xff & std::rand()),
s(0xff & std::rand()),
t(0xff & std::rand()),
s(std::rand()),
t(std::rand()),
u(std::rand()),
v(std::rand()),
w((float)std::rand()),
@@ -108,10 +103,6 @@ A::A() :
#endif
}
#if defined(_MSC_VER)
#pragma warning(pop) // Restore warnings to previous state.
#endif
bool A::operator==(const A &rhs) const
{
if(b != rhs.b)

View File

@@ -86,8 +86,8 @@ public:
};
B::B() :
s(static_cast<signed char>(std::rand())),
t(static_cast<unsigned char>(std::rand())),
s(std::rand()),
t(std::rand()),
u(std::rand()),
v(std::rand()),
w((float)std::rand() / std::rand()),

View File

@@ -8,7 +8,7 @@
// should pass compilation and execution
#include <cstdlib> // for rand(), NULL, size_t
#include <cstdlib> // for rand(), NULL
#include <fstream>
#include <boost/config.hpp>
@@ -48,7 +48,7 @@ public:
A::A(){
int i = sizeof(data);
while(i-- > 0)
data[i] = static_cast<char>(0xff & std::rand());
data[i] = 0xff & std::rand();
}
bool A::operator==(const A & rhs) const {

View File

@@ -87,7 +87,7 @@ test_main( int /* argc */, char* /* argv */[] )
vec.push_back(a);
}
const char * testfile = boost::archive::tmpnam(0);
const char * testfile = boost::archive::tmpnam(NULL);
BOOST_REQUIRE(NULL != testfile);
//output the vector

View File

@@ -23,7 +23,7 @@ namespace std{
#include "B.hpp"
#include "A.ipp"
int test_main( int /*argc*/, char* /*argv*/[] )
int test_main( int argc, char* argv[] )
{
const char * testfile = boost::archive::tmpnam(NULL);

View File

@@ -37,6 +37,6 @@ private:
};
int
main(int /*argc*/, char * /*argv*/[]){
main(int argc, char * argv[]){
return 0;
}

View File

@@ -105,7 +105,7 @@ void test_transform_width(unsigned int size){
char * rptr;
for(rptr = rawdata + 6; rptr-- > rawdata;)
*rptr = static_cast<char>(0xff & std::rand());
*rptr = std::rand();
// convert 8 to 6 bit characters
typedef boost::archive::iterators::transform_width<

View File

@@ -42,7 +42,7 @@ void test_base64(){
std::size_t size = sizeof(rawdata) / sizeof(CharType);
CharType * rptr;
for(rptr = rawdata + size; rptr-- > rawdata;)
*rptr = static_cast<CharType>(std::rand());
*rptr = std::rand();
// convert to base64
typedef std::list<CharType> text_base64_type;
@@ -90,7 +90,7 @@ void test_base64(){
}
int
test_main( int /*argc*/, char* /*argv*/[] )
test_main( int argc, char* argv[] )
{
test_base64<char>();
#ifndef BOOST_NO_CWCHAR

View File

@@ -30,7 +30,7 @@ namespace std{
class ANew : public A {
friend class boost::serialization::access;
template<class Archive>
void serialize(Archive & ar, const unsigned /*file_version*/){
void serialize(Archive & ar, const unsigned file_version){
ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP(A);
}
public:
@@ -43,7 +43,7 @@ public:
++m_new_calls;
return ::operator new(s);
}
static void operator delete(void *p, std::size_t /*s*/){
static void operator delete(void *p, std::size_t s){
++m_delete_calls;
::operator delete(p);
}

View File

@@ -63,8 +63,6 @@ class A
ar & BOOST_SERIALIZATION_NVP(w);
ar & BOOST_SERIALIZATION_NVP(x);
}
A(const A & rhs);
A & operator=(const A & rhs);
public:
static int count;
const int & get_i() const {
@@ -78,8 +76,8 @@ int A::count = 0;
A::A(int i_) :
i(i_),
s(static_cast<signed char>(0xff & std::rand())),
t(static_cast<signed char>(0xff & std::rand())),
s(std::rand()),
t(std::rand()),
u(std::rand()),
v(std::rand()),
w((float)std::rand() / std::rand()),
@@ -106,13 +104,13 @@ bool A::operator==(const A &rhs) const
bool A::operator<(const A &rhs) const
{
if(! (s == rhs.s) )
if(! s == rhs.s )
return s < rhs.s;
if(! (t == rhs.t) )
if(! t == rhs.t )
return t < rhs.t;
if(! (u == rhs.u) )
if(! u == rhs.u )
return t < rhs.u;
if(! (v == rhs.v) )
if(! v == rhs.v )
return t < rhs.v;
if(! (std::fabs(w - rhs.w) < std::numeric_limits<float>::round_error() ) )
return t < rhs.w;

View File

@@ -99,17 +99,14 @@ template <class ArchiveT>
void save_construct_data(
ArchiveT& archive,
const A* p,
const BOOST_PFTO unsigned int /*version*/
const BOOST_PFTO unsigned int version
){
archive & boost::serialization::make_nvp("initialValue", p->value);
}
template <class ArchiveT>
void load_construct_data(
ArchiveT& archive,
A* p,
const unsigned int /*version*/
){
void load_construct_data(ArchiveT& archive, A* p, const unsigned int version)
{
IntValueHolder initialValue;
archive & boost::serialization::make_nvp("initialValue", initialValue);

View File

@@ -51,8 +51,8 @@ public:
};
A::A() :
s(static_cast<signed char>(0xff & std::rand())),
t(static_cast<signed char>(0xff & std::rand())),
s(std::rand()),
t(std::rand()),
u(std::rand()),
v(std::rand()),
w((float)std::rand() / std::rand()),
@@ -74,13 +74,13 @@ bool A::operator==(const A &rhs) const
bool A::operator<(const A &rhs) const
{
if(! (s == rhs.s) )
if(! s == rhs.s )
return s < rhs.s;
if(! (t == rhs.t) )
if(! t == rhs.t )
return t < rhs.t;
if(! (u == rhs.u) )
if(! u == rhs.u )
return t < rhs.u;
if(! (v == rhs.v) )
if(! v == rhs.v )
return t < rhs.v;
if(! (std::fabs(w - rhs.w) < std::numeric_limits<float>::round_error() ) )
return t < rhs.w;

View File

@@ -60,10 +60,8 @@ void load(const char *testfile)
test_istream is(testfile, TEST_STREAM_FLAGS);
test_iarchive ia(is, TEST_ARCHIVE_FLAGS);
polymorphic_derived1 dummy;
polymorphic_base *rb1 = & dummy;
polymorphic_derived1 *rd1 = & dummy;
polymorphic_base *rb1 = (polymorphic_base *)0xfffffff;
polymorphic_derived1 *rd1 = (polymorphic_derived1 *)0xffffffff;
ia >> BOOST_SERIALIZATION_NVP(rb1);
BOOST_CHECK_MESSAGE(NULL == rb1, "Null pointer not restored");

View File

@@ -26,8 +26,7 @@ namespace std{
#include "B.hpp"
#include "A.ipp"
int
test_main( int /* argc */, char* /* argv */[] )
int test_main( int argc, char* argv[] )
{
const char * testfile = boost::archive::tmpnam(NULL);
BOOST_REQUIRE(NULL != testfile);

View File

@@ -24,7 +24,7 @@ class V {
{}
~V(){}
template<class Archive>
void serialize(Archive& ar, unsigned /*version*/)
void serialize(Archive& ar, unsigned version)
{
ar & m_i;
}

View File

@@ -63,7 +63,7 @@ class B {
friend class boost::serialization::access;
int m_i;
template<class Archive>
void serialize(Archive &ar, const unsigned int /*file_version*/){
void serialize(Archive &ar, const unsigned int file_version){
ar & m_i;
}
public:
@@ -108,7 +108,7 @@ void test2(){
class D {
friend class boost::serialization::access;
template<class Archive>
void serialize(Archive &ar, const unsigned int /*file_version*/){
void serialize(Archive &ar, const unsigned int file_version){
ar & m_b;
}
public:
@@ -149,7 +149,7 @@ class E {
int m_i;
friend class boost::serialization::access;
template<class Archive>
void serialize(Archive &ar, const unsigned int /*file_version*/){
void serialize(Archive &ar, const unsigned int file_version){
ar & m_i;
}
public:
@@ -170,7 +170,7 @@ class F {
friend class boost::serialization::access;
E * m_eptr;
template<class Archive>
void serialize(Archive &ar, const unsigned int /*file_version*/){
void serialize(Archive &ar, const unsigned int file_version){
ar & m_eptr;
}
public:
@@ -219,13 +219,13 @@ class G {
A m_a2;
A *m_pa2;
template<class Archive>
void save(Archive &ar, const unsigned int /*file_version*/) const {
void save(Archive &ar, const unsigned int file_version) const {
ar << m_a1;
ar << m_a2;
ar << m_pa2;
}
template<class Archive>
void load(Archive &ar, const unsigned int /*file_version*/){
void load(Archive &ar, const unsigned int file_version){
A a; // temporary A
ar >> a;
m_a1 = a;

View File

@@ -25,20 +25,11 @@ class Base2
int b;
};
#ifdef BOOST_MSVC
# pragma warning(push)
# pragma warning(disable : 4511 4512)
#endif
class Derived : public Base1, public Base2
{
long c;
};
#ifdef BOOST_MSVC
#pragma warning(pop)
#endif
BOOST_BROKEN_COMPILER_TYPE_TRAITS_SPECIALIZATION(Base1)
BOOST_BROKEN_COMPILER_TYPE_TRAITS_SPECIALIZATION(Base2)
BOOST_BROKEN_COMPILER_TYPE_TRAITS_SPECIALIZATION(Derived)
@@ -121,6 +112,7 @@ void test_static_pointer_cast(){
);
}
class VBase1 : public boost::noncopyable
{
char a;
@@ -135,11 +127,6 @@ public:
virtual ~VBase2(){};
};
#ifdef BOOST_MSVC
# pragma warning(push)
# pragma warning(disable : 4511 4512)
#endif
class VDerived : public VBase1, public VBase2
{
long c;
@@ -147,10 +134,6 @@ public:
virtual ~VDerived(){};
};
#ifdef BOOST_MSVC
#pragma warning(pop)
#endif
BOOST_BROKEN_COMPILER_TYPE_TRAITS_SPECIALIZATION(VBase1)
BOOST_BROKEN_COMPILER_TYPE_TRAITS_SPECIALIZATION(VBase2)
BOOST_BROKEN_COMPILER_TYPE_TRAITS_SPECIALIZATION(VDerived)

View File

@@ -17,7 +17,6 @@
// See http://www.boost.org for updates, documentation, and revision history.
#include <cstdio> // remove, tmpnam
#include <cstddef> // size_t
#ifndef BOOST_NO_EXCEPTION_STD_NAMESPACE
#include <exception>
#endif
@@ -75,7 +74,7 @@ namespace boost {
namespace archive {
const char * test_filename(const char * dir = NULL, char *fname = NULL){
static char ibuffer [512];
std::size_t i;
int i;
ibuffer[0] = '\0';
if(NULL == dir){
dir = boost::archive::tmpdir();