Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix shadowing warning #12960

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 7 additions & 7 deletions include/deal.II/base/array_view.h
Original file line number Diff line number Diff line change
Expand Up @@ -394,10 +394,10 @@ inline ArrayView<ElementType, MemorySpaceType>::ArrayView()

template <typename ElementType, typename MemorySpaceType>
inline ArrayView<ElementType, MemorySpaceType>::ArrayView(
value_type * starting_element,
const std::size_t n_elements)
: starting_element(starting_element)
, n_elements(n_elements)
value_type * starting_element_,
const std::size_t n_elements_)
: starting_element(starting_element_)
, n_elements(n_elements_)
{
Assert(
n_elements == 0 ||
Expand All @@ -411,10 +411,10 @@ inline ArrayView<ElementType, MemorySpaceType>::ArrayView(

template <typename ElementType, typename MemorySpaceType>
inline void
ArrayView<ElementType, MemorySpaceType>::reinit(value_type *starting_element,
const std::size_t n_elements)
ArrayView<ElementType, MemorySpaceType>::reinit(value_type * start_element,
const std::size_t n_elems)
{
*this = ArrayView(starting_element, n_elements);
*this = ArrayView(start_element, n_elems);
}


Expand Down
4 changes: 2 additions & 2 deletions include/deal.II/base/bounding_box.h
Original file line number Diff line number Diff line change
Expand Up @@ -406,15 +406,15 @@ namespace internal
template <int spacedim, typename Number>
inline BoundingBox<spacedim, Number>::BoundingBox(
const std::pair<Point<spacedim, Number>, Point<spacedim, Number>>
&boundary_points)
&boundary_pts)
{
// We check the Bounding Box is not degenerate
for (unsigned int i = 0; i < spacedim; ++i)
Assert(boundary_points.first[i] <= boundary_points.second[i],
ExcMessage("Bounding Box can't be created: the points' "
"order should be bottom left, top right!"));

this->boundary_points = boundary_points;
this->boundary_points = boundary_pts;
}


Expand Down
4 changes: 2 additions & 2 deletions include/deal.II/base/geometry_info.h
Original file line number Diff line number Diff line change
Expand Up @@ -2684,8 +2684,8 @@ GeometryInfo<3>::d_linear_shape_function_gradient(const Point<3> & xi,
/* -------------- inline functions ------------- */


inline GeometryPrimitive::GeometryPrimitive(const Object object)
: object(object)
inline GeometryPrimitive::GeometryPrimitive(const Object object_)
: object(object_)
{}


Expand Down
8 changes: 4 additions & 4 deletions include/deal.II/base/index_set.h
Original file line number Diff line number Diff line change
Expand Up @@ -1029,9 +1029,9 @@ complete_index_set(const IndexSet::size_type N)

inline IndexSet::IntervalAccessor::IntervalAccessor(
const IndexSet * idxset,
const IndexSet::size_type range_idx)
const IndexSet::size_type range_idx_)
: index_set(idxset)
, range_idx(range_idx)
, range_idx(range_idx_)
{
Assert(range_idx < idxset->n_intervals(),
ExcInternalError("Invalid range index"));
Expand Down Expand Up @@ -1270,10 +1270,10 @@ IndexSet::IntervalIterator::operator-(

inline IndexSet::ElementIterator::ElementIterator(
const IndexSet * idxset,
const IndexSet::size_type range_idx,
const IndexSet::size_type range_idx_,
const IndexSet::size_type index)
: index_set(idxset)
, range_idx(range_idx)
, range_idx(range_idx_)
, idx(index)
{
Assert(range_idx < index_set->ranges.size(),
Expand Down
4 changes: 2 additions & 2 deletions include/deal.II/base/linear_index_iterator.h
Original file line number Diff line number Diff line change
Expand Up @@ -502,8 +502,8 @@ LinearIndexIterator<DerivedIterator, AccessorType>::operator>(

template <class DerivedIterator, class AccessorType>
inline LinearIndexIterator<DerivedIterator, AccessorType>::LinearIndexIterator(
const AccessorType accessor)
: accessor(accessor)
const AccessorType accessor_)
: accessor(accessor_)
{}


Expand Down
6 changes: 3 additions & 3 deletions include/deal.II/base/mpi.h
Original file line number Diff line number Diff line change
Expand Up @@ -348,9 +348,9 @@ namespace Utilities
/**
* Constructor. Blocks until it can acquire the lock.
*/
explicit ScopedLock(CollectiveMutex &mutex, const MPI_Comm &comm)
: mutex(mutex)
, comm(comm)
explicit ScopedLock(CollectiveMutex &mutex_, const MPI_Comm &comm_)
: mutex(mutex_)
, comm(comm_)
{
mutex.lock(comm);
}
Expand Down
18 changes: 9 additions & 9 deletions include/deal.II/base/parallel.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ namespace parallel
/**
* Constructor. Take and package the given function object.
*/
Body(const F &f)
: f(f)
Body(const F &f_)
: f(f_)
{}

template <typename Range>
Expand Down Expand Up @@ -555,13 +555,13 @@ namespace parallel
* std::plus<int>().
*/
template <typename Reductor>
ReductionOnSubranges(const Function & f,
const Reductor & reductor,
const ResultType neutral_element = ResultType())
: result(neutral_element)
, f(f)
, neutral_element(neutral_element)
, reductor(reductor)
ReductionOnSubranges(const Function & f_,
const Reductor & reductor_,
const ResultType neutral_element_ = ResultType())
: result(neutral_element_)
, f(f_)
, neutral_element(neutral_element_)
, reductor(reductor_)
{}

/**
Expand Down
12 changes: 6 additions & 6 deletions include/deal.II/base/patterns.h
Original file line number Diff line number Diff line change
Expand Up @@ -1413,16 +1413,16 @@ namespace Patterns
namespace Patterns
{
template <class... PatternTypes>
Tuple::Tuple(const char *separator, const PatternTypes &...ps)
Tuple::Tuple(const char *separator_, const PatternTypes &...ps)
: // forward to the version with std::string argument
Tuple(std::string(separator), ps...)
Tuple(std::string(separator_), ps...)
{}



template <class... PatternTypes>
Tuple::Tuple(const std::string &separator, const PatternTypes &...ps)
: separator(separator)
Tuple::Tuple(const std::string &separator_, const PatternTypes &...ps)
: separator(separator_)
{
static_assert(is_base_of_all<PatternBase, PatternTypes...>::value,
"Not all of the input arguments of this function "
Expand Down Expand Up @@ -1872,8 +1872,8 @@ namespace Patterns
std::string s;
if (vec.size() > 0)
s = vec[0];
for (unsigned int i = 1; i < vec.size(); ++i)
s += p->get_separator() + " " + vec[i];
for (unsigned int j = 1; j < vec.size(); ++j)
s += p->get_separator() + " " + vec[j];

AssertThrow(p->match(s), ExcNoMatch(s, p->description()));
return s;
Expand Down
4 changes: 2 additions & 2 deletions include/deal.II/base/polynomials_pyramid.h
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,8 @@ ScalarLagrangePolynomialPyramid<dim>::compute_derivative(
Assert(order == 1, ExcNotImplemented());
const auto grad = compute_grad(i, p);

for (unsigned int i = 0; i < dim; ++i)
der[i] = grad[i];
for (unsigned int d = 0; d < dim; ++d)
der[d] = grad[d];

return der;
}
Expand Down
4 changes: 2 additions & 2 deletions include/deal.II/base/polynomials_wedge.h
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,8 @@ ScalarLagrangePolynomialWedge<dim>::compute_derivative(
AssertDimension(order, 1);
const auto grad = compute_grad(i, p);

for (unsigned int i = 0; i < dim; ++i)
der[i] = grad[i];
for (unsigned int d = 0; d < dim; ++d)
der[d] = grad[d];

return der;
}
Expand Down
4 changes: 2 additions & 2 deletions include/deal.II/base/qprojector.h
Original file line number Diff line number Diff line change
Expand Up @@ -546,8 +546,8 @@ class QProjector

template <int dim>
inline QProjector<dim>::DataSetDescriptor::DataSetDescriptor(
const unsigned int dataset_offset)
: dataset_offset(dataset_offset)
const unsigned int dataset_offset_)
: dataset_offset(dataset_offset_)
{}


Expand Down
10 changes: 5 additions & 5 deletions include/deal.II/base/smartpointer.h
Original file line number Diff line number Diff line change
Expand Up @@ -224,8 +224,8 @@ inline SmartPointer<T, P>::SmartPointer()


template <typename T, typename P>
inline SmartPointer<T, P>::SmartPointer(T *t)
: t(t)
inline SmartPointer<T, P>::SmartPointer(T *t_)
: t(t_)
, id(typeid(P).name())
, pointed_to_object_is_alive(false)
{
Expand All @@ -236,9 +236,9 @@ inline SmartPointer<T, P>::SmartPointer(T *t)


template <typename T, typename P>
inline SmartPointer<T, P>::SmartPointer(T *t, const std::string &id)
: t(t)
, id(id)
inline SmartPointer<T, P>::SmartPointer(T *t_, const std::string &id_)
: t(t_)
, id(id_)
, pointed_to_object_is_alive(false)
{
if (t != nullptr)
Expand Down
16 changes: 8 additions & 8 deletions include/deal.II/base/symmetric_tensor.h
Original file line number Diff line number Diff line change
Expand Up @@ -1104,10 +1104,10 @@ namespace internal
template <int rank_, int dim, bool constness, int P, typename Number>
constexpr DEAL_II_ALWAYS_INLINE
Accessor<rank_, dim, constness, P, Number>::Accessor(
tensor_type & tensor,
const TableIndices<rank_> &previous_indices)
: tensor(tensor)
, previous_indices(previous_indices)
tensor_type & tensor_,
const TableIndices<rank_> &previous_indices_)
: tensor(tensor_)
, previous_indices(previous_indices_)
{}


Expand Down Expand Up @@ -1139,10 +1139,10 @@ namespace internal
template <int rank_, int dim, bool constness, typename Number>
constexpr DEAL_II_ALWAYS_INLINE
Accessor<rank_, dim, constness, 1, Number>::Accessor(
tensor_type & tensor,
const TableIndices<rank_> &previous_indices)
: tensor(tensor)
, previous_indices(previous_indices)
tensor_type & tensor_,
const TableIndices<rank_> &previous_indices_)
: tensor(tensor_)
, previous_indices(previous_indices_)
{}


Expand Down
16 changes: 8 additions & 8 deletions include/deal.II/base/table.h
Original file line number Diff line number Diff line change
Expand Up @@ -2200,10 +2200,10 @@ namespace internal
namespace TableBaseAccessors
{
template <int N, typename T, bool C, unsigned int P>
inline Accessor<N, T, C, P>::Accessor(const TableType &table,
const iterator data)
: table(table)
, data(data)
inline Accessor<N, T, C, P>::Accessor(const TableType &table_,
const iterator data_)
: table(table_)
, data(data_)
{}


Expand Down Expand Up @@ -2243,10 +2243,10 @@ namespace internal


template <int N, typename T, bool C>
inline Accessor<N, T, C, 1>::Accessor(const TableType &table,
const iterator data)
: table(table)
, data(data)
inline Accessor<N, T, C, 1>::Accessor(const TableType &table_,
const iterator data_)
: table(table_)
, data(data_)
{}


Expand Down
32 changes: 16 additions & 16 deletions include/deal.II/base/tensor_product_polynomials_bubbles.h
Original file line number Diff line number Diff line change
Expand Up @@ -341,11 +341,11 @@ TensorProductPolynomialsBubbles<dim>::compute_derivative(
{
derivative_1[d] = 1.;
// compute grad(4*\prod_{i=1}^d (x_i(1-x_i)))(p)
for (unsigned j = 0; j < dim; ++j)
for (unsigned int j = 0; j < dim; ++j)
derivative_1[d] *=
(d == j ? 4 * (1 - 2 * p(j)) : 4 * p(j) * (1 - p(j)));
// and multiply with (2*x_i-1)^{r-1}
for (unsigned int i = 0; i < q_degree - 1; ++i)
for (unsigned int j = 0; j < q_degree - 1; ++j)
derivative_1[d] *= 2 * p(comp) - 1;
}

Expand All @@ -357,7 +357,7 @@ TensorProductPolynomialsBubbles<dim>::compute_derivative(
value *= 4 * p(j) * (1 - p(j));
// and multiply with grad(2*x_i-1)^{r-1}
double tmp = value * 2 * (q_degree - 1);
for (unsigned int i = 0; i < q_degree - 2; ++i)
for (unsigned int j = 0; j < q_degree - 2; ++j)
tmp *= 2 * p(comp) - 1;
derivative_1[comp] += tmp;
}
Expand All @@ -379,26 +379,26 @@ TensorProductPolynomialsBubbles<dim>::compute_derivative(
}

double tmp = 1.;
for (unsigned int i = 0; i < q_degree - 1; ++i)
for (unsigned int j = 0; j < q_degree - 1; ++j)
tmp *= 2 * p(comp) - 1;
v[dim][0] = tmp;

if (q_degree >= 2)
{
double tmp = 2 * (q_degree - 1);
for (unsigned int i = 0; i < q_degree - 2; ++i)
tmp *= 2 * p(comp) - 1;
v[dim][1] = tmp;
double tmp_v = 2 * (q_degree - 1);
for (unsigned int j = 0; j < q_degree - 2; ++j)
tmp_v *= 2 * p(comp) - 1;
v[dim][1] = tmp_v;
}
else
v[dim][1] = 0.;

if (q_degree >= 3)
{
double tmp = 4 * (q_degree - 2) * (q_degree - 1);
for (unsigned int i = 0; i < q_degree - 3; ++i)
tmp *= 2 * p(comp) - 1;
v[dim][2] = tmp;
double tmp_v = 4 * (q_degree - 2) * (q_degree - 1);
for (unsigned int j = 0; j < q_degree - 3; ++j)
tmp_v *= 2 * p(comp) - 1;
v[dim][2] = tmp_v;
}
else
v[dim][2] = 0.;
Expand All @@ -412,15 +412,15 @@ TensorProductPolynomialsBubbles<dim>::compute_derivative(
grad_grad_1[d1][d2] = v[dim][0];
for (unsigned int x = 0; x < dim; ++x)
{
unsigned int derivative = 0;
unsigned int derivative_idx = 0;
if (d1 == x || d2 == x)
{
if (d1 == d2)
derivative = 2;
derivative_idx = 2;
else
derivative = 1;
derivative_idx = 1;
}
grad_grad_1[d1][d2] *= v[x][derivative];
grad_grad_1[d1][d2] *= v[x][derivative_idx];
}
}

Expand Down
4 changes: 2 additions & 2 deletions include/deal.II/base/thread_management.h
Original file line number Diff line number Diff line change
Expand Up @@ -1198,8 +1198,8 @@ namespace Threads
* Constructor. Initializes an std::future object and assumes
* that the task so set has not finished yet.
*/
TaskData(std::future<RT> &&future)
: future(std::move(future))
TaskData(std::future<RT> &&future_)
: future(std::move(future_))
, task_has_finished(false)
{}

Expand Down
6 changes: 3 additions & 3 deletions include/deal.II/base/vectorization.h
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,9 @@ class VectorizedArrayIterator
* @param data The actual VectorizedArray.
* @param lane A pointer to the current lane.
*/
VectorizedArrayIterator(T &data, const std::size_t lane)
: data(&data)
, lane(lane)
VectorizedArrayIterator(T &data_, const std::size_t lane_)
: data(&data_)
, lane(lane_)
{}

/**
Expand Down