diff --git a/boost/endian/cover_operators.hpp b/boost/endian/cover_operators.hpp index 56cf3c8..2d63ac4 100644 --- a/boost/endian/cover_operators.hpp +++ b/boost/endian/cover_operators.hpp @@ -27,7 +27,7 @@ namespace boost { - namespace integer + namespace endian { // A class that adds integer operators to an integer cover class @@ -105,7 +105,7 @@ namespace boost } # endif }; - } // namespace integer + } // namespace endian } // namespace boost #endif // BOOST_INTEGER_COVER_OPERATORS_HPP diff --git a/boost/endian/integers.hpp b/boost/endian/integers.hpp index 47db4a8..084b821 100644 --- a/boost/endian/integers.hpp +++ b/boost/endian/integers.hpp @@ -33,7 +33,7 @@ #include #define BOOST_MINIMAL_INTEGER_COVER_OPERATORS #define BOOST_NO_IO_COVER_OPERATORS -#include +#include #undef BOOST_NO_IO_COVER_OPERATORS #undef BOOST_MINIMAL_INTEGER_COVER_OPERATORS #include @@ -148,7 +148,7 @@ namespace boost } // namespace detail - namespace integer + namespace endian { # ifdef BOOST_ENDIAN_LOG @@ -421,7 +421,7 @@ namespace boost typedef endian< endianness::little, uint64_t, 64, alignment::aligned > aligned_ulittle64_t; # endif - } // namespace integer + } // namespace endian } // namespace boost #if defined(__BORLANDC__) || defined( __CODEGEARC__) diff --git a/libs/endian/example/endian_example.cpp b/libs/endian/example/endian_example.cpp index fb53c71..b33993d 100644 --- a/libs/endian/example/endian_example.cpp +++ b/libs/endian/example/endian_example.cpp @@ -14,9 +14,10 @@ #include #include #include -#include +#include +#include -using namespace boost::integer; +using namespace boost::endian; namespace { @@ -36,7 +37,7 @@ namespace const char * filename = "test.dat"; } -int main() +int cpp_main(int, char * []) { assert( sizeof( header ) == 16 ); // requirement for interoperability diff --git a/libs/endian/test/endian-in-sandbox/endian-in-sandbox.sln b/libs/endian/test/endian-in-sandbox/endian-in-sandbox.sln index a4e5c89..7d32719 100644 --- a/libs/endian/test/endian-in-sandbox/endian-in-sandbox.sln +++ b/libs/endian/test/endian-in-sandbox/endian-in-sandbox.sln @@ -17,8 +17,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "binary_stream_test", "binar EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "endian_binary_stream_test", "endian_binary_stream_test\endian_binary_stream_test.vcxproj", "{AD46E04C-C1E1-446E-8D5F-E11B6C438181}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "endian_flip_test", "endian_flip_test\endian_flip_test.vcxproj", "{9FA33B0B-2B00-49E8-A892-E049D86076A9}" -EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "binary_stream_example", "binary_stream_example\binary_stream_example.vcxproj", "{06736C67-6305-4A9F-8D10-850FD0CE907D}" EndProject Global @@ -59,10 +57,6 @@ Global {AD46E04C-C1E1-446E-8D5F-E11B6C438181}.Debug|Win32.Build.0 = Debug|Win32 {AD46E04C-C1E1-446E-8D5F-E11B6C438181}.Release|Win32.ActiveCfg = Release|Win32 {AD46E04C-C1E1-446E-8D5F-E11B6C438181}.Release|Win32.Build.0 = Release|Win32 - {9FA33B0B-2B00-49E8-A892-E049D86076A9}.Debug|Win32.ActiveCfg = Debug|Win32 - {9FA33B0B-2B00-49E8-A892-E049D86076A9}.Debug|Win32.Build.0 = Debug|Win32 - {9FA33B0B-2B00-49E8-A892-E049D86076A9}.Release|Win32.ActiveCfg = Release|Win32 - {9FA33B0B-2B00-49E8-A892-E049D86076A9}.Release|Win32.Build.0 = Release|Win32 {06736C67-6305-4A9F-8D10-850FD0CE907D}.Debug|Win32.ActiveCfg = Debug|Win32 {06736C67-6305-4A9F-8D10-850FD0CE907D}.Debug|Win32.Build.0 = Debug|Win32 {06736C67-6305-4A9F-8D10-850FD0CE907D}.Release|Win32.ActiveCfg = Release|Win32 diff --git a/libs/endian/test/endian_in_union_test.cpp b/libs/endian/test/endian_in_union_test.cpp index 37b246d..811cef4 100644 --- a/libs/endian/test/endian_in_union_test.cpp +++ b/libs/endian/test/endian_in_union_test.cpp @@ -11,10 +11,11 @@ #define BOOST_ENDIAN_FORCE_PODNESS -#include +#include +#include #include -using namespace boost::integer; +using namespace boost::endian; union U { @@ -75,7 +76,7 @@ union U U foo; -int main() +int cpp_main(int, char * []) { return 0; diff --git a/libs/endian/test/endian_operations_test.cpp b/libs/endian/test/endian_operations_test.cpp index e3634d7..4603bbc 100644 --- a/libs/endian/test/endian_operations_test.cpp +++ b/libs/endian/test/endian_operations_test.cpp @@ -18,11 +18,12 @@ #define BOOST_ENDIAN_LOG -#include +#include +#include #include #include -namespace bi = boost::integer; +namespace be = boost::endian; #ifdef _MSC_VER # pragma warning( disable : 4244 ) // conversion ..., possible loss of data @@ -127,8 +128,8 @@ void op_test_aux() #ifdef BOOST_SHORT_ENDIAN_TEST Test::test(); Test::test(); - Test::test(); - Test::test(); + Test::test(); + Test::test(); #else Test::test(); Test::test(); @@ -141,54 +142,54 @@ void op_test_aux() Test::test(); Test::test(); Test::test(); - Test::test(); - Test::test(); - Test::test(); - Test::test(); - Test::test(); - Test::test(); - Test::test(); - Test::test(); - Test::test(); - Test::test(); - Test::test(); - Test::test(); - Test::test(); - Test::test(); - Test::test(); - Test::test(); - Test::test(); - Test::test(); - Test::test(); - Test::test(); - Test::test(); - Test::test(); - Test::test(); - Test::test(); - Test::test(); - Test::test(); - Test::test(); - Test::test(); - Test::test(); - Test::test(); - Test::test(); - Test::test(); - Test::test(); - Test::test(); - Test::test(); - Test::test(); - Test::test(); - Test::test(); - Test::test(); - Test::test(); - Test::test(); - Test::test(); - Test::test(); - Test::test(); - Test::test(); - Test::test(); - Test::test(); - Test::test(); + Test::test(); + Test::test(); + Test::test(); + Test::test(); + Test::test(); + Test::test(); + Test::test(); + Test::test(); + Test::test(); + Test::test(); + Test::test(); + Test::test(); + Test::test(); + Test::test(); + Test::test(); + Test::test(); + Test::test(); + Test::test(); + Test::test(); + Test::test(); + Test::test(); + Test::test(); + Test::test(); + Test::test(); + Test::test(); + Test::test(); + Test::test(); + Test::test(); + Test::test(); + Test::test(); + Test::test(); + Test::test(); + Test::test(); + Test::test(); + Test::test(); + Test::test(); + Test::test(); + Test::test(); + Test::test(); + Test::test(); + Test::test(); + Test::test(); + Test::test(); + Test::test(); + Test::test(); + Test::test(); + Test::test(); + Test::test(); #endif } @@ -198,9 +199,9 @@ void op_test() #ifdef BOOST_SHORT_ENDIAN_TEST op_test_aux(); op_test_aux(); - op_test_aux(); - op_test_aux(); - op_test_aux(); + op_test_aux(); + op_test_aux(); + op_test_aux(); #else op_test_aux(); op_test_aux(); @@ -213,79 +214,79 @@ void op_test() op_test_aux(); op_test_aux(); op_test_aux(); - op_test_aux(); - op_test_aux(); - op_test_aux(); - op_test_aux(); - op_test_aux(); - op_test_aux(); - op_test_aux(); - op_test_aux(); - op_test_aux(); - op_test_aux(); - op_test_aux(); - op_test_aux(); - op_test_aux(); - op_test_aux(); - op_test_aux(); - op_test_aux(); - op_test_aux(); - op_test_aux(); - op_test_aux(); - op_test_aux(); - op_test_aux(); - op_test_aux(); - op_test_aux(); - op_test_aux(); - op_test_aux(); - op_test_aux(); - op_test_aux(); - op_test_aux(); - op_test_aux(); - op_test_aux(); - op_test_aux(); - op_test_aux(); - op_test_aux(); - op_test_aux(); - op_test_aux(); - op_test_aux(); - op_test_aux(); - op_test_aux(); - op_test_aux(); - op_test_aux(); - op_test_aux(); - op_test_aux(); - op_test_aux(); - op_test_aux(); - op_test_aux(); - op_test_aux(); - op_test_aux(); - op_test_aux(); + op_test_aux(); + op_test_aux(); + op_test_aux(); + op_test_aux(); + op_test_aux(); + op_test_aux(); + op_test_aux(); + op_test_aux(); + op_test_aux(); + op_test_aux(); + op_test_aux(); + op_test_aux(); + op_test_aux(); + op_test_aux(); + op_test_aux(); + op_test_aux(); + op_test_aux(); + op_test_aux(); + op_test_aux(); + op_test_aux(); + op_test_aux(); + op_test_aux(); + op_test_aux(); + op_test_aux(); + op_test_aux(); + op_test_aux(); + op_test_aux(); + op_test_aux(); + op_test_aux(); + op_test_aux(); + op_test_aux(); + op_test_aux(); + op_test_aux(); + op_test_aux(); + op_test_aux(); + op_test_aux(); + op_test_aux(); + op_test_aux(); + op_test_aux(); + op_test_aux(); + op_test_aux(); + op_test_aux(); + op_test_aux(); + op_test_aux(); + op_test_aux(); + op_test_aux(); + op_test_aux(); + op_test_aux(); #endif } // main ------------------------------------------------------------------------------// -int main() +int cpp_main(int, char * []) { - bi::endian_log = false; + be::endian_log = false; // make sure some simple things work - bi::big32_t o1(1); - bi::big32_t o2(2L); - bi::big32_t o3(3LL); - bi::big64_t o4(1); + be::big32_t o1(1); + be::big32_t o2(2L); + be::big32_t o3(3LL); + be::big64_t o4(1); // use cases; if BOOST_ENDIAN_LOG is defined, will output to clog info on // what overloads and conversions are actually being performed. - bi::endian_log = true; + be::endian_log = true; std::clog << "set up test values\n"; - bi::big32_t big(12345); - bi::ulittle16_t ulittle(10); - bi::big64_t result; + be::big32_t big(12345); + be::ulittle16_t ulittle(10); + be::big64_t result; std::clog << "\nresult = +big\n"; @@ -340,19 +341,19 @@ int main() result = 5 * 10; std::clog << "\n"; - bi::endian_log = false; + be::endian_log = false; // test from Roland Schwarz that detected ambiguities unsigned u; - bi::ulittle32_t u1; - bi::ulittle32_t u2; + be::ulittle32_t u1; + be::ulittle32_t u2; u = 1; u1 = 1; u2 = u1 + u; // one more wrinkle - bi::ulittle16_t u3(3); + be::ulittle16_t u3(3); u3 = 3; u2 = u1 + u3; diff --git a/libs/endian/test/endian_test.cpp b/libs/endian/test/endian_test.cpp index 63de0b4..1251c98 100644 --- a/libs/endian/test/endian_test.cpp +++ b/libs/endian/test/endian_test.cpp @@ -16,9 +16,10 @@ //----------------------------------------------------------------------------// -#include +#include #include #include +#include #include #include @@ -28,7 +29,7 @@ using namespace std; // Not the best programming practice, but I using namespace boost; // want to verify this combination of using -using namespace boost::integer; // namespaces works. See endian_operations_test +using namespace boost::endian; // namespaces works. See endian_operations_test // // for tests that don't do "using namespace". #define VERIFY(predicate) verify( predicate, __LINE__ ) @@ -720,7 +721,7 @@ namespace // main ------------------------------------------------------------------------------// -int main( int argc, char * argv[] ) +int cpp_main( int argc, char * argv[] ) { cout << "Usage: " << argv[0] << " [#],\n where # specifies iteration count\n"