Skip to content

Commit 78f5d17

Browse files
authored
Merge pull request #2293 from wlbksy/master
fix -Wshadow and -Wunused-local-typedef warning
2 parents be8fe08 + 39dc1d7 commit 78f5d17

File tree

3 files changed

+8
-10
lines changed

3 files changed

+8
-10
lines changed

include/xtensor/xaccumulator.hpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -198,11 +198,10 @@ namespace xt
198198
inline auto accumulator_impl(F&& f, E&& e, std::size_t axis, evaluation_strategy::immediate_type)
199199
{
200200
using init_type = typename F::init_value_type;
201-
using init_functor_type = typename F::init_functor_type;
202201
using accumulate_functor_type = typename F::accumulate_functor_type;
203202
using expr_value_type = typename std::decay_t<E>::value_type;
204203
//using return_type = std::conditional_t<std::is_same<init_type, void>::value, typename std::decay_t<E>::value_type, init_type>;
205-
204+
206205
using return_type = std::decay_t<decltype(std::declval<accumulate_functor_type>()(std::declval<init_type>(),
207206
std::declval<expr_value_type>()))>;
208207
using result_type = xaccumulator_return_type_t<std::decay_t<E>, return_type>;
@@ -247,7 +246,7 @@ namespace xt
247246
inner_loop_size = inner_loop_size - inner_stride;
248247

249248
// activate the init loop if we have an init function other than identity
250-
if (!std::is_same<std::decay_t<typename F::init_functor_type>,
249+
if (!std::is_same<std::decay_t<typename F::init_functor_type>,
251250
typename detail::accumulator_identity<init_type>>::value)
252251
{
253252
accumulator_init_with_f(xt::get<1>(f), result, axis);

include/xtensor/xreducer.hpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -610,7 +610,7 @@ namespace xt
610610
}
611611

612612
private:
613-
613+
614614
// Workaround for clang-cl
615615
const base_type& upcast() const
616616
{
@@ -694,7 +694,7 @@ namespace xt
694694
using merge_functor_type = typename std::decay_t<F>::merge_functor_type;
695695
using substepper_type = typename xexpression_type::const_stepper;
696696
using raw_value_type = std::decay_t<decltype(std::declval<reduce_functor_type>()(
697-
std::declval<init_functor_type>()(),
697+
std::declval<init_functor_type>()(),
698698
*std::declval<substepper_type>())
699699
)>;
700700
using value_type = typename detail::evaluated_value_type_t<raw_value_type, is_xexpression<raw_value_type>::value>;
@@ -851,12 +851,11 @@ namespace xt
851851

852852
using reduce_functor_type = typename std::decay_t<F>::reduce_functor_type;
853853
using init_functor_type = typename std::decay_t<F>::init_functor_type;
854-
using init_value_type = typename init_functor_type::value_type;
855854
using value_type = std::decay_t<decltype(std::declval<reduce_functor_type>()(
856855
std::declval<init_functor_type>()(),
857856
*std::declval<typename std::decay_t<E>::const_stepper>()))>;
858857
using evaluated_value_type = evaluated_value_type_t<value_type, is_xexpression<value_type>::value>;
859-
858+
860859
using reducer_type = xreducer<F, const_xclosure_t<E>, xtl::const_closure_type_t<decltype(normalized_axes)>, reducer_options<evaluated_value_type, std::decay_t<O>>>;
861860
return reducer_type(std::forward<F>(f), std::forward<E>(e), std::forward<decltype(normalized_axes)>(normalized_axes), std::forward<O>(options));
862861
}
@@ -1091,7 +1090,7 @@ namespace xt
10911090
{
10921091
return const_value<U>(t.m_value);
10931092
}
1094-
};
1093+
};
10951094
}
10961095

10971096
/*******************************************

include/xtensor/xrepeat.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -263,8 +263,8 @@ namespace xt
263263
, m_repeats(std::forward<R>(repeats))
264264
, m_shape(e.shape())
265265
{
266-
using value_type = typename shape_type::value_type;
267-
m_shape[axis] = static_cast<value_type>(std::accumulate(m_repeats.begin(), m_repeats.end(), 0));
266+
using shape_value_type = typename shape_type::value_type;
267+
m_shape[axis] = static_cast<shape_value_type>(std::accumulate(m_repeats.begin(), m_repeats.end(), 0));
268268
}
269269

270270
/**

0 commit comments

Comments
 (0)