mirror of
https://github.com/boostorg/functional.git
synced 2025-08-01 05:24:31 +02:00
Merge hash from trunk.
- Avoid `-Wconversion` warnings. [SVN r67664]
This commit is contained in:
@@ -3,6 +3,9 @@
|
||||
# Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
using boostbook ;
|
||||
using quickbook ;
|
||||
|
||||
xml hash : hash.qbk ;
|
||||
boostbook standalone : hash :
|
||||
<xsl:param>boost.root=../../../../..
|
||||
|
@@ -119,4 +119,8 @@
|
||||
it's opt-in for now. This, or something like it, will become the
|
||||
default in a future version.
|
||||
|
||||
[h2 Boost 1.46.0]
|
||||
|
||||
* Avoid warning due with gcc's `-Wconversion` flag.
|
||||
|
||||
[endsect]
|
||||
|
@@ -11,8 +11,8 @@ project hash-tests
|
||||
<warnings>all
|
||||
<toolset>intel:<warnings>on
|
||||
<toolset>intel:<cxxflags>-strict-ansi
|
||||
<toolset>gcc:<cxxflags>"-pedantic -Wstrict-aliasing -fstrict-aliasing -Wextra -Wsign-promo -Wunused-parameter"
|
||||
<toolset>darwin:<cxxflags>"-pedantic -Wstrict-aliasing -fstrict-aliasing -Wextra -Wsign-promo -Wunused-parameter"
|
||||
<toolset>gcc:<cxxflags>"-pedantic -Wstrict-aliasing -fstrict-aliasing -Wextra -Wsign-promo -Wunused-parameter -Wconversion"
|
||||
<toolset>darwin:<cxxflags>"-pedantic -Wstrict-aliasing -fstrict-aliasing -Wextra -Wsign-promo -Wunused-parameter -Wconversion"
|
||||
<toolset>msvc:<warnings-as-errors>on
|
||||
#<toolset>gcc:<warnings-as-errors>on
|
||||
#<toolset>darwin:<warnings-as-errors>on
|
||||
@@ -25,8 +25,8 @@ test-suite functional/hash
|
||||
[ run hash_number_test.cpp ]
|
||||
[ run hash_pointer_test.cpp ]
|
||||
[ run hash_function_pointer_test.cpp ]
|
||||
[ run hash_float_test.cpp : : : <test-info>always_show_run_output ]
|
||||
[ run hash_long_double_test.cpp : : : <test-info>always_show_run_output ]
|
||||
[ run hash_float_test.cpp ]
|
||||
[ run hash_long_double_test.cpp ]
|
||||
[ run hash_string_test.cpp ]
|
||||
[ run hash_range_test.cpp ]
|
||||
[ run hash_custom_test.cpp ]
|
||||
|
@@ -69,7 +69,7 @@ void complex_float_tests(Float*)
|
||||
generic_complex_tests(complex(0.5,0));
|
||||
generic_complex_tests(complex(25,0));
|
||||
generic_complex_tests(complex(25,0));
|
||||
generic_complex_tests(complex(-67.5324535,56.23578678));
|
||||
generic_complex_tests(complex(static_cast<Float>(-67.5324535),static_cast<Float>(56.23578678)));
|
||||
}
|
||||
|
||||
template <class Integer>
|
||||
|
@@ -113,7 +113,8 @@ void poor_quality_tests(T*)
|
||||
if(T(1) != T(2))
|
||||
BOOST_TEST(x1(T(1)) != x2(T(2)));
|
||||
if((limits::max)() != (limits::max)() - 1)
|
||||
BOOST_TEST(x1((limits::max)()) != x2((limits::max)() - 1));
|
||||
BOOST_TEST(x1(static_cast<T>((limits::max)()))
|
||||
!= x2(static_cast<T>((limits::max)() - 1)));
|
||||
}
|
||||
|
||||
void bool_test()
|
||||
|
@@ -53,7 +53,7 @@ namespace boost
|
||||
|
||||
v = ldexp(v, limits<std::size_t>::digits);
|
||||
std::size_t seed = static_cast<std::size_t>(v);
|
||||
v -= seed;
|
||||
v -= static_cast<T>(seed);
|
||||
|
||||
// ceiling(digits(T) * log2(radix(T))/ digits(size_t)) - 1;
|
||||
std::size_t const length
|
||||
@@ -66,7 +66,7 @@ namespace boost
|
||||
{
|
||||
v = ldexp(v, limits<std::size_t>::digits);
|
||||
std::size_t part = static_cast<std::size_t>(v);
|
||||
v -= part;
|
||||
v -= static_cast<T>(part);
|
||||
hash_float_combine(seed, part);
|
||||
}
|
||||
|
||||
|
@@ -210,8 +210,8 @@ namespace boost
|
||||
#endif
|
||||
{
|
||||
#if defined(__VMS) && __INITIAL_POINTER_SIZE == 64
|
||||
// for some reason ptrdiff_t on OpenVMS compiler with
|
||||
// 64 bit is not 64 bit !!!
|
||||
// for some reason ptrdiff_t on OpenVMS compiler with
|
||||
// 64 bit is not 64 bit !!!
|
||||
std::size_t x = static_cast<std::size_t>(
|
||||
reinterpret_cast<long long int>(v));
|
||||
#else
|
||||
|
Reference in New Issue
Block a user