@@ -77,7 +77,7 @@ namespace xt
7777 {
7878 XTENSOR_ASSERT (ev.dimension () >= 2 );
7979
80- const std:: size_t n_iters = leading_axis_n_iters (ev);
80+ const auto n_iters = as_signed ( leading_axis_n_iters (ev) );
8181 const std::ptrdiff_t secondary_stride = get_secondary_stride (ev);
8282
8383 const auto begin = ev.data ();
@@ -94,7 +94,7 @@ namespace xt
9494 XTENSOR_ASSERT (e1 .dimension () >= 2 );
9595 XTENSOR_ASSERT (e1 .dimension () == e2 .dimension ());
9696
97- const std:: size_t n_iters = leading_axis_n_iters (e1 );
97+ const auto n_iters = as_signed ( leading_axis_n_iters (e1 ) );
9898 const std::ptrdiff_t secondary_stride1 = get_secondary_stride (e1 );
9999 const std::ptrdiff_t secondary_stride2 = get_secondary_stride (e2 );
100100 XTENSOR_ASSERT (secondary_stride1 == secondary_stride2);
@@ -294,7 +294,7 @@ namespace xt
294294 template <class ConstRandomIt , class RandomIt , class Compare , class Method >
295295 inline void argsort_iter (
296296 ConstRandomIt data_begin,
297- ConstRandomIt data_end,
297+ [[maybe_unused]] ConstRandomIt data_end,
298298 RandomIt idx_begin,
299299 RandomIt idx_end,
300300 Compare comp,
@@ -315,7 +315,7 @@ namespace xt
315315 idx_end,
316316 [&](const auto i, const auto j)
317317 {
318- return comp (*(data_begin + i) , *(data_begin + j ));
318+ return comp (*(data_begin + as_signed (i)) , *(data_begin + as_signed (j) ));
319319 }
320320 );
321321 }
@@ -326,7 +326,7 @@ namespace xt
326326 idx_end,
327327 [&](const auto i, const auto j)
328328 {
329- return comp (*(data_begin + i) , *(data_begin + j ));
329+ return comp (*(data_begin + as_signed (i)) , *(data_begin + as_signed (j) ));
330330 }
331331 );
332332 }
@@ -784,7 +784,7 @@ namespace xt
784784 for (auto i : indices)
785785 {
786786 auto idx = current_index;
787- idx[current_dim] = i ;
787+ idx[current_dim] = as_signed (i) ;
788788 select_indices_impl (shape, indices, axis, current_dim + 1 , idx, out);
789789 }
790790 }
@@ -793,7 +793,7 @@ namespace xt
793793 for (id_t i = 0 ; xtl::cmp_less (i, shape[current_dim]); ++i)
794794 {
795795 auto idx = current_index;
796- idx[current_dim] = i ;
796+ idx[current_dim] = as_signed (i) ;
797797 select_indices_impl (shape, indices, axis, current_dim + 1 , idx, out);
798798 }
799799 }
@@ -802,7 +802,7 @@ namespace xt
802802 for (auto i : indices)
803803 {
804804 auto idx = current_index;
805- idx[current_dim] = i ;
805+ idx[current_dim] = as_signed (i) ;
806806 out.push_back (std::move (idx));
807807 }
808808 }
@@ -811,7 +811,7 @@ namespace xt
811811 for (id_t i = 0 ; xtl::cmp_less (i, shape[current_dim]); ++i)
812812 {
813813 auto idx = current_index;
814- idx[current_dim] = i ;
814+ idx[current_dim] = as_signed (i) ;
815815 out.push_back (std::move (idx));
816816 }
817817 }
@@ -834,7 +834,7 @@ namespace xt
834834 const std::size_t ax = normalize_axis (e.dimension (), axis);
835835 using shape_t = get_strides_t <typename std::decay_t <E>::shape_type>;
836836 auto shape = xtl::forward_sequence<shape_t , decltype (e.shape ())>(e.shape ());
837- shape[ax] = indices.size ();
837+ shape[ax] = as_signed ( indices.size () );
838838 return reshape_view (
839839 index_view (std::forward<E>(e), select_indices (e.shape (), indices, ax)),
840840 std::move (shape)
@@ -915,12 +915,12 @@ namespace xt
915915 auto kth_gamma = detail::quantile_kth_gamma<T, id_t , P>(n, probas, alpha, beta);
916916
917917 // Select relevant values for computing interpolating quantiles
918- auto e_partition = xt::partition (std::forward<E>(e), kth_gamma.first , ax );
919- auto e_kth = detail::fancy_indexing (std::move (e_partition), std::move (kth_gamma.first ), ax );
918+ auto e_partition = xt::partition (std::forward<E>(e), kth_gamma.first , as_signed (ax) );
919+ auto e_kth = detail::fancy_indexing (std::move (e_partition), std::move (kth_gamma.first ), as_signed (ax) );
920920
921921 // Reshape interpolation coefficients
922922 auto gm1_g_shape = xtl::make_sequence<tmp_shape_t >(e.dimension (), 1 );
923- gm1_g_shape[ax] = kth_gamma.second .size ();
923+ gm1_g_shape[ax] = as_signed ( kth_gamma.second .size () );
924924 auto gm1_g_reshaped = reshape_view (std::move (kth_gamma.second ), std::move (gm1_g_shape));
925925
926926 // Compute interpolation
@@ -930,9 +930,9 @@ namespace xt
930930 auto e_kth_g_shape = detail::unsqueeze_shape (e_kth_g.shape (), ax);
931931 e_kth_g_shape[ax] = 2 ;
932932 e_kth_g_shape[ax + 1 ] /= 2 ;
933- auto quantiles = xt::sum (reshape_view (std::move (e_kth_g), std::move (e_kth_g_shape)), ax );
933+ auto quantiles = xt::sum (reshape_view (std::move (e_kth_g), std::move (e_kth_g_shape)), as_signed (ax) );
934934 // Cannot do a transpose on a non-strided expression so we have to eval
935- return moveaxis (eval (std::move (quantiles)), ax , 0 );
935+ return moveaxis (eval (std::move (quantiles)), as_signed (ax) , 0 );
936936 }
937937
938938 // Static proba array overload
0 commit comments