mirror of
https://github.com/boostorg/endian.git
synced 2025-08-02 14:04:29 +02:00
Final cleanups; tests now pass on Windows/g++
git-svn-id: http://svn.boost.org/svn/boost/sandbox/endian@74230 b8fc166d-592f-0410-95f2-cb63ce0dd405
This commit is contained in:
@@ -23,10 +23,10 @@
|
|||||||
|
|
||||||
<table border="0" cellpadding="5" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" bgcolor="#D7EEFF" width="100%">
|
<table border="0" cellpadding="5" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" bgcolor="#D7EEFF" width="100%">
|
||||||
<tr>
|
<tr>
|
||||||
<td><a href="../../../index.htm">Boost Home</a>
|
<td><b><a href="../../../index.htm">Boost Home</a>
|
||||||
<a href="index.html">Endian Home</a>
|
<a href="index.html">Endian Home</a>
|
||||||
<a href="conversion.html">Conversion Functions</a>
|
<a href="conversion.html">Conversion Functions</a>
|
||||||
<a href="integers.html">Integer Types</a> Tutorial</td>
|
<a href="integers.html">Integer Types</a> Tutorial</b></td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
<table border="1" cellpadding="5" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" align="right">
|
<table border="1" cellpadding="5" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" align="right">
|
||||||
|
@@ -23,10 +23,10 @@
|
|||||||
|
|
||||||
<table border="0" cellpadding="5" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" bgcolor="#D7EEFF" width="100%">
|
<table border="0" cellpadding="5" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" bgcolor="#D7EEFF" width="100%">
|
||||||
<tr>
|
<tr>
|
||||||
<td><a href="../../../index.htm">Boost Home</a>
|
<td><b><a href="../../../index.htm">Boost Home</a>
|
||||||
<a href="index.html">Endian Home</a>
|
<a href="index.html">Endian Home</a>
|
||||||
<a href="conversion.html">Conversion Functions</a>
|
<a href="conversion.html">Conversion Functions</a>
|
||||||
<a href="integers.html">Integer Types</a> Tutorial</td>
|
<a href="integers.html">Integer Types</a> Tutorial</b></td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
<table border="1" cellpadding="5" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" align="right">
|
<table border="1" cellpadding="5" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" align="right">
|
||||||
@@ -122,7 +122,7 @@ file transfers or over a network, programmers have to deal with endianness. </p>
|
|||||||
|
|
||||||
<blockquote>
|
<blockquote>
|
||||||
|
|
||||||
<p><b>Endian conversions for native integers -</b> The application uses the
|
<p><b><a href="conversion.html">Endian conversions</a> for native integers -</b> The application uses the
|
||||||
built-in integer types, and calls the provided conversion functions to convert
|
built-in integer types, and calls the provided conversion functions to convert
|
||||||
byte ordering as needed. Both mutating and non-mutating conversions are supplied, and
|
byte ordering as needed. Both mutating and non-mutating conversions are supplied, and
|
||||||
each comes in unconditional and conditional variants. This approach is simple
|
each comes in unconditional and conditional variants. This approach is simple
|
||||||
@@ -130,7 +130,7 @@ and usually more efficient, but is less flexible in terms of size and alignment,
|
|||||||
hard-to-manage and error-prone in code with many logical paths involving endianness transitions,
|
hard-to-manage and error-prone in code with many logical paths involving endianness transitions,
|
||||||
and can foster very hard to debug logic errors. </p>
|
and can foster very hard to debug logic errors. </p>
|
||||||
|
|
||||||
<p><b>Endian integer types -</b> The application uses the provided endian types
|
<p><b><a href="integers.html">Endian integer types</a> -</b> The application uses the provided endian types
|
||||||
which mimic the
|
which mimic the
|
||||||
built-in integer types. For example, <code>big32_t</code> or <code>little64_t</code>.
|
built-in integer types. For example, <code>big32_t</code> or <code>little64_t</code>.
|
||||||
This approach is also simple, but can be less efficient. Types with lengths of
|
This approach is also simple, but can be less efficient. Types with lengths of
|
||||||
|
@@ -25,10 +25,10 @@
|
|||||||
|
|
||||||
<table border="0" cellpadding="5" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" bgcolor="#D7EEFF" width="100%">
|
<table border="0" cellpadding="5" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" bgcolor="#D7EEFF" width="100%">
|
||||||
<tr>
|
<tr>
|
||||||
<td><a href="../../../index.htm">Boost Home</a>
|
<td><b><a href="../../../index.htm">Boost Home</a>
|
||||||
<a href="index.html">Endian Home</a>
|
<a href="index.html">Endian Home</a>
|
||||||
<a href="conversion.html">Conversion Functions</a>
|
<a href="conversion.html">Conversion Functions</a>
|
||||||
<a href="integers.html">Integer Types</a> Tutorial</td>
|
<a href="integers.html">Integer Types</a> Tutorial</b></td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
|
@@ -11,11 +11,9 @@
|
|||||||
|
|
||||||
test-suite "endian"
|
test-suite "endian"
|
||||||
:
|
:
|
||||||
[ run ../../io/test/bin_manip_test.cpp ]
|
|
||||||
[ run endian_test.cpp ]
|
[ run endian_test.cpp ]
|
||||||
[ run endian_operations_test.cpp
|
[ run endian_operations_test.cpp
|
||||||
: : : <toolset>gcc:<cxxflags>-Wno-sign-compare ]
|
: : : <toolset>gcc:<cxxflags>-Wno-sign-compare ]
|
||||||
[ run endian_in_union_test.cpp ]
|
[ run endian_in_union_test.cpp ]
|
||||||
[ run scoped_enum_emulation_test.cpp ]
|
|
||||||
[ run conversion_test.cpp ]
|
[ run conversion_test.cpp ]
|
||||||
;
|
;
|
||||||
|
@@ -698,13 +698,13 @@ namespace
|
|||||||
|
|
||||||
} // check_representation_and_range
|
} // check_representation_and_range
|
||||||
|
|
||||||
long iterations = 10000000;
|
long iterations = 10000;
|
||||||
|
|
||||||
template< class Endian >
|
template< class Endian >
|
||||||
Endian timing_test( const char * s)
|
Endian timing_test( const char * s)
|
||||||
{
|
{
|
||||||
cout << s << " timing test, " << iterations << " iterations: ";
|
cout << s << " timing test, " << iterations << " iterations: ";
|
||||||
progress_timer t;
|
// progress_timer t;
|
||||||
|
|
||||||
Endian v = 1;
|
Endian v = 1;
|
||||||
for ( long i = 0; i < iterations; ++i )
|
for ( long i = 0; i < iterations; ++i )
|
||||||
@@ -726,7 +726,7 @@ int cpp_main( int argc, char * argv[] )
|
|||||||
{
|
{
|
||||||
cout << "Usage: "
|
cout << "Usage: "
|
||||||
<< argv[0] << " [#],\n where # specifies iteration count\n"
|
<< argv[0] << " [#],\n where # specifies iteration count\n"
|
||||||
" default iteration count is 1000000" << endl;
|
" default iteration count is " << iterations << endl;
|
||||||
|
|
||||||
if ( argc > 1 )
|
if ( argc > 1 )
|
||||||
iterations = atol( argv[1] );
|
iterations = atol( argv[1] );
|
||||||
|
Reference in New Issue
Block a user