From d69678d3941cee8654fc2e3dd73208332b4ce8e2 Mon Sep 17 00:00:00 2001 From: Herbert Jordan Date: Tue, 21 Mar 2017 09:40:33 +0100 Subject: [PATCH] Fixed compiler warnings regarding issues identified by clang. --- .gitignore | 2 +- .../api/core/impl/reference/treeture.h | 2 +- code/api/include/allscale/api/user/data/map.h | 8 ++++---- .../include/allscale/api/user/operator/pfor.h | 18 ++++++++++-------- code/api/test/user/operator/pfor.cc | 8 ++++---- 5 files changed, 20 insertions(+), 18 deletions(-) diff --git a/.gitignore b/.gitignore index b630a9a..c578924 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ -build/ +build*/ third_party/ # Editor Specific diff --git a/code/api/include/allscale/api/core/impl/reference/treeture.h b/code/api/include/allscale/api/core/impl/reference/treeture.h index b118dca..22e2351 100755 --- a/code/api/include/allscale/api/core/impl/reference/treeture.h +++ b/code/api/include/allscale/api/core/impl/reference/treeture.h @@ -585,7 +585,7 @@ namespace reference { public: template - dependencies(const Args& ... args) : list({args...}) {} + dependencies(const Args& ... args) : list({{args...}}) {} dependencies(const dependencies&) = default; dependencies(dependencies&&) = default; diff --git a/code/api/include/allscale/api/user/data/map.h b/code/api/include/allscale/api/user/data/map.h index 2d88a58..3543e84 100755 --- a/code/api/include/allscale/api/user/data/map.h +++ b/code/api/include/allscale/api/user/data/map.h @@ -140,7 +140,7 @@ namespace user { /** * An operator to load an instance of this range from the given archive. */ - static SetRegion load(utils::Archive& a) { + static SetRegion load(utils::Archive&) { assert_not_implemented(); return SetRegion(); } @@ -148,7 +148,7 @@ namespace user { /** * An operator to store an instance of this range into the given archive. */ - void store(utils::Archive& a) const { + void store(utils::Archive&) const { assert_not_implemented(); // nothing so far } @@ -255,11 +255,11 @@ namespace user { } } - void save(utils::Archive& a, const region_type& keys) const { + void save(utils::Archive&, const region_type&) const { assert_not_implemented(); } - void load(utils::Archive& a) { + void load(utils::Archive&) { assert_not_implemented(); } diff --git a/code/api/include/allscale/api/user/operator/pfor.h b/code/api/include/allscale/api/user/operator/pfor.h index 76e4656..85fc9c9 100755 --- a/code/api/include/allscale/api/user/operator/pfor.h +++ b/code/api/include/allscale/api/user/operator/pfor.h @@ -748,7 +748,9 @@ namespace user { template class neighborhood_sync_dependency : public detail::loop_dependency { - std::array,3> deps; + using deps_list = std::array,3>; + + deps_list deps; std::size_t size; @@ -758,7 +760,7 @@ namespace user { public: neighborhood_sync_dependency(const detail::iteration_reference& loop) - : deps({ loop }), size(1) {} + : deps({{ loop }}), size(1) {} auto toCoreDependencies() const { return core::after(deps[0],deps[1],deps[2]); @@ -776,12 +778,12 @@ namespace user { const iter_dependency& right = dependency.getRight(); // combine sub-dependencies - iter_dependency start ({left.getRange().begin(),left.getRange().begin()}); - iter_dependency finish({right.getRange().end(), right.getRange().end() }); + iter_dependency start ({{left.getRange().begin(),left.getRange().begin()}}); + iter_dependency finish({{right.getRange().end(), right.getRange().end() }}); return { - neighborhood_sync_dependency({ start, left, right }), - neighborhood_sync_dependency({ left, right, finish }) + neighborhood_sync_dependency(deps_list{{ start, left, right }}), + neighborhood_sync_dependency(deps_list{{ left, right, finish }}) }; } @@ -807,8 +809,8 @@ namespace user { // and pack accordingly return { - leftPart.covers(left.grow(full)) ? neighborhood_sync_dependency({ a,b,c }) : *this, - rightPart.covers(right.grow(full)) ? neighborhood_sync_dependency({ b,c,d }) : *this + leftPart.covers(left.grow(full)) ? neighborhood_sync_dependency(deps_list{{ a,b,c }}) : *this, + rightPart.covers(right.grow(full)) ? neighborhood_sync_dependency(deps_list{{ b,c,d }}) : *this }; } diff --git a/code/api/test/user/operator/pfor.cc b/code/api/test/user/operator/pfor.cc index ee95883..c954120 100644 --- a/code/api/test/user/operator/pfor.cc +++ b/code/api/test/user/operator/pfor.cc @@ -146,8 +146,8 @@ namespace user { using Point = std::array; using Grid = std::array,N>,N>; - Point zero = {0,0,0}; - Point full = {N,N,N}; + Point zero = {{0,0,0}}; + Point full = {{N,N,N}}; // create data Grid* data = new Grid(); @@ -550,8 +550,8 @@ namespace user { using range = detail::range>; - range limit({0,2},{5,7}); - range a({1,4},{2,5}); + range limit({{0,2}},{{5,7}}); + range a({{1,4}},{{2,5}}); EXPECT_EQ("[[0,2],[5,7])",toString(limit)); EXPECT_EQ("[[1,4],[2,5])",toString(a));