From 659c76d321db23343c15baa0f9fc4ee9e2f04728 Mon Sep 17 00:00:00 2001 From: Michael Kuron <mkuron@icp.uni-stuttgart.de> Date: Thu, 31 Dec 2020 16:06:10 +0100 Subject: [PATCH] eliminate some warnings about range-based for loops incorrectly using references --- tests/core/GridGeneratorTest.cpp | 2 +- tests/geometry/BinaryRawFileTest.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/core/GridGeneratorTest.cpp b/tests/core/GridGeneratorTest.cpp index 7971b5f07..670279459 100644 --- a/tests/core/GridGeneratorTest.cpp +++ b/tests/core/GridGeneratorTest.cpp @@ -98,7 +98,7 @@ void rangeBasedTest() auto dx = Vector3<real_t>( Grid::iterator::getUnitCellX(spacing), Grid::iterator::getUnitCellY(spacing), Grid::iterator::getUnitCellZ(spacing) ); auto lowerIt = typename Grid::iterator(domain, Vector3<real_t>(5,5,5) - dx * 30, spacing); auto endIt = typename Grid::iterator(); - for ( const auto& pt : Grid(domain, Vector3<real_t>(5,5,5) - dx * 30, spacing) ) + for ( const auto pt : Grid(domain, Vector3<real_t>(5,5,5) - dx * 30, spacing) ) { WALBERLA_CHECK( lowerIt != endIt ); WALBERLA_CHECK_FLOAT_EQUAL( *lowerIt, pt); diff --git a/tests/geometry/BinaryRawFileTest.cpp b/tests/geometry/BinaryRawFileTest.cpp index cc219ea1b..22ce402d9 100644 --- a/tests/geometry/BinaryRawFileTest.cpp +++ b/tests/geometry/BinaryRawFileTest.cpp @@ -59,7 +59,7 @@ void test( const std::string & filename, const Vector3<uint_t> & size, const std CellInterval ci( 0, 0, 0, cell_idx_c( size[0] ) - 1, cell_idx_c( size[1] ) - 1, cell_idx_c( size[2] ) - 1 ); - for (const Cell & c : ci) + for (const Cell c : ci) { field->get( c ) = brf.get( uint_c( c[0] ), uint_c( c[1] ), uint_c( c[2] ) ); } @@ -100,7 +100,7 @@ void testScaled( const std::string & filename, const Vector3<uint_t> & size, con CellInterval ci( 0, 0, 0, cell_idx_c( scaledSize[0] ) - 1, cell_idx_c( scaledSize[1] ) - 1, cell_idx_c( scaledSize[2] ) - 1 ); - for (const Cell & c : ci) + for (const Cell c : ci) { auto pos = blocks->getBlockLocalCellCenter( block, c ); field->get( c ) = brfi.get( pos ); -- GitLab