Remove -Wconversion warnings

This commit is contained in:
Ion Gaztañaga committed 2021-10-05 23:30:54 +02:00
1 parent 6ab49a8d82
commit 122a84b366
9 files changed
+89 -59

No files matched your search

+3 -1
View File
@@ -31,7 +31,9 @@ using boost::move_detail::nanosecond_type;
void print_stats(const char *str, boost::ulong_long_type element_count)
{
std::printf("%sCmp:%8.04f Cpy:%9.04f\n", str, double(order_perf_type::num_compare)/element_count, double(order_perf_type::num_copy)/element_count );
std::printf( "%sCmp:%8.04f Cpy:%9.04f\n", str
, double(order_perf_type::num_compare)/double(element_count)
, double(order_perf_type::num_copy)/double(element_count));
}
#include <boost/move/algo/adaptive_merge.hpp>
+3 -1
View File
@@ -30,7 +30,9 @@ using boost::move_detail::nanosecond_type;
//#define BOOST_MOVE_ADAPTIVE_SORT_INVARIANTS
void print_stats(const char *str, boost::ulong_long_type element_count)
{
std::printf("%sCmp:%7.03f Cpy:%8.03f\n", str, double(order_perf_type::num_compare)/element_count, double(order_perf_type::num_copy)/element_count );
std::printf( "%sCmp:%7.03f Cpy:%8.03f\n", str
, double(order_perf_type::num_compare)/double(element_count)
, double(order_perf_type::num_copy)/double(element_count) );
}
+1 -1
View File
@@ -26,7 +26,7 @@ void random_shuffle( RandomIt first, RandomIt last )
typedef typename boost::movelib::iterator_traits<RandomIt>::difference_type difference_type;
difference_type n = last - first;
for (difference_type i = n-1; i > 0; --i) {
difference_type j = ullrand() % (i+1);
difference_type j = static_cast<difference_type>(ullrand() % (i+1));
if(j != i) {
boost::adl_move_swap(first[i], first[j]);
}