From c201455c84411dd5fc38814f6ceb3695344e937f Mon Sep 17 00:00:00 2001 From: Beman Date: Wed, 10 Dec 2014 09:39:03 -0500 Subject: [PATCH] Change "in_place" to "inplace". Rationale: shortens names without impacting expressiveness. --- doc/bikeshed.txt | 4 +- doc/conversion.html | 50 +++++++++++----------- example/udt_conversion_example.cpp | 16 +++---- include/boost/endian/conversion.hpp | 66 ++++++++++++++--------------- test/benchmark.cpp | 8 ++-- test/conversion_test.cpp | 64 ++++++++++++++-------------- test/endian_test.cpp | 16 +++---- test/loop_time_test.cpp | 6 +-- test/speed_test.cpp | 12 +++--- test/speed_test_functions.cpp | 24 +++++------ 10 files changed, 134 insertions(+), 132 deletions(-) diff --git a/doc/bikeshed.txt b/doc/bikeshed.txt index 9d26f54..67dbce1 100644 --- a/doc/bikeshed.txt +++ b/doc/bikeshed.txt @@ -6,9 +6,11 @@ return-by-value modify-argument reverse_endianness reverse_endianness_in_place " reverse_endianness_arg endian_reverse endian_reverse_in_place + " endian_reverse_inplace + " endian_reverse_replace " endian_reverse_in_situ " endian_reverse_here - " endian_reverse_this <----- + " endian_reverse_this " endian_reverse_self " endian_reverse_arg " endian_reverse_in diff --git a/doc/conversion.html b/doc/conversion.html index a460af1..42d05a6 100644 --- a/doc/conversion.html +++ b/doc/conversion.html @@ -122,20 +122,20 @@ namespace endian order order1, order order2) noexcept; template <class Reversible> - void endian_reverse_in_place(Reversible& x) noexcept; + void endian_reverse_inplace(Reversible& x) noexcept; template <class Reversible> - void big_to_native_in_place(Reversible& x) noexcept; + void big_to_native_inplace(Reversible& x) noexcept; template <class Reversible> - void native_to_big_in_place(Reversible& x) noexcept; + void native_to_big_inplace(Reversible& x) noexcept; template <class Reversible> - void little_to_native_in_place(Reversible& x) noexcept; + void little_to_native_inplace(Reversible& x) noexcept; template <class Reversible> - void native_to_little_in_place(Reversible& x) noexcept; + void native_to_little_inplace(Reversible& x) noexcept; template <order O1, order O2, class Reversible> - void conditional_reverse_in_place(Reversible& x) noexcept; + void conditional_reverse_inplace(Reversible& x) noexcept; template <class Reversible> - void conditional_reverse_in_place(Reversible& x, + void conditional_reverse_inplace(Reversible& x, order order1, order order2) noexcept; } // namespace endian @@ -170,7 +170,7 @@ instantiating a template.

- endian_reverse_in_place(x) + endian_reverse_inplace(x) x is a modifiable lvalue of type Reversible. @@ -186,10 +186,10 @@ modifiable lvalue of type Reversible. non-member function in the same namespace as the UDT itself so that the function can be found by argument dependent lookup (ADL).  —end note]

-

[Note: Because there is a function template for endian_reverse_in_place +

[Note: Because there is a function template for endian_reverse_inplace that calls endian_reverse, only endian_reverse is required for a user-defined type to meet the Reversible -requirements. User-defined types may provide endian_reverse_in_place +requirements. User-defined types may provide endian_reverse_inplace for improved efficiency. —end note]

This still isn't right. There are @@ -212,8 +212,8 @@ call to endian_reverse(argument), as described in the preceding table.

The endianness reversal function templates that modify their argument in -place, except endian_reverse_in_place itself, are required to perform reversal of endianness if needed by making an -unqualified call to endian_reverse_in_place(argument), +place, except endian_reverse_inplace itself, are required to perform reversal of endianness if needed by making an +unqualified call to endian_reverse_inplace(argument), as described in the preceding table.

See @@ -273,53 +273,53 @@ Reversible conditional_reverse(Reversible x,

template <class Reversible>
-void endian_reverse_in_place(Reversible& x) noexcept; 
+void endian_reverse_inplace(Reversible& x) noexcept;

Effects: x = endian_reverse(x).

template <class Reversible>
-void big_to_native_in_place(Reversible& x) noexcept; 
+void big_to_native_inplace(Reversible& x) noexcept;

- Effects: conditional_reverse_in_place<order::big, + Effects: conditional_reverse_inplace<order::big, order::native>(x).

template <class Reversible>
-void native_to_big_in_place(Reversible& x) noexcept; 
+void native_to_big_inplace(Reversible& x) noexcept;

- Effects: conditional_reverse_in_place<order::native, + Effects: conditional_reverse_inplace<order::native, order::big>(x).

template <class Reversible>
-void little_to_native_in_place(Reversible& x) noexcept; 
+void little_to_native_inplace(Reversible& x) noexcept;

- Effects: conditional_reverse_in_place<order::little, order::native>(x).

+ Effects: conditional_reverse_inplace<order::little, order::native>(x).

template <class Reversible>
-void native_to_little_in_place(Reversible& x) noexcept; 
+void native_to_little_inplace(Reversible& x) noexcept;

- Effects: conditional_reverse_in_place<order::native, + Effects: conditional_reverse_inplace<order::native, order::little>(x).

template <order O1, order O2, class Reversible>
-void conditional_reverse_in_place(Reversible& x) noexcept; 
+void conditional_reverse_inplace(Reversible& x) noexcept;

Effects: None if O1 == O2, otherwise - endian_reverse_in_place(x).

+ endian_reverse_inplace(x).

Remarks: Which effect applies shall be determined at compile time.

template <class Reversible>
-void conditional_reverse_in_place(Reversible& x,
+void conditional_reverse_inplace(Reversible& x,
      order order1, order order2) noexcept; 
-

Effects: If order1 == order2 then endian_reverse_in_place(x).

+

Effects: If order1 == order2 then endian_reverse_inplace(x).

diff --git a/example/udt_conversion_example.cpp b/example/udt_conversion_example.cpp index 234557e..c1e1fbd 100644 --- a/example/udt_conversion_example.cpp +++ b/example/udt_conversion_example.cpp @@ -42,7 +42,7 @@ namespace user desc_[sizeof(desc_-1)] = '\0'; } - friend void endian_reverse_in_place(UDT&); + friend void endian_reverse_inplace(UDT&); private: int32_t id_; @@ -50,10 +50,10 @@ namespace user char desc_[56]; // '/0' }; - void endian_reverse_in_place(UDT& x) + void endian_reverse_inplace(UDT& x) { - boost::endian::endian_reverse_in_place(x.id_); - boost::endian::endian_reverse_in_place(x.value_); + boost::endian::endian_reverse_inplace(x.id_); + boost::endian::endian_reverse_inplace(x.value_); } } @@ -64,16 +64,16 @@ int main(int, char* []) //cout << std::hex; cout << "(1) " << x.id() << ' ' << x.value() << ' ' << x.desc() << endl; - user::endian_reverse_in_place(x); + user::endian_reverse_inplace(x); cout << "(2) " << x.id() << ' ' << x.value() << ' ' << x.desc() << endl; - endian_reverse_in_place(x); + endian_reverse_inplace(x); cout << "(3) " << x.id() << ' ' << x.value() << ' ' << x.desc() << endl; - conditional_reverse_in_place(x); + conditional_reverse_inplace(x); cout << "(4) " << x.id() << ' ' << x.value() << ' ' << x.desc() << endl; - conditional_reverse_in_place(x, order::big, order::little); + conditional_reverse_inplace(x, order::big, order::little); cout << "(5) " << x.id() << ' ' << x.value() << ' ' << x.desc() << endl; } diff --git a/include/boost/endian/conversion.hpp b/include/boost/endian/conversion.hpp index ebaca80..fad465e 100644 --- a/include/boost/endian/conversion.hpp +++ b/include/boost/endian/conversion.hpp @@ -113,9 +113,9 @@ namespace endian // user-defined types (UDTs) // // // // All reverse in place function templates are required to be implemented in terms // - // of an unqualified call to "endian_reverse_in_place(x)", a function reversing // + // of an unqualified call to "endian_reverse_inplace(x)", a function reversing // // the endianness of x, which is a non-const reference. This provides a // - // customization point for any UDT that provides a "reverse_in_place" free-function // + // customization point for any UDT that provides a "reverse_inplace" free-function // // meeting the requirements. The free-function must be declared in the same // // namespace as the UDT itself so that it will be found by argument-dependent // // lookup (ADL). // @@ -124,32 +124,32 @@ namespace endian // reverse in place template - inline void endian_reverse_in_place(Value& x) BOOST_NOEXCEPT; + inline void endian_reverse_inplace(Value& x) BOOST_NOEXCEPT; // Effects: x = endian_reverse(x) // reverse in place unless native endianness is big template - inline void big_to_native_in_place(Reversible& x) BOOST_NOEXCEPT; - // Effects: none if native byte-order is big, otherwise endian_reverse_in_place(x) + inline void big_to_native_inplace(Reversible& x) BOOST_NOEXCEPT; + // Effects: none if native byte-order is big, otherwise endian_reverse_inplace(x) template - inline void native_to_big_in_place(Reversible& x) BOOST_NOEXCEPT; - // Effects: none if native byte-order is big, otherwise endian_reverse_in_place(x) + inline void native_to_big_inplace(Reversible& x) BOOST_NOEXCEPT; + // Effects: none if native byte-order is big, otherwise endian_reverse_inplace(x) // reverse in place unless native endianness is little template - inline void little_to_native_in_place(Reversible& x) BOOST_NOEXCEPT; - // Effects: none if native byte-order is little, otherwise endian_reverse_in_place(x); + inline void little_to_native_inplace(Reversible& x) BOOST_NOEXCEPT; + // Effects: none if native byte-order is little, otherwise endian_reverse_inplace(x); template - inline void native_to_little_in_place(Reversible& x) BOOST_NOEXCEPT; - // Effects: none if native byte-order is little, otherwise endian_reverse_in_place(x); + inline void native_to_little_inplace(Reversible& x) BOOST_NOEXCEPT; + // Effects: none if native byte-order is little, otherwise endian_reverse_inplace(x); // generic conditional reverse in place template - inline void conditional_reverse_in_place(Reversible& x) BOOST_NOEXCEPT; + inline void conditional_reverse_inplace(Reversible& x) BOOST_NOEXCEPT; // runtime reverse in place template - inline void conditional_reverse_in_place(Reversible& x, + inline void conditional_reverse_inplace(Reversible& x, BOOST_SCOPED_ENUM(order) from_order, BOOST_SCOPED_ENUM(order) to_order) BOOST_NOEXCEPT; @@ -376,50 +376,50 @@ namespace endian // reverse in place template - inline void endian_reverse_in_place(Value& x) BOOST_NOEXCEPT + inline void endian_reverse_inplace(Value& x) BOOST_NOEXCEPT { x = endian_reverse(x); } template # ifdef BOOST_BIG_ENDIAN - inline void big_to_native_in_place(Reversible&) BOOST_NOEXCEPT {} + inline void big_to_native_inplace(Reversible&) BOOST_NOEXCEPT {} # else - inline void big_to_native_in_place(Reversible& x) BOOST_NOEXCEPT - { endian_reverse_in_place(x); } + inline void big_to_native_inplace(Reversible& x) BOOST_NOEXCEPT + { endian_reverse_inplace(x); } # endif template # ifdef BOOST_BIG_ENDIAN - inline void native_to_big_in_place(Reversible&) BOOST_NOEXCEPT {} + inline void native_to_big_inplace(Reversible&) BOOST_NOEXCEPT {} # else - inline void native_to_big_in_place(Reversible& x) BOOST_NOEXCEPT + inline void native_to_big_inplace(Reversible& x) BOOST_NOEXCEPT { - endian_reverse_in_place(x); + endian_reverse_inplace(x); } # endif template # ifdef BOOST_LITTLE_ENDIAN - inline void little_to_native_in_place(Reversible&) BOOST_NOEXCEPT {} + inline void little_to_native_inplace(Reversible&) BOOST_NOEXCEPT {} # else - inline void little_to_native_in_place(Reversible& x) BOOST_NOEXCEPT - { endian_reverse_in_place(x); } + inline void little_to_native_inplace(Reversible& x) BOOST_NOEXCEPT + { endian_reverse_inplace(x); } # endif template # ifdef BOOST_LITTLE_ENDIAN - inline void native_to_little_in_place(Reversible&) BOOST_NOEXCEPT {} + inline void native_to_little_inplace(Reversible&) BOOST_NOEXCEPT {} # else - inline void native_to_little_in_place(Reversible& x) BOOST_NOEXCEPT + inline void native_to_little_inplace(Reversible& x) BOOST_NOEXCEPT { - endian_reverse_in_place(x); + endian_reverse_inplace(x); } # endif namespace detail { // Primary template and specializations support generic - // endian_reverse_in_place(). - // See rationale in endian_reverse_in_place() below. + // endian_reverse_inplace(). + // See rationale in endian_reverse_inplace() below. template class converter; // primary template template class converter @@ -427,14 +427,14 @@ namespace endian template class converter {public: void operator()(T&) BOOST_NOEXCEPT {/*no effect*/}}; template class converter - {public: void operator()(T& x) BOOST_NOEXCEPT { endian_reverse_in_place(x); }}; + {public: void operator()(T& x) BOOST_NOEXCEPT { endian_reverse_inplace(x); }}; template class converter - {public: void operator()(T& x) BOOST_NOEXCEPT { endian_reverse_in_place(x); }}; + {public: void operator()(T& x) BOOST_NOEXCEPT { endian_reverse_inplace(x); }}; } // namespace detail // generic conditional reverse in place template - inline void conditional_reverse_in_place(Reversible& x) BOOST_NOEXCEPT + inline void conditional_reverse_inplace(Reversible& x) BOOST_NOEXCEPT { // work around lack of function template partial specialization by instantiating // a function object of a class that is partially specialized on the two order @@ -445,12 +445,12 @@ namespace endian // runtime reverse in place template - inline void conditional_reverse_in_place(Reversible& x, + inline void conditional_reverse_inplace(Reversible& x, BOOST_SCOPED_ENUM(order) from_order, BOOST_SCOPED_ENUM(order) to_order) BOOST_NOEXCEPT { if (from_order != to_order) - endian_reverse_in_place(x); + endian_reverse_inplace(x); } diff --git a/test/benchmark.cpp b/test/benchmark.cpp index eabddbd..c649008 100644 --- a/test/benchmark.cpp +++ b/test/benchmark.cpp @@ -120,7 +120,7 @@ namespace } } - inline void in_place(int32_t& x) + inline void inplace(int32_t& x) { x = (static_cast(x) << 24) | ((static_cast(x) << 8) & 0x00ff0000) @@ -162,10 +162,10 @@ namespace return v; } - inline int32_t modify_in_place(int32_t x) + inline int32_t modify_inplace(int32_t x) { int32_t v(x); - in_place(v); + inplace(v); return v; } @@ -214,7 +214,7 @@ int main(int argc, char * argv[]) #ifndef BOOST_TWO_ARG overhead = benchmark(modify_noop, "modify no-op"); - benchmark(modify_in_place, "modify in place"/*, overhead*/); + benchmark(modify_inplace, "modify in place"/*, overhead*/); benchmark(modify_by_return, "modify by return"/*, overhead*/); benchmark(modify_by_return_pyry, "modify by return_pyry"/*, overhead*/); benchmark(modify_by_return_intrinsic, "modify by return_intrinsic"/*, overhead*/); diff --git a/test/conversion_test.cpp b/test/conversion_test.cpp index 2af3899..82588d0 100644 --- a/test/conversion_test.cpp +++ b/test/conversion_test.cpp @@ -201,62 +201,62 @@ namespace T x; // unconditional reverse - x = big; be::endian_reverse_in_place(x); BOOST_TEST_EQ(x, little); - x = little; be::endian_reverse_in_place(x); BOOST_TEST_EQ(x, big); + x = big; be::endian_reverse_inplace(x); BOOST_TEST_EQ(x, little); + x = little; be::endian_reverse_inplace(x); BOOST_TEST_EQ(x, big); // conditional reverse - x = native; be::native_to_big_in_place(x); BOOST_TEST_EQ(x, big); - x = native; be::native_to_little_in_place(x); BOOST_TEST_EQ(x, little); - x = big; be::big_to_native_in_place(x); BOOST_TEST_EQ(x, native); - x = little; be::little_to_native_in_place(x); BOOST_TEST_EQ(x, native); + x = native; be::native_to_big_inplace(x); BOOST_TEST_EQ(x, big); + x = native; be::native_to_little_inplace(x); BOOST_TEST_EQ(x, little); + x = big; be::big_to_native_inplace(x); BOOST_TEST_EQ(x, native); + x = little; be::little_to_native_inplace(x); BOOST_TEST_EQ(x, native); // generic conditional reverse - x = big; be::conditional_reverse_in_place(x); + x = big; be::conditional_reverse_inplace(x); BOOST_TEST_EQ(x, big); - x = little; be::conditional_reverse_in_place(x); + x = little; be::conditional_reverse_inplace(x); BOOST_TEST_EQ(x, little); - x = native; be::conditional_reverse_in_place(x); + x = native; be::conditional_reverse_inplace(x); BOOST_TEST_EQ(x, native); - x = big; be::conditional_reverse_in_place(x); + x = big; be::conditional_reverse_inplace(x); BOOST_TEST_EQ(x, little); - x = big; be::conditional_reverse_in_place(x); + x = big; be::conditional_reverse_inplace(x); BOOST_TEST_EQ(x, native); - x = little; be::conditional_reverse_in_place(x); + x = little; be::conditional_reverse_inplace(x); BOOST_TEST_EQ(x, big); - x = little; be::conditional_reverse_in_place(x); + x = little; be::conditional_reverse_inplace(x); BOOST_TEST_EQ(x, native); - x = native; be::conditional_reverse_in_place(x); + x = native; be::conditional_reverse_inplace(x); BOOST_TEST_EQ(x, big); - x = native; be::conditional_reverse_in_place(x); + x = native; be::conditional_reverse_inplace(x); BOOST_TEST_EQ(x, little); // runtime conditional reverse x = big; - be::conditional_reverse_in_place(x, be::order::big, be::order::big); + be::conditional_reverse_inplace(x, be::order::big, be::order::big); BOOST_TEST_EQ(x, big); x = little; - be::conditional_reverse_in_place(x, be::order::little, be::order::little); + be::conditional_reverse_inplace(x, be::order::little, be::order::little); BOOST_TEST_EQ(x, little); x = native; - be::conditional_reverse_in_place(x, be::order::native, be::order::native); + be::conditional_reverse_inplace(x, be::order::native, be::order::native); BOOST_TEST_EQ(x, native); x = big; - be::conditional_reverse_in_place(x, be::order::big, be::order::little); + be::conditional_reverse_inplace(x, be::order::big, be::order::little); BOOST_TEST_EQ(x, little); x = big; - be::conditional_reverse_in_place(x, be::order::big, be::order::native); + be::conditional_reverse_inplace(x, be::order::big, be::order::native); BOOST_TEST_EQ(x, native); x = little; - be::conditional_reverse_in_place(x, be::order::little, be::order::big); + be::conditional_reverse_inplace(x, be::order::little, be::order::big); BOOST_TEST_EQ(x, big); x = little; - be::conditional_reverse_in_place(x, be::order::little, be::order::native); + be::conditional_reverse_inplace(x, be::order::little, be::order::native); BOOST_TEST_EQ(x, native); x = native; - be::conditional_reverse_in_place(x, be::order::native, be::order::big); + be::conditional_reverse_inplace(x, be::order::native, be::order::big); BOOST_TEST_EQ(x, big); x = native; - be::conditional_reverse_in_place(x, be::order::native, be::order::little); + be::conditional_reverse_inplace(x, be::order::native, be::order::little); BOOST_TEST_EQ(x, little); } @@ -283,7 +283,7 @@ namespace BOOST_TEST_EQ(tmp.member2, be::endian_reverse(little)); BOOST_TEST_EQ(tmp.member3, be::endian_reverse(native)); - be::conditional_reverse_in_place(udt); + be::conditional_reverse_inplace(udt); BOOST_TEST_EQ(udt.member1, be::endian_reverse(big)); BOOST_TEST_EQ(udt.member2, be::endian_reverse(little)); BOOST_TEST_EQ(udt.member3, be::endian_reverse(native)); @@ -298,7 +298,7 @@ namespace BOOST_TEST_EQ(tmp.member2, little); BOOST_TEST_EQ(tmp.member3, native); - be::conditional_reverse_in_place(udt); + be::conditional_reverse_inplace(udt); BOOST_TEST_EQ(udt.member1, big); BOOST_TEST_EQ(udt.member2, little); BOOST_TEST_EQ(udt.member3, native); @@ -311,7 +311,7 @@ namespace namespace user { - // UDT1 supplies both endian_reverse and endian_reverse_in_place + // UDT1 supplies both endian_reverse and endian_reverse_inplace struct UDT1 { int64_t member1; @@ -328,11 +328,11 @@ namespace return tmp; } - void endian_reverse_in_place(UDT1& udt) BOOST_NOEXCEPT + void endian_reverse_inplace(UDT1& udt) BOOST_NOEXCEPT { - boost::endian::endian_reverse_in_place(udt.member1); - boost::endian::endian_reverse_in_place(udt.member2); - boost::endian::endian_reverse_in_place(udt.member3); + boost::endian::endian_reverse_inplace(udt.member1); + boost::endian::endian_reverse_inplace(udt.member2); + boost::endian::endian_reverse_inplace(udt.member3); } // UDT2 supplies only endian_reverse @@ -352,7 +352,7 @@ namespace return tmp; } - // UDT3 supplies neither endian_reverse nor endian_reverse_in_place, + // UDT3 supplies neither endian_reverse nor endian_reverse_inplace, // so udt_test() should fail to compile struct UDT3 { diff --git a/test/endian_test.cpp b/test/endian_test.cpp index 10d6340..92e49c0 100644 --- a/test/endian_test.cpp +++ b/test/endian_test.cpp @@ -604,25 +604,25 @@ namespace { // aligned floating point types float big_float32_expected = (std::numeric_limits::max) (); - boost::endian::native_to_big_in_place(big_float32_expected); + boost::endian::native_to_big_inplace(big_float32_expected); big_float32_t big_float32((std::numeric_limits::max) ()); VERIFY(std::memcmp(big_float32.data(), reinterpret_cast(&big_float32_expected), sizeof(float)) == 0); float little_float32_expected = (std::numeric_limits::max) (); - boost::endian::native_to_little_in_place(little_float32_expected); + boost::endian::native_to_little_inplace(little_float32_expected); little_float32_t little_float32((std::numeric_limits::max) ()); VERIFY(std::memcmp(little_float32.data(), reinterpret_cast(&little_float32_expected), sizeof(float)) == 0); double big_float64_expected = (std::numeric_limits::max) (); - boost::endian::native_to_big_in_place(big_float64_expected); + boost::endian::native_to_big_inplace(big_float64_expected); big_float64_t big_float64((std::numeric_limits::max) ()); VERIFY(std::memcmp(big_float64.data(), reinterpret_cast(&big_float64_expected), sizeof(double)) == 0); double little_float64_expected = (std::numeric_limits::max) (); - boost::endian::native_to_little_in_place(little_float64_expected); + boost::endian::native_to_little_inplace(little_float64_expected); little_float64_t little_float64((std::numeric_limits::max) ()); VERIFY(std::memcmp(little_float64.data(), reinterpret_cast(&little_float64_expected), sizeof(double)) == 0); @@ -639,25 +639,25 @@ namespace // unaligned floating point types float big_float32un_expected = (std::numeric_limits::max) (); - boost::endian::native_to_big_in_place(big_float32un_expected); + boost::endian::native_to_big_inplace(big_float32un_expected); big_float32_ut big_float32un((std::numeric_limits::max) ()); VERIFY(std::memcmp(big_float32un.data(), reinterpret_cast(&big_float32un_expected), sizeof(float)) == 0); float little_float32un_expected = (std::numeric_limits::max) (); - boost::endian::native_to_little_in_place(little_float32un_expected); + boost::endian::native_to_little_inplace(little_float32un_expected); little_float32_ut little_float32un((std::numeric_limits::max) ()); VERIFY(std::memcmp(little_float32un.data(), reinterpret_cast(&little_float32un_expected), sizeof(float)) == 0); double big_float64un_expected = (std::numeric_limits::max) (); - boost::endian::native_to_big_in_place(big_float64un_expected); + boost::endian::native_to_big_inplace(big_float64un_expected); big_float64_ut big_float64un((std::numeric_limits::max) ()); VERIFY(std::memcmp(big_float64un.data(), reinterpret_cast(&big_float64un_expected), sizeof(double)) == 0); double little_float64un_expected = (std::numeric_limits::max) (); - boost::endian::native_to_little_in_place(little_float64un_expected); + boost::endian::native_to_little_inplace(little_float64un_expected); little_float64_ut little_float64un((std::numeric_limits::max) ()); VERIFY(std::memcmp(little_float64un.data(), reinterpret_cast(&little_float64un_expected), sizeof(double)) == 0); diff --git a/test/loop_time_test.cpp b/test/loop_time_test.cpp index d907565..30cf207 100644 --- a/test/loop_time_test.cpp +++ b/test/loop_time_test.cpp @@ -101,14 +101,14 @@ namespace // cout << "***************Endian conversion approach...\n"; T x(0); boost::timer::cpu_timer t; - native_to_big_in_place(x); + native_to_big_inplace(x); for (uint64_t i = 0; i < n; ++i) { x += static_cast(i); } - big_to_native_in_place(x); + big_to_native_inplace(x); t.stop(); - native_to_big_in_place(x); + native_to_big_inplace(x); if (x != total) throw std::logic_error("integer approach total != conversion approach total"); cout << "" << t.format(places, "%t") << " s"; diff --git a/test/speed_test.cpp b/test/speed_test.cpp index 4f46835..84f7a97 100644 --- a/test/speed_test.cpp +++ b/test/speed_test.cpp @@ -101,7 +101,7 @@ namespace cout << "16-bit aligned big endian"; time(user::return_x_big_int16); time(user::return_x_value_big_int16); - time(user::return_x_in_place_big_int16); + time(user::return_x_inplace_big_int16); time(user::return_x_big_int16); cout << "\n"; } @@ -111,7 +111,7 @@ namespace cout << "16-bit aligned little endian"; time(user::return_x_little_int16); time(user::return_x_value_little_int16); - time(user::return_x_in_place_little_int16); + time(user::return_x_inplace_little_int16); time(user::return_x_little_int16); cout << "\n"; } @@ -121,7 +121,7 @@ namespace cout << "32-bit aligned big endian"; time(user::return_x_big_int32); time(user::return_x_value_big_int32); - time(user::return_x_in_place_big_int32); + time(user::return_x_inplace_big_int32); time(user::return_x_big_int32); cout << "\n"; } @@ -131,7 +131,7 @@ namespace cout << "32-bit aligned little endian"; time(user::return_x_little_int32); time(user::return_x_value_little_int32); - time(user::return_x_in_place_little_int32); + time(user::return_x_inplace_little_int32); time(user::return_x_little_int32); cout << "\n"; } @@ -141,7 +141,7 @@ namespace cout << "64-bit aligned big endian"; time(user::return_x_big_int64); time(user::return_x_value_big_int64); - time(user::return_x_in_place_big_int64); + time(user::return_x_inplace_big_int64); time(user::return_x_big_int64); cout << "\n"; } @@ -151,7 +151,7 @@ namespace cout << "64-bit aligned little endian"; time(user::return_x_little_int64); time(user::return_x_value_little_int64); - time(user::return_x_in_place_little_int64); + time(user::return_x_inplace_little_int64); time(user::return_x_little_int64); cout << "\n"; } diff --git a/test/speed_test_functions.cpp b/test/speed_test_functions.cpp index d4d4825..fbdccf5 100644 --- a/test/speed_test_functions.cpp +++ b/test/speed_test_functions.cpp @@ -30,13 +30,13 @@ namespace user { return conditional_reverse(x); } - int16_t return_x_in_place_big_int16(int16_t x, big_int16_ut) BOOST_NOEXCEPT + int16_t return_x_inplace_big_int16(int16_t x, big_int16_ut) BOOST_NOEXCEPT { - conditional_reverse_in_place(x); return x; + conditional_reverse_inplace(x); return x; } - int16_t return_x_in_place_little_int16(int16_t x, little_int16_ut) BOOST_NOEXCEPT + int16_t return_x_inplace_little_int16(int16_t x, little_int16_ut) BOOST_NOEXCEPT { - conditional_reverse_in_place(x); return x; + conditional_reverse_inplace(x); return x; } int16_t return_y_big_int16(int16_t x, big_int16_ut y) BOOST_NOEXCEPT { return y; } int16_t return_y_little_int16(int16_t x, little_int16_ut y) BOOST_NOEXCEPT { return y; } @@ -51,13 +51,13 @@ namespace user { return conditional_reverse(x); } - int32_t return_x_in_place_big_int32(int32_t x, big_int32_ut) BOOST_NOEXCEPT + int32_t return_x_inplace_big_int32(int32_t x, big_int32_ut) BOOST_NOEXCEPT { - conditional_reverse_in_place(x); return x; + conditional_reverse_inplace(x); return x; } - int32_t return_x_in_place_little_int32(int32_t x, little_int32_ut) BOOST_NOEXCEPT + int32_t return_x_inplace_little_int32(int32_t x, little_int32_ut) BOOST_NOEXCEPT { - conditional_reverse_in_place(x); return x; + conditional_reverse_inplace(x); return x; } int32_t return_y_big_int32(int32_t x, big_int32_ut y) BOOST_NOEXCEPT { return y; } int32_t return_y_little_int32(int32_t x, little_int32_ut y) BOOST_NOEXCEPT { return y; } @@ -72,13 +72,13 @@ namespace user { return conditional_reverse(x); } - int64_t return_x_in_place_big_int64(int64_t x, big_int64_ut) BOOST_NOEXCEPT + int64_t return_x_inplace_big_int64(int64_t x, big_int64_ut) BOOST_NOEXCEPT { - conditional_reverse_in_place(x); return x; + conditional_reverse_inplace(x); return x; } - int64_t return_x_in_place_little_int64(int64_t x, little_int64_ut) BOOST_NOEXCEPT + int64_t return_x_inplace_little_int64(int64_t x, little_int64_ut) BOOST_NOEXCEPT { - conditional_reverse_in_place(x); return x; + conditional_reverse_inplace(x); return x; } int64_t return_y_big_int64(int64_t x, big_int64_ut y) BOOST_NOEXCEPT { return y; } int64_t return_y_little_int64(int64_t x, little_int64_ut y) BOOST_NOEXCEPT { return y; }