File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -821,7 +821,7 @@ namespace fuzzy
821821 auto calc_steps = [&](element_type lhs, element_type rhs) -> std::size_t
822822 {
823823 assert (rhs.value () > lhs.value ());
824- std::size_t const steps = std::min (static_cast <std::size_t >(rhs.value () - lhs.value ()) - 1ull , step_count);
824+ std::size_t const steps = std::min (static_cast <std::size_t >(rhs.value () - lhs.value ()) - static_cast <std:: size_t >( 1 ) , step_count);
825825 return std::min (steps, buffer.size ());
826826 };
827827
Original file line number Diff line number Diff line change @@ -122,7 +122,7 @@ namespace fuzzy
122122 return itr;
123123 };
124124
125- std:: size_t const segment_count = static_cast <std:: size_t >(variable.size () - 1u );
125+ key_type const segment_count = static_cast <key_type >(variable.size () - static_cast <std:: size_t >( 1 ) );
126126 key_type const segment_ratio = static_cast <key_type>(1 ) / segment_count;
127127 for (basic_element<V, M> const & e : set)
128128 {
@@ -134,7 +134,7 @@ namespace fuzzy
134134 assert (itr_lower->value () <= e.value ());
135135 assert (itr_upper != variable.end () && e.value () <= itr_upper->value ());
136136
137- key_type const offset = static_cast <key_type>(e.value ()) - itr_lower->value ();
137+ key_type const offset = static_cast <key_type>(e.value () - itr_lower->value () );
138138 key_type const segment_range = static_cast <key_type>(itr_upper->value () - itr_lower->value ());
139139 key_type const offset_ratio = offset / segment_range;
140140 assert (static_cast <key_type>(0 ) <= offset_ratio && offset_ratio <= static_cast <key_type>(1 ));
Original file line number Diff line number Diff line change @@ -72,7 +72,7 @@ namespace fuzzy
7272 {
7373 // Calcualte the index and get the matching itr in consequent/destination.
7474 key_type const offset = ele.value () / median_segment_ratio;
75- std::size_t const index = static_cast <std::size_t >(offset);
75+ std::ptrdiff_t const index = static_cast <std::ptrdiff_t >(offset);
7676 auto itr = dst.cbegin () + index;
7777 key_type const remainder = offset - static_cast <key_type>(index);
7878 assert (static_cast <key_type>(0 ) <= remainder && remainder <= static_cast <key_type>(1 ));
You can’t perform that action at this time.
0 commit comments