From 63a5b4ff54bbc210230518ed05bb1862cba3ca97 Mon Sep 17 00:00:00 2001 From: Beman Date: Mon, 23 Feb 2015 08:06:01 -0500 Subject: [PATCH] Manually apply a few renaming corrections. Reorder typedefs in synopsis for consistency. --- doc/arithmetic.html | 103 ++++++++++++++++++++++---------------------- doc/buffers.html | 100 +++++++++++++++++++++--------------------- doc/index.html | 10 ++--- 3 files changed, 104 insertions(+), 109 deletions(-) diff --git a/doc/arithmetic.html b/doc/arithmetic.html index 8480d22..b8d739e 100644 --- a/doc/arithmetic.html +++ b/doc/arithmetic.html @@ -123,10 +123,10 @@ namespace struct header { - big_int32_at file_code; - big_int32_at file_length; - little_int32_at version; - little_int32_at shape_type; + big_int32_t file_code; + big_int32_t file_length; + little_int32_t version; + little_int32_t shape_type; }; const char* filename = "test.dat"; @@ -433,49 +433,6 @@ usual operations on integers are supplied.

// typedefs - // aligned big endian floating point types - typedef endian<order::big, float, 32, align::yes> big_float32_at; - typedef endian<order::big, double, 64, align::yes> big_float64_at; - - // aligned little endian floating point types - typedef endian<order::little, float, 32, align::yes> little_float32_at; - typedef endian<order::little, double, 64, align::yes> little_float64_at; - - // unaligned big endian floating point types - typedef endian<order::big, float, 32, align::no> big_float32_t; - typedef endian<order::big, double, 64, align::no> big_float64_t; - - // unaligned little endian floating point types - typedef endian<order::little, float, 32, align::no> little_float32_t; - typedef endian<order::little, double, 64, align::no> little_float64_t; - - // aligned big endian signed integer types - typedef endian<order::big, int8_t, 8, align::yes> big_int8_at; - typedef endian<order::big, int16_t, 16, align::yes> big_int16_at; - typedef endian<order::big, int32_t, 32, align::yes> big_int32_at; - typedef endian<order::big, int64_t, 64, align::yes> big_int64_at; - - // aligned big endian unsigned integer types - typedef endian<order::big, uint8_t, 8, align::yes> big_uint8_at; - typedef endian<order::big, uint16_t, 16, align::yes> big_uint16_at; - typedef endian<order::big, uint32_t, 32, align::yes> big_uint32_at; - typedef endian<order::big, uint64_t, 64, align::yes> big_uint64_at; - - // aligned little endian signed integer types - typedef endian<order::little, int8_t, 8, align::yes> little_int8_at; - typedef endian<order::little, int16_t, 16, align::yes> little_int16_at; - typedef endian<order::little, int32_t, 32, align::yes> little_int32_at; - typedef endian<order::little, int64_t, 64, align::yes> little_int64_at; - - // aligned little endian unsigned integer types - typedef endian<order::little, uint8_t, 8, align::yes> little_uint8_at; - typedef endian<order::little, uint16_t, 16, align::yes> little_uint16_at; - typedef endian<order::little, uint32_t, 32, align::yes> little_uint32_at; - typedef endian<order::little, uint64_t, 64, align::yes> little_uint64_at; - - // aligned native endian typedefs are not provided because - // <cstdint> types are superior for that use case - // unaligned big endian signed integer types typedef endian<order::big, int_least8_t, 8> big_int8_t; typedef endian<order::big, int_least16_t, 16> big_int16_t; @@ -496,6 +453,10 @@ usual operations on integers are supplied.

typedef endian<order::big, uint_least64_t, 56> big_uint56_t; typedef endian<order::big, uint_least64_t, 64> big_uint64_t; + // unaligned big endian floating point types + typedef endian<order::big, float, 32> big_float32_t; + typedef endian<order::big, double, 64> big_float64_t; + // unaligned little endian signed integer types typedef endian<order::little, int_least8_t, 8> little_int8_t; typedef endian<order::little, int_least16_t, 16> little_int16_t; @@ -516,7 +477,11 @@ usual operations on integers are supplied.

typedef endian<order::little, uint_least64_t, 56> little_uint56_t; typedef endian<order::little, uint_least64_t, 64> little_uint64_t; - // unaligned native endian signed integer types + // unaligned little endian floating point types + typedef endian<order::little, float, 32, align::no> little_float32_t; + typedef endian<order::little, double, 64, align::no> little_float64_t; + + // unaligned native endian signed integer types typedef implementation-defined_int8_t native_int8_t; typedef implementation-defined_int16_t native_int16_t; typedef implementation-defined_int24_t native_int24_t; @@ -526,7 +491,7 @@ usual operations on integers are supplied.

typedef implementation-defined_int56_t native_int56_t; typedef implementation-defined_int64_t native_int64_t; - // unaligned native endian unsigned integer types + // unaligned native endian unsigned integer types typedef implementation-defined_uint8_t native_uint8_t; typedef implementation-defined_uint16_t native_uint16_t; typedef implementation-defined_uint24_t native_uint24_t; @@ -535,7 +500,42 @@ usual operations on integers are supplied.

typedef implementation-defined_uint48_t native_uint48_t; typedef implementation-defined_uint56_t native_uint56_t; typedef implementation-defined_uint64_t native_uint64_t; + + // aligned big endian signed integer types + typedef endian<order::big, int8_t, 8, align::yes> big_int8_at; + typedef endian<order::big, int16_t, 16, align::yes> big_int16_at; + typedef endian<order::big, int32_t, 32, align::yes> big_int32_at; + typedef endian<order::big, int64_t, 64, align::yes> big_int64_at; + // aligned big endian unsigned integer types + typedef endian<order::big, uint8_t, 8, align::yes> big_uint8_at; + typedef endian<order::big, uint16_t, 16, align::yes> big_uint16_at; + typedef endian<order::big, uint32_t, 32, align::yes> big_uint32_at; + typedef endian<order::big, uint64_t, 64, align::yes> big_uint64_at; + + // aligned big endian floating point types + typedef endian<order::big, float, 32, align::yes> big_float32_at; + typedef endian<order::big, double, 64, align::yes> big_float64_at; + + // aligned little endian signed integer types + typedef endian<order::little, int8_t, 8, align::yes> little_int8_at; + typedef endian<order::little, int16_t, 16, align::yes> little_int16_at; + typedef endian<order::little, int32_t, 32, align::yes> little_int32_at; + typedef endian<order::little, int64_t, 64, align::yes> little_int64_at; + + // aligned little endian unsigned integer types + typedef endian<order::little, uint8_t, 8, align::yes> little_uint8_at; + typedef endian<order::little, uint16_t, 16, align::yes> little_uint16_at; + typedef endian<order::little, uint32_t, 32, align::yes> little_uint32_at; + typedef endian<order::little, uint64_t, 64, align::yes> little_uint64_at; + + // aligned little endian floating point types + typedef endian<order::little, float, 32, align::yes> little_float32_at; + typedef endian<order::little, double, 64, align::yes> little_float64_at; + + // aligned native endian typedefs are not provided because + // <cstdint> types are superior for that use case + } // namespace endian } // namespace boost

The implementation-defined text above is either @@ -619,8 +619,7 @@ programming.

Why bother with the aligned endian types? Aligned integer operations may be faster (as much as 10 to 20 times faster) if the endianness and alignment of the type matches the endianness and alignment requirements of the machine. The code, -however, is -likely to be somewhat less portable than with the unaligned types.

+however, will be somewhat less portable than with the unaligned types.

Why provide the arithmetic operations? Providing a full set of operations reduces program clutter and makes code both easier to write and to read. Consider incrementing a variable in a record. It is very convenient to write:

@@ -694,7 +693,7 @@ differs from endian representation size. Vicente Botet and other reviewers suggested supporting floating point types.


Last revised: -17 February, 2015

+23 February, 2015

© Copyright Beman Dawes, 2006-2009, 2013

Distributed under the Boost Software License, Version 1.0. See www.boost.org/ LICENSE_1_0.txt

diff --git a/doc/buffers.html b/doc/buffers.html index d234d03..173ab14 100644 --- a/doc/buffers.html +++ b/doc/buffers.html @@ -283,42 +283,42 @@ conventions for common use cases:

8,16,32,64 - big_uintn_buf_t + big_uintn_buf_at yes big unsigned 8,16,32,64 - big_floatn_buf_t + big_floatn_buf_at yes big signed 32,64 - little_intn_buf_t + little_intn_buf_at yes little signed 8,16,32,64 - little_uintn_buf_t + little_uintn_buf_at yes little unsigned 8,16,32,64 - little_floatn_buf_t + little_floatn_buf_at yes little signed 32,64 - native_floatn_buf_t + native_floatn_buf_at yes native signed @@ -398,49 +398,6 @@ usual operations on integers are supplied.

// typedefs - // aligned big endian floating point buffers - typedef endian_buffer<order::big, float, 32, align::yes> big_float32_buf_at; - typedef endian_buffer<order::big, double, 64, align::yes> big_float64_buf_at; - - // aligned little endian floating point buffers - typedef endian_buffer<order::little, float, 32, align::yes> little_float32_buf_at; - typedef endian_buffer<order::little, double, 64, align::yes> little_float64_buf_at; - - // unaligned big endian floating point buffers - typedef endian_buffer<order::big, float, 32, align::no> big_float32_buf_t; - typedef endian_buffer<order::big, double, 64, align::no> big_float64_buf_t; - - // unaligned little endian floating point buffers - typedef endian_buffer<order::little, float, 32, align::no> little_float32_buf_t; - typedef endian_buffer<order::little, double, 64, align::no> little_float64_buf_t; - - // aligned big endian signed integer buffers - typedef endian_buffer<order::big, int8_t, 8, align::yes> big_int8_buf_at; - typedef endian_buffer<order::big, int16_t, 16, align::yes> big_int16_buf_at; - typedef endian_buffer<order::big, int32_t, 32, align::yes> big_int32_buf_at; - typedef endian_buffer<order::big, int64_t, 64, align::yes> big_int64_buf_at; - - // aligned big endian unsigned integer buffers - typedef endian_buffer<order::big, uint8_t, 8, align::yes> big_uint8_buf_at; - typedef endian_buffer<order::big, uint16_t, 16, align::yes> big_uint16_buf_at; - typedef endian_buffer<order::big, uint32_t, 32, align::yes> big_uint32_buf_at; - typedef endian_buffer<order::big, uint64_t, 64, align::yes> big_uint64_buf_at; - - // aligned little endian signed integer buffers - typedef endian_buffer<order::little, int8_t, 8, align::yes> little_int8_buf_at; - typedef endian_buffer<order::little, int16_t, 16, align::yes> little_int16_buf_at; - typedef endian_buffer<order::little, int32_t, 32, align::yes> little_int32_buf_at; - typedef endian_buffer<order::little, int64_t, 64, align::yes> little_int64_buf_at; - - // aligned little endian unsigned integer buffers - typedef endian_buffer<order::little, uint8_t, 8, align::yes> little_uint8_buf_at; - typedef endian_buffer<order::little, uint16_t, 16, align::yes> little_uint16_buf_at; - typedef endian_buffer<order::little, uint32_t, 32, align::yes> little_uint32_buf_at; - typedef endian_buffer<order::little, uint64_t, 64, align::yes> little_uint64_buf_at; - - // aligned native endian typedefs are not provided because - // <cstdint> types are superior for this use case - // unaligned big endian signed integer buffers typedef endian_buffer<order::big, int_least8_t, 8> big_int8_buf_t; typedef endian_buffer<order::big, int_least16_t, 16> big_int16_buf_t; @@ -461,6 +418,10 @@ usual operations on integers are supplied.

typedef endian_buffer<order::big, uint_least64_t, 56> big_uint56_buf_t; typedef endian_buffer<order::big, uint_least64_t, 64> big_uint64_buf_t; + // unaligned big endian floating point buffers + typedef endian_buffer<order::big, float, 32> big_float32_buf_t; + typedef endian_buffer<order::big, double, 64> big_float64_buf_t; + // unaligned little endian signed integer buffers typedef endian_buffer<order::little, int_least8_t, 8> little_int8_buf_t; typedef endian_buffer<order::little, int_least16_t, 16> little_int16_buf_t; @@ -481,6 +442,10 @@ usual operations on integers are supplied.

typedef endian_buffer<order::little, uint_least64_t, 56> little_uint56_buf_t; typedef endian_buffer<order::little, uint_least64_t, 64> little_uint64_buf_t; + // unaligned little endian floating point buffers + typedef endian_buffer<order::little, float, 32> little_float32_buf_t; + typedef endian_buffer<order::little, double, 64> little_float64_buf_t; + // unaligned native endian signed integer types typedef implementation-defined_int8_buf_t native_int8_buf_t; typedef implementation-defined_int16_buf_t native_int16_buf_t; @@ -500,7 +465,42 @@ usual operations on integers are supplied.

typedef implementation-defined_uint48_buf_t native_uint48_buf_t; typedef implementation-defined_uint56_buf_t native_uint56_buf_t; typedef implementation-defined_uint64_buf_t native_uint64_buf_t; + + // aligned big endian signed integer buffers + typedef endian_buffer<order::big, int8_t, 8, align::yes> big_int8_buf_at; + typedef endian_buffer<order::big, int16_t, 16, align::yes> big_int16_buf_at; + typedef endian_buffer<order::big, int32_t, 32, align::yes> big_int32_buf_at; + typedef endian_buffer<order::big, int64_t, 64, align::yes> big_int64_buf_at; + + // aligned big endian unsigned integer buffers + typedef endian_buffer<order::big, uint8_t, 8, align::yes> big_uint8_buf_at; + typedef endian_buffer<order::big, uint16_t, 16, align::yes> big_uint16_buf_at; + typedef endian_buffer<order::big, uint32_t, 32, align::yes> big_uint32_buf_at; + typedef endian_buffer<order::big, uint64_t, 64, align::yes> big_uint64_buf_at; + + // aligned big endian floating point buffers + typedef endian_buffer<order::big, float, 32, align::yes> big_float32_buf_at; + typedef endian_buffer<order::big, double, 64, align::yes> big_float64_buf_at; + + // aligned little endian signed integer buffers + typedef endian_buffer<order::little, int8_t, 8, align::yes> little_int8_buf_at; + typedef endian_buffer<order::little, int16_t, 16, align::yes> little_int16_buf_at; + typedef endian_buffer<order::little, int32_t, 32, align::yes> little_int32_buf_at; + typedef endian_buffer<order::little, int64_t, 64, align::yes> little_int64_buf_at; + + // aligned little endian unsigned integer buffers + typedef endian_buffer<order::little, uint8_t, 8, align::yes> little_uint8_buf_at; + typedef endian_buffer<order::little, uint16_t, 16, align::yes> little_uint16_buf_at; + typedef endian_buffer<order::little, uint32_t, 32, align::yes> little_uint32_buf_at; + typedef endian_buffer<order::little, uint64_t, 64, align::yes> little_uint64_buf_at; + + // aligned little endian floating point buffers + typedef endian_buffer<order::little, float, 32, align::yes> little_float32_buf_at; + typedef endian_buffer<order::little, double, 64, align::yes> little_float64_buf_at; + // aligned native endian typedefs are not provided because + // <cstdint> types are superior for this use case + } // namespace endian } // namespace boost

The implementation-defined text in typedefs above is either @@ -663,7 +663,7 @@ any Boost object libraries.


Last revised: -17 February, 2015

+23 February, 2015

© Copyright Beman Dawes, 2006-2009, 2013

Distributed under the Boost Software License, Version 1.0. See www.boost.org/ LICENSE_1_0.txt

diff --git a/doc/index.html b/doc/index.html index ef60547..45a74fa 100644 --- a/doc/index.html +++ b/doc/index.html @@ -489,12 +489,8 @@ review
  • The endian arithmetic type aliases have been renamed, using a naming pattern that is consistent for both integer and floating point, and a consistent set of aliases supplied for the endian buffer types.
  • -
  • The aligned-type alias names now have the _t suffix, for - consistency with the standard library integer type aliases and because use of - aligned types is much more common than unaligned types.
  • -
  • The unaligned-type alias names now have the _ut suffix. This - is short, yet stands out enough to alert the reader than unusual types are - involved.
  • +
  • The unaligned-type alias names still have the _t suffix, but + the aligned-type alias names now have an _at suffix..
  • endian_reverse() overloads for int8_t and uint8_t have been added for improved generality. (Pierre Talbot)
  • Overloads of endian_reverse_inplace() have been replaced with a single @@ -593,7 +589,7 @@ Blechmann, Tim Moore, tymofey, Tomas Puverle, Vincente Botet, Yuval Ronen and Vitaly Budovsk. Apologies if anyone has been missed.


    Last revised: -17 February, 2015

    +23 February, 2015

    © Copyright Beman Dawes, 2011, 2013

    Distributed under the Boost Software License, Version 1.0. See www.boost.org/ LICENSE_1_0.txt