mirror of
https://github.com/boostorg/endian.git
synced 2025-08-01 05:24:39 +02:00
Cleared all warning messages from bjam compiles. All tests passing all compilers, except endian_in_union_test fails in gcc 4.5 only.
git-svn-id: http://svn.boost.org/svn/boost/sandbox/endian@72125 b8fc166d-592f-0410-95f2-cb63ce0dd405
This commit is contained in:
@@ -20,4 +20,5 @@
|
||||
# pragma warning( disable : 4514 ) // ... unreferenced inline function has been removed
|
||||
# pragma warning( disable : 4710 ) // ... function not inlined
|
||||
# pragma warning( disable : 4986 ) // ... exception specification does not match previous declaration
|
||||
# pragma warning( disable : 4711 ) // ... selected for automatic inline expansion
|
||||
#endif
|
||||
|
@@ -10,7 +10,7 @@
|
||||
#ifndef BOOST_ENDIAN_BINARY_STREAM_HPP
|
||||
#define BOOST_ENDIAN_BINARY_STREAM_HPP
|
||||
|
||||
#include <boost/integer/endian.hpp>
|
||||
#include <boost/endian/integers.hpp>
|
||||
#include <boost/utility/enable_if.hpp>
|
||||
#include <ostream>
|
||||
#include <istream>
|
||||
@@ -36,7 +36,7 @@
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace integer
|
||||
namespace endian
|
||||
{
|
||||
template< class T > struct is_endian { static const bool value = false; };
|
||||
|
||||
|
@@ -11,10 +11,12 @@
|
||||
|
||||
#define _CRT_SECURE_NO_DEPRECATE // quiet VC++ 8.0 foolishness
|
||||
|
||||
#include <boost/endian/detail/disable_warnings.hpp>
|
||||
|
||||
#include <iostream>
|
||||
#include <cassert>
|
||||
#include <cstdio>
|
||||
#include <boost/endian/integers.hpp>
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
#include <boost/detail/lightweight_main.hpp>
|
||||
|
||||
using namespace boost::endian;
|
||||
@@ -39,7 +41,7 @@ namespace
|
||||
|
||||
int cpp_main(int, char * [])
|
||||
{
|
||||
assert( sizeof( header ) == 16 ); // requirement for interoperability
|
||||
BOOST_TEST_EQ( sizeof( header ), 16U ); // requirement for interoperability
|
||||
|
||||
header h;
|
||||
|
||||
@@ -54,9 +56,9 @@ int cpp_main(int, char * [])
|
||||
// point that endian integers are often used in fairly low-level code that
|
||||
// does bulk I/O operations, <cstdio> fopen/fwrite is used for I/O in this example.
|
||||
|
||||
std::FILE * fi;
|
||||
std::FILE * fi = std::fopen( filename, "wb" ); // MUST BE BINARY
|
||||
|
||||
if ( !(fi = std::fopen( filename, "wb" )) ) // MUST BE BINARY
|
||||
if ( !fi )
|
||||
{
|
||||
std::cout << "could not open " << filename << '\n';
|
||||
return 1;
|
||||
@@ -71,5 +73,6 @@ int cpp_main(int, char * [])
|
||||
std::fclose( fi );
|
||||
|
||||
std::cout << "created file " << filename << '\n';
|
||||
return 0;
|
||||
|
||||
return ::boost::report_errors();
|
||||
}
|
||||
|
@@ -7,13 +7,15 @@
|
||||
|
||||
// See library home page at http://www.boost.org/libs/endian
|
||||
|
||||
#include <boost/integer/endian.hpp>
|
||||
#include <boost/integer/endian_binary_stream.hpp>
|
||||
#include <boost/endian/detail/disable_warnings.hpp>
|
||||
|
||||
#include <boost/endian/integers.hpp>
|
||||
#include <boost/endian/endian_binary_stream.hpp>
|
||||
#include <boost/binary_stream.hpp>
|
||||
#include <iostream>
|
||||
|
||||
using namespace boost;
|
||||
using namespace boost::integer;
|
||||
using namespace boost::endian;
|
||||
|
||||
int main()
|
||||
{
|
||||
|
@@ -7,6 +7,8 @@
|
||||
|
||||
//--------------------------------------------------------------------------------------//
|
||||
|
||||
#include <boost/endian/detail/disable_warnings.hpp>
|
||||
|
||||
#include <boost/endian/conversion.hpp>
|
||||
#include <boost/detail/lightweight_main.hpp>
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
@@ -21,17 +23,17 @@ namespace
|
||||
{
|
||||
std::cout << "test_in_place_flip...\n";
|
||||
|
||||
boost::int64_t i64 = 0x0102030405060708;
|
||||
boost::int64_t i64 = 0x0102030405060708LL;
|
||||
be::flip(i64);
|
||||
BOOST_TEST_EQ(i64, 0x0807060504030201);
|
||||
BOOST_TEST_EQ(i64, 0x0807060504030201LL);
|
||||
be::flip(i64);
|
||||
BOOST_TEST_EQ(i64, 0x0102030405060708);
|
||||
BOOST_TEST_EQ(i64, 0x0102030405060708LL);
|
||||
|
||||
i64 = 0xfefdfcfbfaf9f8f7;
|
||||
i64 = 0xfefdfcfbfaf9f8f7LL;
|
||||
be::flip(i64);
|
||||
BOOST_TEST_EQ(i64, static_cast<boost::int64_t>(0xf7f8f9fafbfcfdfe));
|
||||
BOOST_TEST_EQ(i64, static_cast<boost::int64_t>(0xf7f8f9fafbfcfdfeULL));
|
||||
be::flip(i64);
|
||||
BOOST_TEST_EQ(i64, static_cast<boost::int64_t>(0xfefdfcfbfaf9f8f7));
|
||||
BOOST_TEST_EQ(i64, static_cast<boost::int64_t>(0xfefdfcfbfaf9f8f7ULL));
|
||||
|
||||
boost::int32_t i32 = 0x01020304;
|
||||
be::flip(i32);
|
||||
@@ -57,11 +59,11 @@ namespace
|
||||
be::flip(i16);
|
||||
BOOST_TEST_EQ(i16, static_cast<boost::int16_t>(static_cast<boost::uint16_t>(0xfefd)));
|
||||
|
||||
boost::uint64_t ui64 = 0x0102030405060708;
|
||||
boost::uint64_t ui64 = 0x0102030405060708ULL;
|
||||
be::flip(ui64);
|
||||
BOOST_TEST_EQ(ui64, static_cast<boost::uint64_t>(0x0807060504030201));
|
||||
BOOST_TEST_EQ(ui64, 0x0807060504030201ULL);
|
||||
be::flip(ui64);
|
||||
BOOST_TEST_EQ(ui64, static_cast<boost::uint64_t>(0x0102030405060708));
|
||||
BOOST_TEST_EQ(ui64, 0x0102030405060708ULL);
|
||||
|
||||
boost::uint32_t ui32 = 0x01020304;
|
||||
be::flip(ui32);
|
||||
@@ -73,7 +75,7 @@ namespace
|
||||
be::flip(ui16);
|
||||
BOOST_TEST_EQ(ui16, 0x0201);
|
||||
be::flip(ui16);
|
||||
BOOST_TEST_EQ(ui16, 0x0102);
|
||||
BOOST_TEST_EQ(ui16, static_cast<boost::uint16_t>(0x0102));
|
||||
|
||||
std::cout << " test_in_place_flip complete\n";
|
||||
}
|
||||
@@ -82,18 +84,18 @@ namespace
|
||||
{
|
||||
std::cout << "test_copying_flip...\n";
|
||||
|
||||
boost::int64_t i64 = 0x0102030405060708, j64, k64;
|
||||
boost::int64_t i64 = 0x0102030405060708LL, j64, k64;
|
||||
be::flip(i64, j64);
|
||||
BOOST_TEST_EQ(j64, 0x0807060504030201);
|
||||
BOOST_TEST_EQ(i64, 0x0102030405060708);
|
||||
BOOST_TEST_EQ(j64, 0x0807060504030201LL);
|
||||
BOOST_TEST_EQ(i64, 0x0102030405060708LL);
|
||||
be::flip(j64, k64);
|
||||
BOOST_TEST_EQ(k64, 0x0102030405060708);
|
||||
BOOST_TEST_EQ(k64, 0x0102030405060708LL);
|
||||
|
||||
i64 = 0xfefdfcfbfaf9f8f7;
|
||||
i64 = 0xfefdfcfbfaf9f8f7LL;
|
||||
be::flip(i64, j64);
|
||||
BOOST_TEST_EQ(j64, static_cast<boost::int64_t>(0xf7f8f9fafbfcfdfe));
|
||||
BOOST_TEST_EQ(j64, static_cast<boost::int64_t>(0xf7f8f9fafbfcfdfeLL));
|
||||
be::flip(j64, k64);
|
||||
BOOST_TEST_EQ(k64, static_cast<boost::int64_t>(0xfefdfcfbfaf9f8f7));
|
||||
BOOST_TEST_EQ(k64, static_cast<boost::int64_t>(0xfefdfcfbfaf9f8f7LL));
|
||||
|
||||
boost::int32_t i32 = 0x01020304, j32, k32;
|
||||
be::flip(i32, j32);
|
||||
@@ -113,17 +115,17 @@ namespace
|
||||
be::flip(j16, k16);
|
||||
BOOST_TEST_EQ(k16, 0x0102);
|
||||
|
||||
i16 = static_cast<boost::int16_t>(static_cast<boost::uint16_t>(0xfefd)), j16, k16;
|
||||
i16 = static_cast<boost::int16_t>(static_cast<boost::uint16_t>(0xfefd));
|
||||
be::flip(i16, j16);
|
||||
BOOST_TEST_EQ(j16, static_cast<boost::int16_t>(static_cast<boost::uint16_t>(0xfdfe)));
|
||||
be::flip(j16, k16);
|
||||
BOOST_TEST_EQ(k16, static_cast<boost::int16_t>(static_cast<boost::uint16_t>(0xfefd)));
|
||||
|
||||
boost::uint64_t ui64 = 0x0102030405060708, uj64, uk64;
|
||||
boost::uint64_t ui64 = 0x0102030405060708ULL, uj64, uk64;
|
||||
be::flip(ui64, uj64);
|
||||
BOOST_TEST_EQ(uj64, static_cast<boost::uint64_t>(0x0807060504030201));
|
||||
BOOST_TEST_EQ(uj64, 0x0807060504030201ULL);
|
||||
be::flip(uj64, uk64);
|
||||
BOOST_TEST_EQ(uk64, static_cast<boost::uint64_t>(0x0102030405060708));
|
||||
BOOST_TEST_EQ(uk64, 0x0102030405060708ULL);
|
||||
|
||||
boost::uint32_t ui32 = 0x01020304, uj32, uk32;
|
||||
be::flip(ui32, uj32);
|
||||
@@ -140,13 +142,13 @@ namespace
|
||||
std::cout << " test_copying_flip complete\n";
|
||||
}
|
||||
|
||||
const boost::int64_t ni64 = 0x0102030405060708;
|
||||
const boost::int64_t ni64 = 0x0102030405060708LL;
|
||||
# ifdef BOOST_BIG_ENDIAN
|
||||
const boost::int64_t bi64 = 0x0102030405060708;
|
||||
const boost::int64_t li64 = 0x0807060504030201;
|
||||
const boost::int64_t bi64 = 0x0102030405060708LL;
|
||||
const boost::int64_t li64 = 0x0807060504030201LL;
|
||||
# else
|
||||
const boost::int64_t bi64 = 0x0807060504030201;
|
||||
const boost::int64_t li64 = 0x0102030405060708;
|
||||
const boost::int64_t bi64 = 0x0807060504030201LL;
|
||||
const boost::int64_t li64 = 0x0102030405060708LL;
|
||||
# endif
|
||||
|
||||
const boost::int32_t ni32 = 0x01020304;
|
||||
@@ -167,13 +169,13 @@ namespace
|
||||
const boost::int16_t li16 = 0x0102;
|
||||
# endif
|
||||
|
||||
const boost::uint64_t nui64 = 0x0102030405060708;
|
||||
const boost::uint64_t nui64 = 0x0102030405060708ULL;
|
||||
# ifdef BOOST_BIG_ENDIAN
|
||||
const boost::uint64_t bui64 = 0x0102030405060708;
|
||||
const boost::uint64_t lui64 = 0x0807060504030201;
|
||||
const boost::uint64_t bui64 = 0x0102030405060708ULL;
|
||||
const boost::uint64_t lui64 = 0x0807060504030201ULL;
|
||||
# else
|
||||
const boost::uint64_t bui64 = 0x0807060504030201;
|
||||
const boost::uint64_t lui64 = 0x0102030405060708;
|
||||
const boost::uint64_t bui64 = 0x0807060504030201ULL;
|
||||
const boost::uint64_t lui64 = 0x0102030405060708ULL;
|
||||
# endif
|
||||
|
||||
const boost::uint32_t nui32 = 0x01020304;
|
||||
@@ -332,11 +334,11 @@ namespace
|
||||
be::flip(i16);
|
||||
BOOST_TEST_EQ(i16, static_cast<boost::int16_t>(static_cast<boost::uint16_t>(0xfefd)));
|
||||
|
||||
ui64 = 0x0102030405060708;
|
||||
ui64 = 0x0102030405060708ULL;
|
||||
be::flip(ui64);
|
||||
BOOST_TEST_EQ(ui64, static_cast<boost::uint64_t>(0x0807060504030201));
|
||||
BOOST_TEST_EQ(ui64, static_cast<boost::uint64_t>(0x0807060504030201ULL));
|
||||
be::flip(ui64);
|
||||
BOOST_TEST_EQ(ui64, static_cast<boost::uint64_t>(0x0102030405060708));
|
||||
BOOST_TEST_EQ(ui64, static_cast<boost::uint64_t>(0x0102030405060708ULL));
|
||||
|
||||
ui32 = 0x01020304;
|
||||
be::flip(ui32);
|
||||
@@ -364,3 +366,5 @@ int cpp_main(int, char * [])
|
||||
|
||||
return ::boost::report_errors();
|
||||
}
|
||||
|
||||
#include <boost/endian/detail/disable_warnings_pop.hpp>
|
||||
|
@@ -7,7 +7,7 @@
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup>
|
||||
<ClCompile>
|
||||
<AdditionalIncludeDirectories>$(BOOST_SANDBOX)\endian;$(BOOST_TRUNK);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>..\..\..\..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<WarningLevel>EnableAllWarnings</WarningLevel>
|
||||
</ClCompile>
|
||||
<PostBuildEvent>
|
||||
|
@@ -58,7 +58,6 @@
|
||||
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
@@ -76,7 +75,6 @@
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
|
@@ -52,17 +52,11 @@ Global
|
||||
{1AAEBB4E-501E-417E-9531-04469AF5DD8B}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{1AAEBB4E-501E-417E-9531-04469AF5DD8B}.Release|Win32.Build.0 = Release|Win32
|
||||
{1382D085-FF3F-4573-8709-E10D3D74D620}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{1382D085-FF3F-4573-8709-E10D3D74D620}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{1382D085-FF3F-4573-8709-E10D3D74D620}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{1382D085-FF3F-4573-8709-E10D3D74D620}.Release|Win32.Build.0 = Release|Win32
|
||||
{AD46E04C-C1E1-446E-8D5F-E11B6C438181}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{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
|
||||
{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
|
||||
{06736C67-6305-4A9F-8D10-850FD0CE907D}.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
|
||||
|
@@ -55,7 +55,6 @@
|
||||
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
@@ -73,7 +72,6 @@
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
|
@@ -55,7 +55,7 @@
|
||||
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<WarningLevel>EnableAllWarnings</WarningLevel>
|
||||
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
@@ -73,7 +73,7 @@
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<WarningLevel>EnableAllWarnings</WarningLevel>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
|
@@ -54,7 +54,6 @@
|
||||
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
@@ -72,7 +71,6 @@
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
|
@@ -54,7 +54,6 @@
|
||||
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
|
||||
<DisableSpecificWarnings>4552;%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
||||
</ClCompile>
|
||||
@@ -74,7 +73,6 @@
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
|
@@ -54,7 +54,6 @@
|
||||
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
@@ -73,7 +72,6 @@
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
|
@@ -55,7 +55,6 @@
|
||||
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
@@ -73,7 +72,6 @@
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
|
@@ -11,6 +11,8 @@
|
||||
|
||||
#define BOOST_ENDIAN_FORCE_PODNESS
|
||||
|
||||
#include <boost/endian/detail/disable_warnings.hpp>
|
||||
|
||||
#include <boost/endian/integers.hpp>
|
||||
#include <boost/detail/lightweight_main.hpp>
|
||||
#include <cassert>
|
||||
|
@@ -17,6 +17,9 @@
|
||||
//----------------------------------------------------------------------------//
|
||||
|
||||
#define BOOST_ENDIAN_LOG
|
||||
#define BOOST_SHORT_ENDIAN_TEST 1
|
||||
|
||||
#include <boost/endian/detail/disable_warnings.hpp>
|
||||
|
||||
#include <boost/endian/integers.hpp>
|
||||
#include <boost/detail/lightweight_main.hpp>
|
||||
@@ -36,7 +39,8 @@ struct default_construct
|
||||
static void test()
|
||||
{
|
||||
T1 o1;
|
||||
o1 = 1; // quiet warnings
|
||||
o1 = 1; // quiet warnings
|
||||
if (o1) return; // quiet warnings
|
||||
}
|
||||
};
|
||||
|
||||
@@ -71,6 +75,7 @@ struct assign
|
||||
o2 = 1;
|
||||
T1 o1;
|
||||
o1 = o2;
|
||||
if (o1) return; // quiet warnings
|
||||
}
|
||||
};
|
||||
|
||||
@@ -104,6 +109,8 @@ struct op_plus
|
||||
o3 = o1 + o2;
|
||||
|
||||
o1 += o2;
|
||||
|
||||
if (o3) return; // quiet warnings
|
||||
}
|
||||
};
|
||||
|
||||
@@ -119,6 +126,8 @@ struct op_star
|
||||
o3 = o1 * o2;
|
||||
|
||||
o1 *= o2;
|
||||
|
||||
if (o3) return; // quiet warnings
|
||||
}
|
||||
};
|
||||
|
||||
|
@@ -16,6 +16,8 @@
|
||||
|
||||
//----------------------------------------------------------------------------//
|
||||
|
||||
#include <boost/endian/detail/disable_warnings.hpp>
|
||||
|
||||
#include <boost/endian/integers.hpp>
|
||||
#include <boost/cstdint.hpp>
|
||||
#include <boost/progress.hpp>
|
||||
@@ -539,7 +541,7 @@ namespace
|
||||
VERIFY_VALUE_AND_OPS( ubig56_t, uint_least64_t, 0xffffffffffffffLL );
|
||||
|
||||
VERIFY_BIG_REPRESENTATION( ubig64_t );
|
||||
VERIFY_VALUE_AND_OPS( ubig64_t, uint_least64_t, 0xffffffffffffffffLL );
|
||||
VERIFY_VALUE_AND_OPS( ubig64_t, uint_least64_t, 0xffffffffffffffffULL );
|
||||
|
||||
VERIFY_LITTLE_REPRESENTATION( little8_t );
|
||||
VERIFY_VALUE_AND_OPS( little8_t, int_least8_t, 0x7f );
|
||||
@@ -595,7 +597,7 @@ namespace
|
||||
VERIFY_VALUE_AND_OPS( ulittle56_t, uint_least64_t, 0xffffffffffffffLL );
|
||||
|
||||
VERIFY_LITTLE_REPRESENTATION( ulittle64_t );
|
||||
VERIFY_VALUE_AND_OPS( ulittle64_t, uint_least64_t, 0xffffffffffffffffLL );
|
||||
VERIFY_VALUE_AND_OPS( ulittle64_t, uint_least64_t, 0xffffffffffffffffULL );
|
||||
|
||||
VERIFY_NATIVE_REPRESENTATION( native8_t );
|
||||
VERIFY_VALUE_AND_OPS( native8_t, int_least8_t, 0x7f );
|
||||
@@ -651,7 +653,7 @@ namespace
|
||||
VERIFY_VALUE_AND_OPS( unative56_t, uint_least64_t, 0xffffffffffffffLL );
|
||||
|
||||
VERIFY_NATIVE_REPRESENTATION( unative64_t );
|
||||
VERIFY_VALUE_AND_OPS( unative64_t, uint_least64_t, 0xffffffffffffffffLL );
|
||||
VERIFY_VALUE_AND_OPS( unative64_t, uint_least64_t, 0xffffffffffffffffULL );
|
||||
|
||||
VERIFY_BIG_REPRESENTATION( aligned_big16_t );
|
||||
VERIFY_VALUE_AND_OPS( aligned_big16_t, int_least16_t, 0x7fff );
|
||||
@@ -672,7 +674,7 @@ namespace
|
||||
VERIFY_VALUE_AND_OPS( aligned_ubig32_t, uint_least32_t, 0xffffffff );
|
||||
|
||||
VERIFY_BIG_REPRESENTATION( aligned_ubig64_t );
|
||||
VERIFY_VALUE_AND_OPS( aligned_ubig64_t, uint_least64_t, 0xffffffffffffffffLL );
|
||||
VERIFY_VALUE_AND_OPS( aligned_ubig64_t, uint_least64_t, 0xffffffffffffffffULL );
|
||||
|
||||
VERIFY_LITTLE_REPRESENTATION( aligned_little16_t );
|
||||
VERIFY_VALUE_AND_OPS( aligned_little16_t, int_least16_t, 0x7fff );
|
||||
@@ -693,7 +695,7 @@ namespace
|
||||
VERIFY_VALUE_AND_OPS( aligned_ulittle32_t, uint_least32_t, 0xffffffff );
|
||||
|
||||
VERIFY_LITTLE_REPRESENTATION( aligned_ulittle64_t );
|
||||
VERIFY_VALUE_AND_OPS( aligned_ulittle64_t, uint_least64_t, 0xffffffffffffffffLL );
|
||||
VERIFY_VALUE_AND_OPS( aligned_ulittle64_t, uint_least64_t, 0xffffffffffffffffULL );
|
||||
|
||||
} // check_representation_and_range
|
||||
|
||||
|
@@ -7,6 +7,8 @@
|
||||
|
||||
// See documentation at http://www.boost.org/libs/utility/scoped_enum_emulation.html
|
||||
|
||||
#include <boost/endian/detail/disable_warnings.hpp>
|
||||
|
||||
#include <boost/detail/scoped_enum_emulation.hpp>
|
||||
#include <boost/assert.hpp>
|
||||
|
||||
@@ -38,5 +40,7 @@ int main()
|
||||
color tracker;
|
||||
tracker.value = color::value_t::blue;
|
||||
|
||||
if (tracker.value == color::value_t::blue) return 0; // quiet warnings
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
Reference in New Issue
Block a user