diff --git a/Makefile b/Makefile index 650ce690..185f49b4 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -CPPFLAGS=-std=c++11 -I./include -Wall -Werror -g -Wextra -Wshadow +CPPFLAGS=-std=c++11 -I./include -Wall -Werror -g -Wextra -Wshadow -pedantic CXX=g++ COVERAGE_OUTPUT=out diff --git a/include/cereal/archives/binary.hpp b/include/cereal/archives/binary.hpp index 432be165..202c48e6 100644 --- a/include/cereal/archives/binary.hpp +++ b/include/cereal/archives/binary.hpp @@ -148,7 +148,7 @@ namespace cereal } // namespace cereal // register archives for polymorphic support -CEREAL_REGISTER_ARCHIVE(cereal::BinaryOutputArchive); -CEREAL_REGISTER_ARCHIVE(cereal::BinaryInputArchive); +CEREAL_REGISTER_ARCHIVE(cereal::BinaryOutputArchive) +CEREAL_REGISTER_ARCHIVE(cereal::BinaryInputArchive) #endif // CEREAL_ARCHIVES_BINARY_HPP_ diff --git a/include/cereal/archives/json.hpp b/include/cereal/archives/json.hpp index e2c6890f..03d956e5 100644 --- a/include/cereal/archives/json.hpp +++ b/include/cereal/archives/json.hpp @@ -765,7 +765,7 @@ namespace cereal } // namespace cereal // register archives for polymorphic support -CEREAL_REGISTER_ARCHIVE(cereal::JSONInputArchive); -CEREAL_REGISTER_ARCHIVE(cereal::JSONOutputArchive); +CEREAL_REGISTER_ARCHIVE(cereal::JSONInputArchive) +CEREAL_REGISTER_ARCHIVE(cereal::JSONOutputArchive) #endif // CEREAL_ARCHIVES_JSON_HPP_ diff --git a/include/cereal/archives/portable_binary.hpp b/include/cereal/archives/portable_binary.hpp index 27eeb38a..42079bdf 100644 --- a/include/cereal/archives/portable_binary.hpp +++ b/include/cereal/archives/portable_binary.hpp @@ -228,7 +228,7 @@ namespace cereal } // namespace cereal // register archives for polymorphic support -CEREAL_REGISTER_ARCHIVE(cereal::PortableBinaryOutputArchive); -CEREAL_REGISTER_ARCHIVE(cereal::PortableBinaryInputArchive); +CEREAL_REGISTER_ARCHIVE(cereal::PortableBinaryOutputArchive) +CEREAL_REGISTER_ARCHIVE(cereal::PortableBinaryInputArchive) #endif // CEREAL_ARCHIVES_PORTABLE_BINARY_HPP_ diff --git a/include/cereal/archives/xml.hpp b/include/cereal/archives/xml.hpp index e7073d14..9af22a86 100644 --- a/include/cereal/archives/xml.hpp +++ b/include/cereal/archives/xml.hpp @@ -778,7 +778,7 @@ namespace cereal } // namespace cereal // register archives for polymorphic support -CEREAL_REGISTER_ARCHIVE(cereal::XMLOutputArchive); -CEREAL_REGISTER_ARCHIVE(cereal::XMLInputArchive); +CEREAL_REGISTER_ARCHIVE(cereal::XMLOutputArchive) +CEREAL_REGISTER_ARCHIVE(cereal::XMLInputArchive) #endif // CEREAL_ARCHIVES_XML_HPP_ diff --git a/include/cereal/details/polymorphic_impl.hpp b/include/cereal/details/polymorphic_impl.hpp index f47e5a49..8934af78 100644 --- a/include/cereal/details/polymorphic_impl.hpp +++ b/include/cereal/details/polymorphic_impl.hpp @@ -340,7 +340,7 @@ namespace cereal See the documentation for the other functions to try and understand this */ template - void instantiate_polymorphic_binding( T*, int, adl_tag ) {}; + void instantiate_polymorphic_binding( T*, int, adl_tag ) {} } // namespace detail } // namespace cereal diff --git a/include/cereal/details/traits.hpp b/include/cereal/details/traits.hpp index e101ea44..8ca4a45a 100644 --- a/include/cereal/details/traits.hpp +++ b/include/cereal/details/traits.hpp @@ -60,7 +60,7 @@ namespace cereal }; \ } /* end namespace detail */ \ template \ - struct has_member_##name : std::integral_constant::value> {}; + struct has_member_##name : std::integral_constant::value> {} //! Creates a test for whether a non const non-member function exists /*! This creates a class derived from std::integral_constant that will be true if @@ -79,7 +79,7 @@ namespace cereal }; \ } /* end namespace detail */ \ template \ - struct has_non_member_##name : std::integral_constant::value> {}; + struct has_non_member_##name : std::integral_constant::value> {} //! Creates a test for whether a non const member function exists with a version parameter /*! This creates a class derived from std::integral_constant that will be true if @@ -98,7 +98,7 @@ namespace cereal }; \ } /* end namespace detail */ \ template \ - struct has_member_versioned_##name : std::integral_constant::value> {}; + struct has_member_versioned_##name : std::integral_constant::value> {} //! Creates a test for whether a non const non-member function exists with a version parameter /*! This creates a class derived from std::integral_constant that will be true if @@ -117,7 +117,7 @@ namespace cereal }; \ } /* end namespace detail */ \ template \ - struct has_non_member_versioned_##name : std::integral_constant::value> {}; + struct has_non_member_versioned_##name : std::integral_constant::value> {} // ###################################################################### // Member load_and_allocate diff --git a/include/cereal/types/polymorphic.hpp b/include/cereal/types/polymorphic.hpp index 4719c94c..08854d9b 100644 --- a/include/cereal/types/polymorphic.hpp +++ b/include/cereal/types/polymorphic.hpp @@ -68,7 +68,7 @@ static CONSTEXPR char const * name() { return #T; }; \ }; \ } } /* end namespaces */ \ - CEREAL_BIND_TO_ARCHIVES(T); + CEREAL_BIND_TO_ARCHIVES(T) //! Registers a polymorphic type with cereal, giving it a //! user defined name @@ -83,7 +83,7 @@ struct binding_name \ { static CONSTEXPR char const * name() { return Name; }; }; \ } } /* end namespaces */ \ - CEREAL_BIND_TO_ARCHIVES(T); + CEREAL_BIND_TO_ARCHIVES(T) namespace cereal { diff --git a/performance.cpp b/performance.cpp index 4ec5946e..ec4dc026 100644 --- a/performance.cpp +++ b/performance.cpp @@ -289,7 +289,7 @@ struct PoDStructCereal void serialize( Archive & ar ) { ar(a, b, c, d); - }; + } }; struct PoDStructBoost @@ -303,7 +303,7 @@ struct PoDStructBoost void serialize( Archive & ar, const unsigned int /*version*/ ) { ar & a & b & c & d; - }; + } }; struct PoDChildCereal : virtual PoDStructCereal @@ -317,7 +317,7 @@ struct PoDChildCereal : virtual PoDStructCereal void serialize( Archive & ar ) { ar( cereal::virtual_base_class(this), v ); - }; + } }; struct PoDChildBoost : virtual PoDStructBoost @@ -332,7 +332,7 @@ struct PoDChildBoost : virtual PoDStructBoost { ar & boost::serialization::base_object(*this); ar & v; - }; + } }; int main() diff --git a/sandbox.cpp b/sandbox.cpp index 8c9b9496..0d29a0e9 100644 --- a/sandbox.cpp +++ b/sandbox.cpp @@ -104,7 +104,7 @@ namespace cereal template struct specialize {}; } -CEREAL_REGISTER_TYPE(Derived); +CEREAL_REGISTER_TYPE(Derived) // ################################### struct Test1 @@ -235,7 +235,7 @@ struct EmptyStruct void serialize(Archive &) { std::cout << "Side effects!" << std::endl; - }; + } }; struct NonEmptyStruct @@ -776,7 +776,7 @@ int main() return 0; } -CEREAL_CLASS_VERSION(BoostTransitionMS, 1); -CEREAL_CLASS_VERSION(BoostTransitionSplit, 2); -CEREAL_CLASS_VERSION(BoostTransitionNMS, 3); +CEREAL_CLASS_VERSION(BoostTransitionMS, 1) +CEREAL_CLASS_VERSION(BoostTransitionSplit, 2) +CEREAL_CLASS_VERSION(BoostTransitionNMS, 3) // keep the other at default version (0) diff --git a/sandbox_rtti.cpp b/sandbox_rtti.cpp index 7a9a3020..96558f8a 100644 --- a/sandbox_rtti.cpp +++ b/sandbox_rtti.cpp @@ -73,7 +73,7 @@ struct MyType : public Base ar( cereal::base_class( this ) ); } }; -CEREAL_REGISTER_TYPE(MyType); +CEREAL_REGISTER_TYPE(MyType) struct YourType : public Base { @@ -97,7 +97,7 @@ struct YourType : public Base ar( x ); } }; -CEREAL_REGISTER_TYPE(YourType); +CEREAL_REGISTER_TYPE(YourType) struct OurBase { @@ -159,7 +159,7 @@ struct TestType void serialize( Archive & ar ) { ar( x ); - }; + } }; namespace cereal @@ -180,7 +180,7 @@ struct BBB : AAA void serialize( Archive & ) {} }; -CEREAL_REGISTER_TYPE(BBB); +CEREAL_REGISTER_TYPE(BBB) template void nop(T&&) {} @@ -202,7 +202,7 @@ int main() //oarchive(ptr3); //oarchive(ptr4); //oarchive(ptr5); - + //std::shared_ptr a = std::make_shared(); //oarchive(a); diff --git a/unittests.cpp b/unittests.cpp index 1a134f9f..c1e8a9ee 100644 --- a/unittests.cpp +++ b/unittests.cpp @@ -2816,7 +2816,7 @@ std::ostream& operator<<(std::ostream& os, PolyDerived const & s) return os; } -CEREAL_REGISTER_TYPE(PolyDerived); +CEREAL_REGISTER_TYPE(PolyDerived) template void test_polymorphic()