Skip to content
Snippets Groups Projects
Commit 4596048a authored by Tobias Leibner's avatar Tobias Leibner
Browse files

use [[maybe_unused]] some more

parent dbecef6f
No related branches found
No related tags found
Loading
Pipeline #64883 failed
...@@ -125,7 +125,7 @@ private: ...@@ -125,7 +125,7 @@ private:
typedef FixedMap<key_imp, T, nin> ThisType; typedef FixedMap<key_imp, T, nin> ThisType;
std::string range_error_message(key_imp key) const std::string range_error_message([[maybe_unused]] key_imp key) const
{ {
std::stringstream ss; std::stringstream ss;
if constexpr (std::is_convertible<key_imp, std::string>::value) { if constexpr (std::is_convertible<key_imp, std::string>::value) {
......
...@@ -129,10 +129,8 @@ std::string whitespaceify(const T& t, const char whitespace = ' ') ...@@ -129,10 +129,8 @@ std::string whitespaceify(const T& t, const char whitespace = ' ')
{ {
const std::string s = to_string(t); const std::string s = to_string(t);
std::string ret = ""; std::string ret = "";
for (auto ii : value_range(s.size())) { for ([[maybe_unused]] auto ii : value_range(s.size()))
ret += whitespace; ret += whitespace;
(void)ii;
}
return ret; return ret;
} // ... whitespaceify(...) } // ... whitespaceify(...)
......
...@@ -417,10 +417,11 @@ private: ...@@ -417,10 +417,11 @@ private:
template <class FullType, class SingleType> template <class FullType, class SingleType>
void single_derivative_helper_call(const std::vector<FullType>& val, void single_derivative_helper_call(const std::vector<FullType>& val,
const size_t row, const size_t row,
const size_t col, [[maybe_unused]] const size_t col,
std::vector<SingleType>& ret) const std::vector<SingleType>& ret) const
{ {
if constexpr (rC == 1) { if constexpr (rC == 1) {
assert(col == 0);
for (size_t ii = 0; ii < val.size(); ++ii) for (size_t ii = 0; ii < val.size(); ++ii)
ret[ii] = val[ii][row]; ret[ii] = val[ii][row];
} else { } else {
...@@ -705,9 +706,10 @@ public: ...@@ -705,9 +706,10 @@ public:
private: private:
template <class FullType> template <class FullType>
static SingleDerivativeRangeType static SingleDerivativeRangeType
single_derivative_helper_call(const FullType& val, const size_t row, const size_t col) single_derivative_helper_call(const FullType& val, const size_t row, [[maybe_unused]] const size_t col)
{ {
if constexpr (rC == 1) { if constexpr (rC == 1) {
assert(col == 0);
return val[row]; return val[row];
} else { } else {
SingleDerivativeRangeType ret; SingleDerivativeRangeType ret;
......
...@@ -83,10 +83,8 @@ size_t max_number_of_neighbors(const GridLayerType& grid_layer) ...@@ -83,10 +83,8 @@ size_t max_number_of_neighbors(const GridLayerType& grid_layer)
size_t maxNeighbours = 0; size_t maxNeighbours = 0;
for (auto&& entity : elements(grid_layer)) { for (auto&& entity : elements(grid_layer)) {
size_t neighbours = 0; size_t neighbours = 0;
for (auto&& intersection : intersections(grid_layer, entity)) { for ([[maybe_unused]] auto&& intersection : intersections(grid_layer, entity))
(void)intersection; // silence unused variable warning
++neighbours; ++neighbours;
}
maxNeighbours = std::max(maxNeighbours, neighbours); maxNeighbours = std::max(maxNeighbours, neighbours);
} }
return maxNeighbours; return maxNeighbours;
......
...@@ -45,9 +45,8 @@ GTEST_TEST(ProfilerTest, Timing) ...@@ -45,9 +45,8 @@ GTEST_TEST(ProfilerTest, Timing)
GTEST_TEST(ProfilerTest, ScopedTiming) GTEST_TEST(ProfilerTest, ScopedTiming)
{ {
const auto dvalue_range = value_range(1, 4); const auto dvalue_range = value_range(1, 4);
for ([[maybe_unused] auto i : dvalue_range) { for ([[maybe_unused]] auto i : dvalue_range)
scoped_busywait("ProfilerTest.ScopedTiming", wait_ms); scoped_busywait("ProfilerTest.ScopedTiming", wait_ms);
}
EXPECT_GE(DXTC_TIMINGS.walltime("ProfilerTest.ScopedTiming"), long(dvalue_range.size() * wait_ms)); EXPECT_GE(DXTC_TIMINGS.walltime("ProfilerTest.ScopedTiming"), long(dvalue_range.size() * wait_ms));
} }
......
...@@ -80,8 +80,7 @@ struct PeriodicViewTest : public testing::Test ...@@ -80,8 +80,7 @@ struct PeriodicViewTest : public testing::Test
const PeriodicGridViewType periodic_grid_view(grid_view, periodic_directions); const PeriodicGridViewType periodic_grid_view(grid_view, periodic_directions);
// check interface // check interface
const GridType& test_grid = periodic_grid_view.grid(); [[maybe_unused]] const GridType& test_grid = periodic_grid_view.grid();
(void)test_grid;
const IndexSet& index_set = periodic_grid_view.indexSet(); const IndexSet& index_set = periodic_grid_view.indexSet();
const int codim0_size = periodic_grid_view.size(0); const int codim0_size = periodic_grid_view.size(0);
EXPECT_EQ(grid_view.size(0), codim0_size); EXPECT_EQ(grid_view.size(0), codim0_size);
...@@ -95,8 +94,7 @@ struct PeriodicViewTest : public testing::Test ...@@ -95,8 +94,7 @@ struct PeriodicViewTest : public testing::Test
EXPECT_EQ(grid_view.overlapSize(1), periodic_grid_view.overlapSize(1)); EXPECT_EQ(grid_view.overlapSize(1), periodic_grid_view.overlapSize(1));
EXPECT_EQ(grid_view.ghostSize(0), periodic_grid_view.ghostSize(0)); EXPECT_EQ(grid_view.ghostSize(0), periodic_grid_view.ghostSize(0));
EXPECT_EQ(grid_view.ghostSize(1), periodic_grid_view.ghostSize(1)); EXPECT_EQ(grid_view.ghostSize(1), periodic_grid_view.ghostSize(1));
const CollectiveCommunication& test_comm = periodic_grid_view.comm(); [[maybe_unused]] const CollectiveCommunication& test_comm = periodic_grid_view.comm();
(void)test_comm;
size_t neighbor_count = 0; size_t neighbor_count = 0;
...@@ -106,8 +104,7 @@ struct PeriodicViewTest : public testing::Test ...@@ -106,8 +104,7 @@ struct PeriodicViewTest : public testing::Test
for (auto&& element : elements(periodic_grid_view)) { for (auto&& element : elements(periodic_grid_view)) {
EXPECT_TRUE(periodic_grid_view.contains(element)); EXPECT_TRUE(periodic_grid_view.contains(element));
EXPECT_TRUE(index_set.contains(element)); EXPECT_TRUE(index_set.contains(element));
const auto sub_index = index_set.subIndex(element, 0, 1); [[maybe_unused]] const auto sub_index = index_set.subIndex(element, 0, 1);
(void)sub_index;
// iterate over all intersections on current element // iterate over all intersections on current element
for (auto&& intersection : intersections(periodic_grid_view, element)) { for (auto&& intersection : intersections(periodic_grid_view, element)) {
if (intersection.neighbor()) { if (intersection.neighbor()) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment