mirror of
https://github.com/boostorg/functional.git
synced 2025-08-02 14:04:27 +02:00
Avoid -Wconversion
warnings in unordered & hash.
[SVN r67170]
This commit is contained in:
@@ -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
|
||||
|
@@ -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);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user