Skip to content

Commit

Permalink
Fix some warnings in tests with clang-10
Browse files Browse the repository at this point in the history
  • Loading branch information
masterleinad committed Apr 7, 2020
1 parent 062850b commit 3cffc4c
Show file tree
Hide file tree
Showing 11 changed files with 24 additions and 23 deletions.
2 changes: 1 addition & 1 deletion tests/base/mpi_noncontiguous_partitioner_02.cc
Expand Up @@ -81,7 +81,7 @@ test(const MPI_Comm &comm, const bool do_revert, const unsigned int dir)
for (unsigned int i = 0; i < dim; i++)
c[i] = c[i] / delta;

const unsigned int lid = norm_point_to_lex(c);
const auto lid = static_cast<unsigned int>(norm_point_to_lex(c));

for (unsigned int i = lid * n_points_cell;
i < (lid + 1) * n_points_cell;
Expand Down
2 changes: 1 addition & 1 deletion tests/base/transpose_table_iterators_1.cc
Expand Up @@ -31,7 +31,7 @@ main()
// test a non-empty rectangular table
TransposeTable<double> table(3, 4);
std::iota(table.begin(), table.end(), 1.0);
for (const auto entry : table)
for (const auto &entry : table)
{
deallog << entry.row() << ", " << entry.column() << ", " << entry.value()
<< std::endl;
Expand Down
2 changes: 1 addition & 1 deletion tests/data_out/data_out_12.cc
Expand Up @@ -132,7 +132,7 @@ check()
{
// find matching location
unsigned int p = 0;
for (const auto c : coords)
for (const auto &c : coords)
{
Point<dim> point;
for (unsigned int d = 0; d < dim; ++d)
Expand Down
2 changes: 1 addition & 1 deletion tests/data_out/data_out_13.cc
Expand Up @@ -132,7 +132,7 @@ check()
{
// find matching location
unsigned int p = 0;
for (const auto c : coords)
for (const auto &c : coords)
{
Point<dim> point;
for (unsigned int d = 0; d < dim; ++d)
Expand Down
Expand Up @@ -103,7 +103,7 @@ test(unsigned n_refinements)
for (TransferRep::value_type::const_iterator it = m.begin();
it != m.end();
++it)
local_sum += it->second;
local_sum += static_cast<unsigned int>(it->second);
}

unsigned global_sum = Utilities::MPI::sum(local_sum, MPI_COMM_WORLD);
Expand Down
3 changes: 2 additions & 1 deletion tests/grid/mesh_3d_17.cc
Expand Up @@ -111,7 +111,8 @@ void check(Triangulation<3> &tria)
// we used to abort in the
// following call, due to a
// wrong Assert condition:
cell->neighbor_child_on_subface(face_no, subface_no);
auto dummy =
cell->neighbor_child_on_subface(face_no, subface_no);
}
}
}
Expand Down
8 changes: 4 additions & 4 deletions tests/grid/user_data_01.cc
Expand Up @@ -179,11 +179,11 @@ user_pointers(Triangulation<dim> &tr)
// Create two pointer index clashes here
try
{
tr.begin()->user_index();
auto dummy = tr.begin()->user_index();
}
catch (...)
{}
tr.begin()->user_pointer();
auto dummy = tr.begin()->user_pointer();


// Check if save and load work
Expand Down Expand Up @@ -259,13 +259,13 @@ user_indices(Triangulation<dim> &tr)
// Create two pointer index clashes here
try
{
tr.begin()->user_pointer();
auto dummy = tr.begin()->user_pointer();
}
catch (ExceptionBase &e)
{
deallog << e.get_exc_name() << std::endl;
}
tr.begin()->user_index();
auto dummy = tr.begin()->user_index();



Expand Down
2 changes: 1 addition & 1 deletion tests/matrix_free/iterators.cc
Expand Up @@ -105,7 +105,7 @@ class Test
for (const auto cell : cells)
deallog << "cell: " << cell.to_string() << std::endl;

for (const auto face : faces)
for (const auto &face : faces)
deallog << "face: " << face.first.to_string() << " "
<< face.second.to_string() << std::endl;

Expand Down
16 changes: 8 additions & 8 deletions tests/matrix_free/mapping_info_01.cc
Expand Up @@ -55,14 +55,14 @@ test(const unsigned int degree)
data.mapping_update_flags_boundary_faces =
(update_gradients | update_JxW_values);

mf_data.reinit(
mapping,
std::vector<const DoFHandler<dim> *>({{&dof}}),
std::vector<const AffineConstraints<double> *>({{&constraints}}),
std::vector<Quadrature<1>>({{QGauss<1>(std::max(degree / 2, 1U)),
QGauss<1>(degree + 1),
QGauss<1>(3 * degree / 2)}}),
data);
mf_data.reinit(mapping,
std::vector<const DoFHandler<dim> *>{&dof},
std::vector<const AffineConstraints<double> *>{&constraints},
std::vector<Quadrature<1>>{
{QGauss<1>(std::max(degree / 2, 1U)),
QGauss<1>(degree + 1),
QGauss<1>(3 * degree / 2)}},
data);

deallog << std::setw(5) << degree;
for (unsigned int index = 0; index < 3; ++index)
Expand Down
6 changes: 3 additions & 3 deletions tests/mpi/parallel_partitioner_09.cc
Expand Up @@ -38,15 +38,15 @@ main(int argc, char **argv)
Utilities::MPI::Partitioner part(owned, ghosted, MPI_COMM_WORLD);

deallog << "ghost targets: ";
for (const auto p : part.ghost_targets())
for (const auto &p : part.ghost_targets())
deallog << "p" << p.first << " n_indices=" << p.second << " ";
deallog << std::endl;
deallog << "import targets: ";
for (const auto p : part.import_targets())
for (const auto &p : part.import_targets())
deallog << "p" << p.first << " n_indices=" << p.second << " ";
deallog << std::endl;
deallog << "import indices: ";
for (const auto p : part.import_indices())
for (const auto &p : part.import_indices())
deallog << "[" << p.first << " " << p.second << ") ";
deallog << std::endl;
}
2 changes: 1 addition & 1 deletion tests/numerics/project_bv_curl_conf_04.cc
Expand Up @@ -69,7 +69,6 @@ test_boundary_values(DoFHandler<dim> & dof_handler,
unsigned int start_comp,
Vector<double> & vec)
{
double ret = true;
// Initialize
QGaussLobatto<dim - 1> quadrature(3);
FEFaceValues<dim> fe_values(mapping,
Expand Down Expand Up @@ -138,6 +137,7 @@ test_boundary_values(DoFHandler<dim> & dof_handler,
num_cells++;
}
// Test if ok
bool ret = true;
for (unsigned int bc = 0; bc < 6; ++bc)
{
for (unsigned int basis = 0; basis < dof_handler.n_dofs(); basis++)
Expand Down

0 comments on commit 3cffc4c

Please sign in to comment.