From 28fc6890119ab2528b242693b87a3e47c32c9de7 Mon Sep 17 00:00:00 2001 From: joaquintides Date: Sun, 5 May 2024 18:30:42 +0200 Subject: [PATCH] avoided shorten-64-to-32 and sign-conversion warnings --- test/unordered/stats_tests.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/test/unordered/stats_tests.cpp b/test/unordered/stats_tests.cpp index a9315cd4..351f07d6 100644 --- a/test/unordered/stats_tests.cpp +++ b/test/unordered/stats_tests.cpp @@ -220,8 +220,8 @@ template void test_stats() using value_type = typename Container::value_type; test::random_values l2(15000, test::sequential); - std::vector v2(l2.begin(), l2.end()); - std::atomic found{0}, not_found{0}; + std::vector v2(l2.begin(), l2.end()); + std::atomic found{0}, not_found{0}; thread_runner(v2, [&cc, &found, ¬_found](boost::span sp) { // Half the span looked up elementwise auto sp1 = boost::make_span(sp.begin(), sp.size()/2); @@ -232,7 +232,8 @@ template void test_stats() // Second half looked up in bulk std::vector ksp2; - for (auto const& x : boost::make_span(sp1.end(), sp.end())) { + for (auto const& x : boost::make_span( + sp1.end(), static_cast(sp.end() - sp1.end()))) { ksp2.push_back(test::get_key(x)); } auto visited = cc.visit( @@ -244,7 +245,7 @@ template void test_stats() #else test::random_values v2(15000, test::sequential); - int found = 0, not_found = 0; + std::size_t found = 0, not_found = 0; for (const auto& x: v2) { if (cc.contains(test::get_key(x))) ++found; else ++not_found;