From 9089eb037b65840ad9093708d35940ba737e1b8a Mon Sep 17 00:00:00 2001 From: Beman Date: Sat, 18 May 2013 16:14:30 -0400 Subject: [PATCH] Rename header converters.hpp back to conversion.hpp. Clean up infrastructure. --- example/udt_conversion_example.cpp | 2 +- .../endian/{converters.hpp => conversion.hpp} | 23 +++++++++---------- include/boost/endian/std_pair.hpp | 2 +- test/benchmark.cpp | 2 +- test/converter_test.cpp | 2 +- .../endian_example/endian_example.vcxproj | 2 ++ .../endian_in_union_test.vcxproj | 2 ++ .../endian_operations_test.vcxproj | 2 ++ test/msvc2012/endian_test/endian_test.vcxproj | 1 + test/speed_test.cpp | 2 +- 10 files changed, 23 insertions(+), 17 deletions(-) rename include/boost/endian/{converters.hpp => conversion.hpp} (99%) diff --git a/example/udt_conversion_example.cpp b/example/udt_conversion_example.cpp index be10f69..34bf056 100644 --- a/example/udt_conversion_example.cpp +++ b/example/udt_conversion_example.cpp @@ -11,7 +11,7 @@ #include -#include +#include #include #include diff --git a/include/boost/endian/converters.hpp b/include/boost/endian/conversion.hpp similarity index 99% rename from include/boost/endian/converters.hpp rename to include/boost/endian/conversion.hpp index 023bd25..e9090bc 100644 --- a/include/boost/endian/converters.hpp +++ b/include/boost/endian/conversion.hpp @@ -1,4 +1,4 @@ -// boost/endian/converters.hpp -------------------------------------------------------// +// boost/endian/conversion.hpp -------------------------------------------------------// // Copyright Beman Dawes 2010, 2011 @@ -47,17 +47,6 @@ namespace endian inline float reverse_value(float x) BOOST_NOEXCEPT; inline double reverse_value(double x) BOOST_NOEXCEPT; - namespace detail - // This function is unsafe for general use, so is placed in namespace detail. - // Think of what happens if you reverse_value a std::pair; the bytes - // from first end up in second and the bytes from second end up in first. Not good! - { - // general reverse_value function template to meet requests for UDT support by Vicente - // Botet and others. - template - inline T reverse_value(T x) BOOST_NOEXCEPT; // convert little to big or visa versa - } - // reverse bytes unless native endianness is big // possible names: reverse_unless_native_big, reverse_value_unless_big, reverse_unless_big template @@ -136,6 +125,16 @@ namespace endian //----------------------------------- end synopsis -------------------------------------// + namespace detail + // This function is unsafe for general use, so is placed in namespace detail. + // Think of what happens if you reverse_value a std::pair; the bytes + // from first end up in second and the bytes from second end up in first. Not good! + { + // general reverse_value function template useful in testing + template + inline T reverse_value(T x) BOOST_NOEXCEPT; // convert little to big or visa versa + } + //--------------------------------------------------------------------------------------// // // // implementation // diff --git a/include/boost/endian/std_pair.hpp b/include/boost/endian/std_pair.hpp index f1ac7ca..8da74b4 100644 --- a/include/boost/endian/std_pair.hpp +++ b/include/boost/endian/std_pair.hpp @@ -10,7 +10,7 @@ #ifndef BOOST_ENDIAN_STD_PAIR_HPP #define BOOST_ENDIAN_STD_PAIR_HPP -#include +#include #include namespace boost diff --git a/test/benchmark.cpp b/test/benchmark.cpp index e7f1f8e..6b631ab 100644 --- a/test/benchmark.cpp +++ b/test/benchmark.cpp @@ -8,7 +8,7 @@ #define _CRT_SECURE_NO_WARNINGS #include -#include +#include #include #include #include diff --git a/test/converter_test.cpp b/test/converter_test.cpp index 76e9bb7..045f850 100644 --- a/test/converter_test.cpp +++ b/test/converter_test.cpp @@ -9,7 +9,7 @@ #include -#include +#include #include #include #include diff --git a/test/msvc2012/endian_example/endian_example.vcxproj b/test/msvc2012/endian_example/endian_example.vcxproj index 9cc791f..dc1ee63 100644 --- a/test/msvc2012/endian_example/endian_example.vcxproj +++ b/test/msvc2012/endian_example/endian_example.vcxproj @@ -58,6 +58,7 @@ EditAndContinue + Level3 true @@ -75,6 +76,7 @@ ProgramDatabase + Level3 true diff --git a/test/msvc2012/endian_in_union_test/endian_in_union_test.vcxproj b/test/msvc2012/endian_in_union_test/endian_in_union_test.vcxproj index 1e755c4..bdd758c 100644 --- a/test/msvc2012/endian_in_union_test/endian_in_union_test.vcxproj +++ b/test/msvc2012/endian_in_union_test/endian_in_union_test.vcxproj @@ -61,6 +61,7 @@ EditAndContinue + Level3 true @@ -78,6 +79,7 @@ ProgramDatabase + Level3 true diff --git a/test/msvc2012/endian_operations_test/endian_operations_test.vcxproj b/test/msvc2012/endian_operations_test/endian_operations_test.vcxproj index 7177879..b816155 100644 --- a/test/msvc2012/endian_operations_test/endian_operations_test.vcxproj +++ b/test/msvc2012/endian_operations_test/endian_operations_test.vcxproj @@ -66,6 +66,7 @@ EditAndContinue 4552;%(DisableSpecificWarnings) + Level3 true @@ -84,6 +85,7 @@ ProgramDatabase + Level3 true diff --git a/test/msvc2012/endian_test/endian_test.vcxproj b/test/msvc2012/endian_test/endian_test.vcxproj index 740a2e8..19b2728 100644 --- a/test/msvc2012/endian_test/endian_test.vcxproj +++ b/test/msvc2012/endian_test/endian_test.vcxproj @@ -80,6 +80,7 @@ ProgramDatabase + Level3 true diff --git a/test/speed_test.cpp b/test/speed_test.cpp index d3a4e19..cb0cd7d 100644 --- a/test/speed_test.cpp +++ b/test/speed_test.cpp @@ -11,7 +11,7 @@ #include -#include +#include #include #include #include