From c6b3134c2b0a03a6e54b069a2edef09865be01d8 Mon Sep 17 00:00:00 2001 From: Domagoj Saric Date: Fri, 11 Oct 2024 15:21:24 +0200 Subject: [PATCH] MSVC: fixed compiler warnings and a bogus assertion failure. --- include/psi/vm/containers/b+tree.hpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/psi/vm/containers/b+tree.hpp b/include/psi/vm/containers/b+tree.hpp index 8117bec..69632ea 100644 --- a/include/psi/vm/containers/b+tree.hpp +++ b/include/psi/vm/containers/b+tree.hpp @@ -456,7 +456,7 @@ class bptree_base_wkey : public bptree_base // TODO support for maps (i.e. keys+values) using value_type = Key; - static node_size_type constexpr storage_space{ node_size - align_up( sizeof( node_header ), alignof( Key ) ) }; + static node_size_type constexpr storage_space{ node_size - align_up( sizeof( node_header ), alignof( Key ) ) }; static node_size_type constexpr max_values { storage_space / sizeof( Key ) }; static node_size_type constexpr min_values { ihalf_ceil }; @@ -1014,7 +1014,7 @@ class bptree_base_wkey : public bptree_base BOOST_ASSUME( left .right == slot_of( right ) ); BOOST_ASSUME( right.left == slot_of( left ) ); - std::ranges::move( keys( right ), keys( left ).end() ); + std::ranges::move( keys( right ), &keys( left ).back() + 1 ); left .num_vals += right.num_vals; right.num_vals = 0; BOOST_ASSUME( left.num_vals >= 2 * min - 2 ); @@ -1551,10 +1551,10 @@ class bp_tree if ( less_than_right_pos != copy_size ) { BOOST_ASSUME( less_than_right_pos < copy_size ); - auto const input_end_for_target{ less_than_right_pos + source_offset }; + node_size_type const input_end_for_target( less_than_right_pos + source_offset ); BOOST_ASSUME( input_end_for_target > source_offset ); BOOST_ASSUME( input_end_for_target <= source.num_vals ); - copy_size = input_end_for_target - source_offset; + copy_size = static_cast( input_end_for_target - source_offset ); } }