Skip to content

Commit

Permalink
Fixing internal types
Browse files Browse the repository at this point in the history
  • Loading branch information
tdegeus committed Mar 15, 2022
1 parent 751f3ae commit b52e855
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
10 changes: 5 additions & 5 deletions include/xtensor/xbuilder.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -941,20 +941,20 @@ namespace xt
{
if (i != m_axis_1 && i != m_axis_2)
{
idx[i] = *begin++;
idx[i] = static_cast<std::size_t>(*begin++);
}
}
using it_vtype = typename std::iterator_traits<It>::value_type;
it_vtype uoffset = static_cast<it_vtype>(m_offset);
if (m_offset >= 0)
{
idx[m_axis_1] = *(begin);
idx[m_axis_2] = *(begin) + uoffset;
idx[m_axis_1] = static_cast<std::size_t>(*(begin));
idx[m_axis_2] = static_cast<std::size_t>(*(begin) + uoffset);
}
else
{
idx[m_axis_1] = *(begin) - uoffset;
idx[m_axis_2] = *(begin);
idx[m_axis_1] = static_cast<std::size_t>(*(begin) - uoffset);
idx[m_axis_2] = static_cast<std::size_t>(*(begin));
}
return m_source[idx];
}
Expand Down
2 changes: 1 addition & 1 deletion include/xtensor/xrepeat.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ namespace xt
inline auto xrepeat<CT, R>::element(It first, It last) const -> const_reference
{
auto s = stepper_begin(m_e.shape());
auto dimension = 0;
std::size_t dimension = 0;
auto iter = first;
while (iter != last)
{
Expand Down
8 changes: 4 additions & 4 deletions include/xtensor/xsort.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -279,15 +279,15 @@ namespace xt
{
n_iters = std::accumulate(data.shape().begin(), data.shape().end() - 1,
std::size_t(1), std::multiplies<>());
data_secondary_stride = data.shape(data.dimension() - 1);
inds_secondary_stride = inds.shape(inds.dimension() - 1);
data_secondary_stride = static_cast<std::ptrdiff_t>(data.shape(data.dimension() - 1));
inds_secondary_stride = static_cast<std::ptrdiff_t>(inds.shape(inds.dimension() - 1));
}
else
{
n_iters = std::accumulate(data.shape().begin() + 1, data.shape().end(),
std::size_t(1), std::multiplies<>());
data_secondary_stride = data.shape(0);
inds_secondary_stride = inds.shape(0);
data_secondary_stride = static_cast<std::ptrdiff_t>(data.shape(0));
inds_secondary_stride = static_cast<std::ptrdiff_t>(inds.shape(0));
}

auto ptr = data.data();
Expand Down

0 comments on commit b52e855

Please sign in to comment.